S
steve
I have a set of data stored in a vector, which is used to display a table on
screen.
the user is allowed to select the table col, and sort the data (ass/dec) as
follows:
colindex= col number
ascending= true/false
Vector data = model.getDataVector();
Collections.sort(data, new
utils.columnSorter(colIndex,ascending));
The actual vector contains an object for each row in the table.
so the basic object may contain a collection of strings/dates/ int
as the interface is standard:
public int compare(Object a, Object b)
so i need to be passed 2 objects into "compare"
this then needs splitting down either into :
1. an object array
2. a vector
so basically i need to take a single object & split it down into a multiple
array, but it needs to be type safe, so it cannot just be converted to an
array of strings.
I would prefer a vector so that i can use
public int compare(Object a, Object b) {
Vector myvector1=a;
Vector myvector2=b;
Object myobject1 =myvector1.get(colIndex);
Object myobject2 =myvector2.get(colIndex);
do instanceof testing/ for string /int/date etc.
can anyone give me a hand on how to split a single object into a multi
object, or into a vector.
screen.
the user is allowed to select the table col, and sort the data (ass/dec) as
follows:
colindex= col number
ascending= true/false
Vector data = model.getDataVector();
Collections.sort(data, new
utils.columnSorter(colIndex,ascending));
The actual vector contains an object for each row in the table.
so the basic object may contain a collection of strings/dates/ int
as the interface is standard:
public int compare(Object a, Object b)
so i need to be passed 2 objects into "compare"
this then needs splitting down either into :
1. an object array
2. a vector
so basically i need to take a single object & split it down into a multiple
array, but it needs to be type safe, so it cannot just be converted to an
array of strings.
I would prefer a vector so that i can use
public int compare(Object a, Object b) {
Vector myvector1=a;
Vector myvector2=b;
Object myobject1 =myvector1.get(colIndex);
Object myobject2 =myvector2.get(colIndex);
do instanceof testing/ for string /int/date etc.
can anyone give me a hand on how to split a single object into a multi
object, or into a vector.