C
Composer
My class has an inner class as follows (irrelevant parts omitted):
class ResultInstance
{ private int[] s;
// Constructor method
public ResultInstance(int[] series)
{ s = series;
System.out.println(PitchClassSet.toString(s)); // At
this point it's fine !!!
}
protected int[] getSeries()
{ System.out.println(PitchClassSet.toString(s)); // By now
it's been screwed up !!!
return s;
}
}
At the point where the main class creates a new ResultInstance, I can
verify that the array "s" is fine.
All the ResultInstances are put into a Vector. Later I pull them out
using an Enumeration.
At that point, some of the "s" arrays have been replaced with those
that belong to later ResultInstances.
No doubt I'm doing something stupid. Can someone help me spot it?
Thanks.
class ResultInstance
{ private int[] s;
// Constructor method
public ResultInstance(int[] series)
{ s = series;
System.out.println(PitchClassSet.toString(s)); // At
this point it's fine !!!
}
protected int[] getSeries()
{ System.out.println(PitchClassSet.toString(s)); // By now
it's been screwed up !!!
return s;
}
}
At the point where the main class creates a new ResultInstance, I can
verify that the array "s" is fine.
All the ResultInstances are put into a Vector. Later I pull them out
using an Enumeration.
At that point, some of the "s" arrays have been replaced with those
that belong to later ResultInstances.
No doubt I'm doing something stupid. Can someone help me spot it?
Thanks.