@Override public void write(DataOutput out) throws IOException { out.writeInt(neighbors.size()); IntIterator neighborsIt = neighbors.iterator(); while (neighborsIt.hasNext()) { out.writeInt(neighborsIt.nextInt()); } }
/** * Get the collection of values of this vector. * * @return The collection of all values in this vector. */ public DoubleCollection values() { DoubleArrayList lst = new DoubleArrayList(size()); IntIterator iter = keys.activeIndexIterator(false); while (iter.hasNext()) { int idx = iter.nextInt(); lst.add(values[idx]); } return lst; }
@Override public void hashValues(DimensionSelector dimSelector, HyperLogLogCollector collector) { for (IntIterator rowIt = dimSelector.getRow().iterator(); rowIt.hasNext(); ) { int index = rowIt.nextInt(); final String value = dimSelector.lookupName(index); collector.add( CardinalityAggregator.hashFn.hashUnencodedChars(nullToSpecial(value)).asBytes()); } }
@Override public boolean hasNext() { return iter.hasNext(); }