public static IntList toIntList(IntIterator iterator) { final IntList integers = new IntArrayList(); while (iterator.hasNext()) { integers.add(iterator.nextInt()); } return IntLists.unmodifiable(integers); }
public FeatureUnitNormalizer() { mins = new Int2DoubleOpenHashMap(); maxs = new Int2DoubleOpenHashMap(); mins.defaultReturnValue(Double.POSITIVE_INFINITY); maxs.defaultReturnValue(Double.NEGATIVE_INFINITY); }
@Override public int size() { return positionLinks.size(); } }
private static int[] filterInts(IntSet intSet, int[] source) { IntList intList = new IntArrayList(); for (int value : source) { if (intSet.contains(value)) { intList.add(value); } } if (intList.size() == source.length) { return source; } else { return intList.toIntArray(); } }
private void putSketch(final ByteBuffer buffer, final int position, final UpdateDoublesSketch sketch) { Int2ObjectMap<UpdateDoublesSketch> map = sketches.computeIfAbsent(buffer, buf -> new Int2ObjectOpenHashMap<>()); map.put(position, sketch); }
public IntToIdMap() { _valueToIdMap = new Int2IntOpenHashMap(); _valueToIdMap.defaultReturnValue(INVALID_KEY); _idToValueMap = new IntArrayList(); }
private IntArrayList generatePositionList(int numRows, int numPositions) { IntArrayList positions = new IntArrayList(numPositions); for (int i = 0; i < numPositions; i++) { positions.add((7 * i + 3) % numRows); } Collections.sort(positions); return positions; } }
private void initializeEntryIndicesList(int entryCount) { entryIndicesList = new IntList[entryCount]; for (int i = 0; i < entryIndicesList.length; i++) { entryIndicesList[i] = new IntArrayList(); } } }
@Override public AbstractInt2ObjectMap.BasicEntry<IntArrayList> next() { int key = setIerator.nextInt(); IntArrayList value = dataTable.get(key); return new AbstractInt2ObjectMap.BasicEntry<>(key, value); } }
@Override public Int2ObjectMap<Aggregator[]> makeDimExtractionAggregateStore() { return new Int2ObjectOpenHashMap<>(); }
@Override public Optional<Node> getAssignedNode(int bucketedId) { return Optional.ofNullable(bucketToNode.get(bucketedId)); }
@Override public boolean hasNext() { return baseIterator.hasNext(); }
@Override public void close() { mutableBitmapCollection.clear(); }
@Override public int getValueCardinality() { return forwardMapping.size(); }
private void clearEntryIndices(int entryCount) { verify(entryCount <= entryIndicesList.length); for (int i = 0; i < entryCount; i++) { entryIndicesList[i].clear(); } }
private void putUnion(final ByteBuffer buffer, final int position, final DoublesUnion union) { Int2ObjectMap<DoublesUnion> map = unions.computeIfAbsent(buffer, buf -> new Int2ObjectOpenHashMap<>()); map.put(position, union); }
public FactoryBuilder(int size, PagesHashStrategy pagesHashStrategy, LongArrayList addresses) { this.size = size; this.comparator = new PositionComparator(pagesHashStrategy, addresses); this.pagesHashStrategy = pagesHashStrategy; this.addresses = addresses; positionLinks = new Int2ObjectOpenHashMap<>(); }
private void putSketchIntoCache(final ByteBuffer buf, final int position, final HllSketch sketch) { final Int2ObjectMap<HllSketch> map = sketchCache.computeIfAbsent(buf, b -> new Int2ObjectOpenHashMap<>()); map.put(position, sketch); }