count = 0;
// initialise the array with data
while (true) {
ObjectValue tupleObject = (ObjectValue)base.next();
if (tupleObject == null) {
break;
}
ValueRepresentation[] tuple = (ValueRepresentation[])tupleObject.getObject();
if (count==allocated) {
allocated *= 2;
Object[] nk2 = new Object[allocated * recordSize];
System.arraycopy(nodeKeys, 0, nk2, 0, count * recordSize);
nodeKeys = nk2;
}
int k = count*recordSize;
nodeKeys[k] = new ObjectValue(tuple[0]);
// this is the "item" that will be returned by the TupleIterator.
// In general it is actually a sequence, so we wrap it in an ObjectValue
// It subsequently gets unwrapped by the MappingFunction applied to the
// output of the SortedTupleIterator.
for (int n=1; n<=comparators.length; n++) {