/** * Copies the contents of the stack 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. * * @return an <code>int[]</code> value */ public int[] toArray() { int[] retval = _list.toArray(); reverse( retval, 0, size() ); return retval; }
/** * 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(); }
/** * 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( int[] 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(); } }
/** * 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(); }
/** * Copies the contents of the stack 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. * * @return an <code>int[]</code> value */ public int[] toArray() { int[] retval = _list.toArray(); reverse( retval, 0, size() ); return retval; }
/** * 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(); }
/** * 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(); }
/** * Copies the contents of the stack 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. * * @return an <code>int[]</code> value */ public int[] toArray() { int[] retval = _list.toArray(); reverse( retval, 0, size() ); return retval; }
/** * Returns a String representation of the list, top to bottom. * * @return a <code>String</code> value */ @Override 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(); }
/** * Copies the contents of the stack 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. * * @return an <code>int[]</code> value */ @Override public int[] toArray() { int[] retval = _list.toArray(); reverse( retval, 0, size() ); return retval; }
/** * Copies the contents of the stack 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. * * @return an <code>int[]</code> value */ public int[] toArray() { int[] retval = _list.toArray(); reverse( retval, 0, size() ); return retval; }
/** * 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( int[] 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(); } }
/** * 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( int[] 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(); } }
/** * 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. */ @Override public void toArray( int[] 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(); } }
/** * 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( int[] 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(); } }
/** * beginning with startNode add all following nodes to LIFO queue. If node has been already * explored before, skip reexploration. */ @Override public void start( EdgeExplorer explorer, int startNode ) { TIntArrayStack stack = new TIntArrayStack(); GHBitSet explored = createBitSet(); stack.push(startNode); int current; while (stack.size() > 0) { current = stack.pop(); if (!explored.contains(current) && goFurther(current)) { EdgeIterator iter = explorer.setBaseNode(current); while (iter.next()) { int connectedId = iter.getAdjNode(); if (checkAdjacent(iter)) { stack.push(connectedId); } } explored.add(current); } } }