@Override
public void readFields(DataInput in) throws IOException {
representedAsList = in.readBoolean();
VIntWritable vInt = new VIntWritable();
VLongWritable vLong = new VLongWritable();
if (representedAsList) {
transactionSet = new ArrayList<Pair<List<Integer>,Long>>();
vInt.readFields(in);
int numTransactions = vInt.get();
for (int i = 0; i < numTransactions; i++) {
vLong.readFields(in);
Long support = vLong.get();
vInt.readFields(in);
int length = vInt.get();
Integer[] items = new Integer[length];
for (int j = 0; j < length; j++) {
vInt.readFields(in);
items[j] = vInt.get();
}
Pair<List<Integer>,Long> transaction = new Pair<List<Integer>,Long>(Arrays.asList(items), support);
transactionSet.add(transaction);
}
} else {
vInt.readFields(in);
nodes = vInt.get();
attribute = new int[nodes];
nodeCount = new long[nodes];
childCount = new int[nodes];
nodeChildren = new int[nodes][];
for (int i = 0; i < nodes; i++) {
vInt.readFields(in);
attribute[i] = vInt.get();
vLong.readFields(in);
nodeCount[i] = vLong.get();
vInt.readFields(in);
int childCountI = vInt.get();
childCount[i] = childCountI;
nodeChildren[i] = new int[childCountI];
for (int j = 0; j < childCountI; j++) {