/** {@inheritDoc} */ public boolean hasNext() { return cursor < size(); }
/** * Returns the current depth of the stack. */ public int size() { return _list.size(); }
/** {@inheritDoc} */ @Override public boolean equals( Object other ) { if ( other == this ) { return true; } else if ( other instanceof TLongArrayList ) { TLongArrayList that = ( TLongArrayList )other; if ( that.size() != this.size() ) return false; else { for ( int i = _pos; i-- > 0; ) { if ( this._data[ i ] != that._data[ i ] ) { return false; } } return true; } } else return false; }
/** {@inheritDoc} */ public long max() { if ( size() == 0 ) { throw new IllegalStateException("cannot find maximum of an empty list"); } long max = Long.MIN_VALUE; for ( int i = 0; i < _pos; i++ ) { if ( _data[ i ] > max ) { max = _data[ i ]; } } return max; }
/** {@inheritDoc} */ public long min() { if ( size() == 0 ) { throw new IllegalStateException( "cannot find minimum of an empty list" ); } long min = Long.MAX_VALUE; for ( int i = 0; i < _pos; i++ ) { if ( _data[i] < min ) { min = _data[i]; } } return min; }
/** {@inheritDoc} */ @Override public String toString() { final StringBuilder buf = new StringBuilder( "{" ); for ( int i = 0, end = _pos - 1; i < end; i++ ) { buf.append( _data[ i ] ); buf.append( ", " ); } if ( size() > 0 ) { buf.append( _data[ _pos - 1 ] ); } buf.append( "}" ); return buf.toString(); }
public long getLastNodeId() { if (nodeIds == null) { return -1; } return nodeIds.get(nodeIds.size() - 1); }
/** * Returns the value at the top of the stack. * * @return an <code>long</code> value */ public long peek() { return _list.get( _list.size() - 1 ); }
/** * Removes and returns the value at the top of the stack. * * @return an <code>long</code> value */ public long pop() { return _list.removeAt( _list.size() - 1 ); }
public List<EntityId> getEntityIds() { if (nodeIds == null) { return Collections.emptyList(); } List<EntityId> ls = new ArrayList<EntityId>(); for (int i = 0; i < nodeIds.size(); i++) { ls.add(new EntityId(EntityType.NODE, nodeIds.get(i))); } return ls; }
@Override public void initializeLinks(Map<EntityId, Entity> entities) { if (nodeIds != null) { if (nodes == null) { nodes = new ArrayList<Node>(); } else { nodes.clear(); } int nIsize = nodeIds.size(); for (int i = 0; i < nIsize; i++) { nodes.add((Node) entities.get(new EntityId(EntityType.NODE, nodeIds.get(i)))); } } }
/** * Returns a String representation of the list, top to bottom. * * @return a <code>String</code> value */ public String toString() { final StringBuilder buf = new StringBuilder( "{" ); for ( int i = _list.size() - 1; i > 0; i-- ) { buf.append( _list.get( i ) ); buf.append( ", " ); } if ( size() > 0 ) { buf.append( _list.get( 0 ) ); } buf.append( "}" ); return buf.toString(); }
if (o.id < idTables.size()) { o.id = idTables.get((int) o.id);
/** * Returns the current depth of the stack. */ public int size() { return _list.size(); }
/** * Returns the value at the top of the stack. * * @return an <code>long</code> value */ public long peek() { return _list.get( _list.size() - 1 ); }
/** * Removes and returns the value at the top of the stack. * * @return an <code>long</code> value */ public long pop() { return _list.removeAt( _list.size() - 1 ); }
/** * Returns the value at the top of the stack. * * @return an <code>long</code> value */ public long peek() { return _list.get( _list.size() - 1 ); }