/** * Returns the number of elements (a.k.a. rows or cells) in the column * * @return size as int */ @Override public int size() { return values.size(); }
@Override public int size() { return data.size(); }
public double[] asDoubleArray() { double[] doubles = new double[data.size()]; for (int i = 0; i < size(); i++) { doubles[i] = data.getByte(i); } return doubles; }
public Selection eval(Predicate<Boolean> predicate) { Selection selection = new BitmapBackedSelection(); for (int idx = 0; idx < data.size(); idx++) { if (predicate.test(get(idx))) { selection.add(idx); } } return selection; }
public Selection eval(BiPredicate<Boolean, Boolean> predicate, Boolean valueToCompare) { Selection selection = new BitmapBackedSelection(); for (int idx = 0; idx < data.size(); idx++) { if (predicate.test(get(idx), valueToCompare)) { selection.add(idx); } } return selection; }
public Selection eval(BytePredicate predicate) { Selection selection = new BitmapBackedSelection(); for (int idx = 0; idx < data.size(); idx++) { byte next = data.getByte(idx); if (predicate.test(next)) { selection.add(idx); } } return selection; }
@Override public Selection selectIsIn(Collection<String> strings) { ByteOpenHashSet keys = new ByteOpenHashSet(); for (String string : strings) { byte key = getKeyForValue(string); if (key != DEFAULT_RETURN_VALUE) { keys.add(key); } } Selection results = new BitmapBackedSelection(); for (int i = 0; i < values.size(); i++) { if (keys.contains(values.getByte(i))) { results.add(i); } } return results; }
@Override public Selection selectIsIn(String... strings) { ByteOpenHashSet keys = new ByteOpenHashSet(); for (String string : strings) { byte key = getKeyForValue(string); if (key != DEFAULT_RETURN_VALUE) { keys.add(key); } } Selection results = new BitmapBackedSelection(); for (int i = 0; i < values.size(); i++) { if (keys.contains(values.getByte(i))) { results.add(i); } } return results; }
/** * Returns the number of elements (a.k.a. rows or cells) in the column * * @return size as int */ @Override public int size() { return values.size(); }
@Override public void updateChildren(boolean first) { children.clear(); for (int i = 0; i < list.size(); i++) { String s = Integer.toString(i); ButtonNBT nbt = getFrom(this, s); children.put(s, nbt); nbt.updateChildren(first); } }
/** Moves to the next posting in the posting list and returns true if such a posting * exists. */ boolean nextPosting() { do { offset++; if (offset >= postingList.size()) return false; } while (postingList.get(offset - 1) != 0); // previous byte is not a separator byte return true; } }
public static BooleanColumn create(String fileName, ByteArrayList bools) { BooleanColumn booleanColumn = new BooleanColumn(fileName, bools.size()); booleanColumn.data.addAll(bools); return booleanColumn; }
public double[] asDoubleArray() { double[] doubles = new double[data.size()]; for (int i = 0; i < size(); i++) { doubles[i] = data.getByte(i); } return doubles; }
private int addBlock(ObjectArrayList<AlignmentBlock> blocks, int start, ByteArrayList bases, ByteArrayList scores) { blocks.add( new AlignmentBlockImpl(start, bases.toByteArray(new byte[bases.size()]), scores.toByteArray(new byte[scores.size()]))); start += bases.size(); bases.clear(); scores.clear(); return start; }
public Selection eval(Predicate<Boolean> predicate) { Selection selection = new BitmapBackedSelection(); for (int idx = 0; idx < data.size(); idx++) { if (predicate.test(get(idx))) { selection.add(idx); } } return selection; }
public Selection eval(BiPredicate<Boolean, Boolean> predicate, Boolean valueToCompare) { Selection selection = new BitmapBackedSelection(); for (int idx = 0; idx < data.size(); idx++) { if (predicate.test(get(idx), valueToCompare)) { selection.add(idx); } } return selection; }
public Selection select(BooleanPredicate predicate) { Selection selection = new BitmapBackedSelection(); for (int idx = 0; idx < data.size(); idx++) { byte next = data.getByte(idx); if (predicate.test(next)) { selection.add(idx); } } return selection; }
public Selection eval(BytePredicate predicate) { Selection selection = new BitmapBackedSelection(); for (int idx = 0; idx < data.size(); idx++) { byte next = data.getByte(idx); if (predicate.test(next)) { selection.add(idx); } } return selection; }