/** * Pushes the value onto the top of the stack. * * @param val an <code>long</code> value */ public void push( long val ) { _list.add( val ); }
/** {@inheritDoc} */ public boolean addAll( long[] array ) { boolean changed = false; for ( long element : array ) { if ( add( element ) ) { changed = true; } } return changed; }
/** * Creates a new <code>TLongArrayList</code> instance whose * capacity is the length of <tt>values</tt> array and whose * initial contents are the specified values. * <p> * A defensive copy of the given values is held by the new instance. * * @param values an <code>long[]</code> value */ public TLongArrayList( long[] values ) { this( values.length ); add( values ); }
/** {@inheritDoc} */ public void add( long[] vals ) { add( vals, 0, vals.length ); }
/** {@inheritDoc} */ public boolean addAll( Collection<? extends Long> collection ) { boolean changed = false; for ( Long element : collection ) { long e = element.longValue(); if ( add( e ) ) { changed = true; } } return changed; }
public void addNode(long id) { if (nodeIds == null) { nodeIds = new TLongArrayList(); } nodeIds.add(id); }
/** {@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 void insert( int offset, long[] values, int valOffset, int len ) { if ( offset == _pos ) { add( values, valOffset, len ); return; } ensureCapacity( _pos + len ); // shift right System.arraycopy( _data, offset, _data, offset + len, _pos - offset ); // insert System.arraycopy( values, valOffset, _data, offset, len ); _pos += len; }
public void addNode(Node n) { if (nodeIds == null) { nodeIds = new TLongArrayList(); } if (nodes == null) { nodes = new ArrayList<Node>(); } nodeIds.add(n.getId()); nodes.add(n); }
public Way(long id, List<Node> nodes) { super(id); this.nodes = new ArrayList<Node>(nodes); nodeIds = new TLongArrayList(nodes.size()); for (Node n : nodes) { nodeIds.add(n.getId()); } }
/** {@inheritDoc} */ public TLongList subList( int begin, int end ) { if ( end < begin ) { throw new IllegalArgumentException( "end index " + end + " greater than begin index " + begin ); } if ( begin < 0 ) { throw new IndexOutOfBoundsException( "begin index can not be < 0" ); } if ( end > _data.length ) { throw new IndexOutOfBoundsException( "end index < " + _data.length ); } TLongArrayList list = new TLongArrayList( end - begin ); for ( int i = begin; i < end; i++ ) { list.add( _data[ i ] ); } return list; }
/** {@inheritDoc} */ public TLongList grep( TLongProcedure condition ) { TLongArrayList list = new TLongArrayList(); for ( int i = 0; i < _pos; i++ ) { if ( condition.execute( _data[ i ] ) ) { list.add( _data[ i ] ); } } return list; }
/** {@inheritDoc} */ public TLongList inverseGrep( TLongProcedure condition ) { TLongArrayList list = new TLongArrayList(); for ( int i = 0; i < _pos; i++ ) { if ( !condition.execute( _data[ i ] ) ) { list.add( _data[ i ] ); } } return list; }
/** {@inheritDoc} */ public boolean addAll( TLongCollection collection ) { boolean changed = false; TLongIterator iter = collection.iterator(); while ( iter.hasNext() ) { long element = iter.next(); if ( add( element ) ) { changed = true; } } return changed; }
case IdTable.ROUTEID_FIELD_NUMBER : routeId += codedIS.readSInt64(); idTables.add(routeId); break; default:
@Override public final void addWay(TDWay way) { // TODO #HDstoreData: store whole object data, not only the id this.ways.add(way.getId()); }
@Override public final void addPOI(TDNode poi) { this.pois.add(poi.getId()); }
innerList.add(innerWay.getId());
/** {@inheritDoc} */ public boolean addAll( long[] array ) { boolean changed = false; for ( long element : array ) { if ( add( element ) ) { changed = true; } } return changed; }
/** {@inheritDoc} */ public boolean addAll( TLongCollection collection ) { boolean changed = false; TLongIterator iter = collection.iterator(); while ( iter.hasNext() ) { long element = iter.next(); if ( add( element ) ) { changed = true; } } return changed; }