@Override
 public void write(DataOutput out) throws IOException {
   out.writeInt(neighbors.size());
   IntIterator neighborsIt = neighbors.iterator();
   while (neighborsIt.hasNext()) {
     out.writeInt(neighborsIt.nextInt());
   }
 }
Example #2
0
 /**
  * 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;
 }
Example #3
0
 @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());
   }
 }
Example #4
0
 @Override
 public boolean hasNext() {
   return iter.hasNext();
 }