public void addNode(long id) { if (nodeIds == null) { nodeIds = new TLongArrayList(); } nodeIds.add(id); }
/** {@inheritDoc} */ public long[] toArray( int offset, int len ) { long[] rv = new long[ len ]; toArray( rv, offset, len ); return rv; }
public TLongArrayList getNodeIds() { if (nodeIds == null) { return new TLongArrayList(0); } return nodeIds; }
@Override protected boolean parseLineInternal() { int curdim = 0; for(; tokenizer.valid(); tokenizer.advance()) { try { final int word = curdim >>> 6; final int off = curdim & 0x3F; if(word >= buf.size()) { // Ensure size. buf.add(0L); } if(tokenizer.getLongBase10() > 0) { buf.set(word, buf.get(word) | (1L << off)); } ++curdim; } catch(NumberFormatException e) { labels.add(tokenizer.getSubstring()); } } if(curdim == 0) { // Maybe a label row return false; } curvec = new BitVector(buf.toArray(), curdim); curlbl = LabelList.make(labels); buf.clear(); labels.clear(); return true; }
TLongArrayList lines = new TLongArrayList(); LOG.trace("Owner of {}: {} -> 0", id, node); lines.add(id); // cursor.getPrimaryDatabase().put(null, pKey, SERVER); - causes deadlock retVal = cursor.getNextDup(sKey, pKey, data, LockMode.DEFAULT); for (TLongIterator it = lines.iterator(); it.hasNext();) { toByteArray(it.next(), longArray); pKey.setData(longArray);
/** * Pushes the value onto the top of the stack. * * @param val an <code>long</code> value */ public void push( long val ) { _list.add( val ); }
private void readRouteTreeData(RouteSubregion routeTree, TLongArrayList idTables, TLongObjectHashMap<RestrictionInfo> restrictions) throws IOException { routeTree.dataObjects = new ArrayList<RouteDataObject>(); idTables.clear(); restrictions.clear(); List<String> stringTable = null; long via = 0; if(val.viaWay != 0) { via = idTables.get((int)val.viaWay); fromr.setRestriction(k, idTables.get((int)val.toWay), val.type, via); if (o.id < idTables.size()) { o.id = idTables.get((int) o.id); case IdTable.ROUTEID_FIELD_NUMBER : routeId += codedIS.readSInt64(); idTables.add(routeId); break; default:
public void addNode(Node n, int index) { if (nodeIds == null) { nodeIds = new TLongArrayList(); } if (nodes == null) { nodes = new ArrayList<Node>(); } nodeIds.insert(index, n.getId()); nodes.add(index, n); }
public static void setTimeStream(final long... times) { timeStream = new TLongArrayList(times).iterator(); }
/** {@inheritDoc} */ public void insert( int offset, long value ) { if ( offset == _pos ) { add( value ); return; } ensureCapacity( _pos + 1 ); // shift right System.arraycopy( _data, offset, _data, offset + 1, _pos - offset ); // insert _data[ offset ] = value; _pos++; }
/** {@inheritDoc} */ public boolean removeAll( TLongCollection collection ) { if ( collection == this ) { clear(); return true; } boolean changed = false; TLongIterator iter = collection.iterator(); while ( iter.hasNext() ) { long element = iter.next(); if ( remove( element ) ) { changed = true; } } return changed; }
/** {@inheritDoc} */ @SuppressWarnings({"SuspiciousMethodCalls"}) public boolean retainAll( Collection<?> collection ) { boolean modified = false; TLongIterator iter = iterator(); while ( iter.hasNext() ) { if ( ! collection.contains( Long.valueOf ( iter.next() ) ) ) { iter.remove(); modified = true; } } return modified; }
/** * Returns the current depth of the stack. */ public int size() { return _list.size(); }
/** * Clears the stack. */ public void clear() { _list.clear(); }
/** * Copies a slice of the list into a native array. Note that this will NOT * pop them out of the stack. The front of the list will be the top * of the stack. * <p> * If the native array is smaller than the stack depth, * the native array will be filled with the elements from the top * of the array until it is full and exclude the remainder. * * @param dest the array to copy into. */ public void toArray( long[] dest ) { int size = size(); int start = size - dest.length; if ( start < 0 ) { start = 0; } int length = Math.min( size, dest.length ); _list.toArray( dest, start, length ); reverse( dest, 0, length ); if ( dest.length > size ) { dest[size] = _list.getNoEntryValue(); } }