/** * Constructor for the class. * * @param initialCapacity Initial capacity for the priority queue * @param minHeap Min order, ie smallest element on top. */ public IntObjectIndexedPriorityQueue(int initialCapacity, boolean minHeap) { super(initialCapacity, minHeap); _values = new ObjectArrayList<>(initialCapacity); _reusablePair = new IntObjectPair<>(0, null); }
public StringToIdMap() { _valueToIdMap = new Object2IntOpenHashMap<>(); _valueToIdMap.defaultReturnValue(INVALID_KEY); _idToValueMap = new ObjectArrayList<>(); }
/** * Build the row as a list. * @return The list of fields. */ public List<Object> buildList() { return new ObjectArrayList<>(values); } }
/** * Construct a new prefixed table writer. * * @param writer The underlying table writer to write to. This writer is <b>not</b> closed * when the prefixed writer is closed. * @param values The initial values to write. Each row written to this table * writer is written to the base writer with these values prefixed. */ public PrefixedTableWriter(TableWriter writer, List<?> values) { baseWriter = writer; TableLayout baseLayout = writer.getLayout(); if (values.size() > baseLayout.getColumnCount()) { throw new IllegalArgumentException("Value array too wide"); } rowData = new ObjectArrayList<>(writer.getLayout().getColumnCount()); rowData.addAll(values); fixedColumns = values.size(); TableLayoutBuilder bld = new TableLayoutBuilder(); List<String> bheaders = baseLayout.getColumns(); for (String h : bheaders.subList(fixedColumns, bheaders.size())) { bld.addColumn(h); } layout = bld.build(); assert layout.getColumnCount() + rowData.size() == writer.getLayout().getColumnCount(); }
/** * Creates an empty feature store */ public DenseFeatureStore() { this.instanceList = new ObjectArrayList<>(); this.featureNames = null; }
public GraphDiffImpl() { addedNodes = new ObjectArrayList<Node>(); removedNodes = new ObjectArrayList<Node>(); addedEdges = new ObjectArrayList<Edge>(); removedEdges = new ObjectArrayList<Edge>(); }
@Override public ObjectArrayList<K> clone() { ObjectArrayList<K> c = new ObjectArrayList<>(size); System.arraycopy(a, 0, c.a, 0, size); c.size = size; return c; } private boolean valEquals(final K a, final K b) {
/** Creates a segmented input stream with no markers. * * @param in the underlying input stream. */ public SegmentedInputStream(final InputStream in) { if (in == null) throw new NullPointerException(); this.in = in; this.blocks = new ObjectArrayList<>(); this.currentBlock = -1; }
/** Creates a segmented input stream with no markers. * * @param in the underlying input stream. */ public SegmentedInputStream( final InputStream in ) { if ( in == null ) throw new NullPointerException(); this.in = in; this.blocks = new ObjectArrayList<SegmentBlock>(); this.currentBlock = -1; }
/** Creates a segmented input stream with no markers. * * @param in the underlying input stream. */ public SegmentedInputStream( final InputStream in ) { if ( in == null ) throw new NullPointerException(); this.in = in; this.blocks = new ObjectArrayList<SegmentBlock>(); this.currentBlock = -1; }
private void readObject( final ObjectInputStream s ) throws IOException, ClassNotFoundException { s.defaultReadObject(); final int size = s.readInt(); final ObjectArrayList<TRECDocumentDescriptor> descriptors = new ObjectArrayList<TRECDocumentDescriptor>(); descriptors.ensureCapacity( size ); for ( int i = 0; i < size; i++ ) descriptors.add( new TRECDocumentDescriptor( s.readInt(), s.readLong(), s.readInt(), s.readInt() ) ); this.descriptors = descriptors; }
private void readObject( final ObjectInputStream s ) throws IOException, ClassNotFoundException { s.defaultReadObject(); final int size = s.readInt(); final ObjectArrayList<TRECDocumentDescriptor> descriptors = new ObjectArrayList<TRECDocumentDescriptor>(); descriptors.ensureCapacity( size ); for ( int i = 0; i < size; i++ ) descriptors.add( new TRECDocumentDescriptor( s.readInt(), s.readLong(), s.readInt(), s.readInt() ) ); this.descriptors = descriptors; }
@Override public Collection<Integer> getIncidentVertices(final Long e) { final int x = (int)(e.longValue() >>> 32); final int y = e.intValue(); if (x == y) return ObjectLists.singleton(Integer.valueOf(x)); final ObjectArrayList<Integer> res = new ObjectArrayList<>(); res.add(Integer.valueOf(x)); res.add(Integer.valueOf(y)); return res; }
void addToFollowing(BaseInformationRecords.BaseInformation previous, BaseInformationRecords.BaseInformation builtCopy) { List<BaseInformationRecords.BaseInformation> list = afterRecord.getOrDefault(previous, new ObjectArrayList<>()); list.add(builtCopy); afterRecord.put(previous, list); }
/** Returns all lines of the file wrapped by this file-lines collection. * * @return all lines of the file wrapped by this file-lines collection. */ public ObjectList<MutableString> allLines() { final ObjectArrayList<MutableString> result = new ObjectArrayList<MutableString>(); for( Iterator<MutableString> i = iterator(); i.hasNext(); ) result.add( i.next().copy() ); return result; }
/** Returns all lines of the file wrapped by this file-lines collection. * * @return all lines of the file wrapped by this file-lines collection. */ public ObjectList<MutableString> allLines() { final ObjectArrayList<MutableString> result = new ObjectArrayList<>(); for(final Iterator<MutableString> i = iterator(); i.hasNext();) result.add(i.next().copy()); return result; }
private static Collection<Integer> getSuccessors(final ImmutableGraph g, final int x) { final ObjectArrayList<Integer> list = new ObjectArrayList<>(g.outdegree(x)); final LazyIntIterator succ = g.successors(x); for(int s; (s = succ.nextInt()) != -1;) list.add(Integer.valueOf(s)); return list; }
/** Returns all lines remaining in this iterator as a list. * * @return all lines remaining in this iterator as a list. */ public List<MutableString> allLines() { final ObjectArrayList<MutableString> result = new ObjectArrayList<MutableString>(); while( hasNext() ) result.add( next().copy() ); return result; } }
/** Returns all lines remaining in this iterator as a list. * * @return all lines remaining in this iterator as a list. */ public List<MutableString> allLines() { final ObjectArrayList<MutableString> result = new ObjectArrayList<>(); while(hasNext()) result.add(next().copy()); return result; } }
Singles() { this.instances = new Long2ReferenceOpenHashMap<>(1024); this.instance_to_material = new Long2LongOpenHashMap(1024); this.material_to_instances = new Long2ReferenceOpenHashMap<>(1024); this.shader_to_materials = new Long2ReferenceOpenHashMap<>(1024); this.instance_materials = new Long2ReferenceOpenHashMap<>(1024); this.instance_shaders = new Long2ReferenceOpenHashMap<>(1024); this.instances_sorted = new ObjectArrayList<>(); }