public long getFirstNodeId() { if (nodeIds == null) { return -1; } return nodeIds.get(0); }
/** {@inheritDoc} */ public long next() { try { long next = get( cursor ); lastRet = cursor++; return next; } catch ( IndexOutOfBoundsException e ) { throw new NoSuchElementException(); } }
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 ); }
/** {@inheritDoc} */ public long removeAt( int offset ) { long old = get( offset ); remove( offset, 1 ); return old; }
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; }
/** * 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(); }
@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)))); } } }
@Override public long get(int index) { if (index < offset) return 0; return data.get(index - offset); }
/** {@inheritDoc} */ public long next() { try { long next = get( cursor ); lastRet = cursor++; return next; } catch ( IndexOutOfBoundsException e ) { throw new NoSuchElementException(); } }
/** {@inheritDoc} */ @Override public long next() { try { long next = get( cursor ); lastRet = cursor++; return next; } catch ( IndexOutOfBoundsException e ) { throw new NoSuchElementException(); } }
/** {@inheritDoc} */ public long next() { try { long next = get( cursor ); lastRet = cursor++; return next; } catch ( IndexOutOfBoundsException e ) { throw new NoSuchElementException(); } }
/** * Returns the value at the top of the stack. * * @return an <code>long</code> value */ public long peek() { return _list.get( _list.size() - 1 ); }
/** {@inheritDoc} */ public long removeAt( int offset ) { long old = get( offset ); remove( offset, 1 ); return old; }
/** {@inheritDoc} */ public long removeAt( int offset ) { long old = get( offset ); remove( offset, 1 ); return old; }
/** * Returns the value at the top of the stack. * * @return an <code>long</code> value */ @Override public long peek() { return _list.get( _list.size() - 1 ); }
/** {@inheritDoc} */ @Override public long removeAt( int offset ) { long old = get( offset ); remove( offset, 1 ); return old; }
/** * Returns the value at the top of the stack. * * @return an <code>long</code> value */ public long peek() { return _list.get( _list.size() - 1 ); }
@Override public void incrementBy(int index, long value) { int i = index - offset; long val = this.data.get(i); this.data.setQuick(i, val + value); }