/** * Returns the value in row i as a byte (0, 1, or Byte.MIN_VALUE representing missing data) * * @param i the row number */ public byte getByte(int i) { return data.getByte(i); }
@Override public int getKeyForIndex(int rowIndex) { return values.getByte(rowIndex); }
/** * Returns the value in row i as a Boolean * * @param i the row number * @return A Boolean object (may be null) */ @Override public Boolean get(int i) { byte b = data.getByte(i); if (b == BooleanColumnType.BYTE_TRUE) { return Boolean.TRUE; } if (b == BooleanColumnType.BYTE_FALSE) { return Boolean.FALSE; } return null; }
@Override public String getValueForIndex(int rowIndex) { byte k = values.getByte(rowIndex); return getValueForKey(k); }
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(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; }
public DoubleColumn asDoubleColumn() { DoubleColumn numberColumn = DoubleColumn.create(this.name(), size()); ByteArrayList data = data(); for (int i = 0; i < size(); i++) { numberColumn.append(data.getByte(i)); } return numberColumn; }
@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; }
@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; }
/** * Returns the value in row i as a byte (0, 1, or Byte.MIN_VALUE representing missing data) * * @param i the row number */ public byte getByte(int i) { return data.getByte(i); }
/** * Returns the value in row i as a byte (0, 1, or Byte.MIN_VALUE representing missing data) * @param i the row number */ public byte getByte(int i) { return data.getByte(i); }
@Override public int getKeyForIndex(int rowIndex) { return values.getByte(rowIndex); }
@Override public String getValueForIndex(int rowIndex) { byte k = values.getByte(rowIndex); return getValueForKey(k); }
@Override public NBTBase getTag(String k) { return new NBTTagByte(list.getByte(Integer.parseInt(k))); }
public double[] asDoubleArray() { double[] doubles = new double[data.size()]; for (int i = 0; i < size(); i++) { doubles[i] = data.getByte(i); } return doubles; }
public int[] toIntArray() { int[] output = new int[data.size()]; for (int i = 0; i < data.size(); i++) { output[i] = data.getByte(i); } return output; }
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; }
public DoubleColumn asDoubleColumn() { DoubleColumn numberColumn = DoubleColumn.create(this.name(), size()); ByteArrayList data = data(); for (int i = 0; i < size(); i++) { numberColumn.append(data.getByte(i)); } return numberColumn; }
public IntColumn toIntColumn() { IntColumn intColumn = IntColumn.create(this.name() + ": ints", size()); ByteArrayList data = data(); for (int i = 0; i < size(); i++) { intColumn.add(data.getByte(i)); } return intColumn; }