/** Returns a list view onto a data set. */ public static List asList(final Representation representation, final Object dataSet) { // Cache size. It might be expensive to compute. final int size = representation.size(dataSet); return new AbstractList() { public Object get(int index) { return representation.getObject(dataSet, index); } public int size() { return size; } }; } }
/** Returns a list view onto a data set. */ public static List asList(final Representation representation, final Object dataSet) { // Cache size. It might be expensive to compute. final int size = representation.size(dataSet); return new AbstractList() { public Object get(int index) { return representation.getObject(dataSet, index); } public int size() { return size; } }; } }
public int size(Object dataSet) { final Pair<Object, Comparable[]> pair = (Pair<Object, Comparable[]>) dataSet; return representation.size(pair.left); }
public int size(Object dataSet) { final Pair<Object, Comparable[]> pair = (Pair<Object, Comparable[]>) dataSet; return representation.size(pair.left); }