/** * Creates a new <code>TShortArrayStack</code> instance with the * specified capacity. * * @param capacity the initial depth of the stack * @param no_entry_value value that represents null */ public TShortArrayStack( int capacity, short no_entry_value ) { _list = new TShortArrayList( capacity, no_entry_value ); }
/** * Creates a new <code>TShortArrayStack</code> instance with the * specified capacity. * * @param capacity the initial depth of the stack */ public TShortArrayStack( int capacity ) { _list = new TShortArrayList( capacity ); }
/** * Creates a new <code>TShortArrayStack</code> instance that is * a copy of the instanced passed to us. * * @param stack the instance to copy */ public TShortArrayStack( TShortStack stack ) { if ( stack instanceof TShortArrayStack ) { TShortArrayStack array_stack = ( TShortArrayStack ) stack; this._list = new TShortArrayList( array_stack._list ); } else { throw new UnsupportedOperationException( "Only support TShortArrayStack" ); } }
/** {@inheritDoc} */ public TShortList 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 ); } TShortArrayList list = new TShortArrayList( end - begin ); for ( int i = begin; i < end; i++ ) { list.add( _data[ i ] ); } return list; }
/** {@inheritDoc} */ public TShortList inverseGrep( TShortProcedure condition ) { TShortArrayList list = new TShortArrayList(); for ( int i = 0; i < _pos; i++ ) { if ( !condition.execute( _data[ i ] ) ) { list.add( _data[ i ] ); } } return list; }
/** {@inheritDoc} */ public TShortList grep( TShortProcedure condition ) { TShortArrayList list = new TShortArrayList(); for ( int i = 0; i < _pos; i++ ) { if ( condition.execute( _data[ i ] ) ) { list.add( _data[ i ] ); } } return list; }
/** * Creates a new <code>TShortArrayStack</code> instance with the * specified capacity. * * @param capacity the initial depth of the stack */ public TShortArrayStack( int capacity ) { _list = new TShortArrayList( capacity ); }
/** * Creates a new <code>TShortArrayStack</code> instance with the * specified capacity. * * @param capacity the initial depth of the stack * @param no_entry_value value that represents null */ public TShortArrayStack( int capacity, short no_entry_value ) { _list = new TShortArrayList( capacity, no_entry_value ); }
/** * Creates a new <code>TShortArrayStack</code> instance with the * specified capacity. * * @param capacity the initial depth of the stack * @param no_entry_value value that represents null */ public TShortArrayStack( int capacity, short no_entry_value ) { _list = new TShortArrayList( capacity, no_entry_value ); }
/** * Extract the second values from a list of pairs. * * @param data the data * @return extracted second values */ public static gnu.trove.list.array.TShortArrayList getSecond(Iterable<ByteShortPair> data) { gnu.trove.list.array.TShortArrayList extracted = new gnu.trove.list.array.TShortArrayList(); for (ByteShortPair item : data) extracted.add(item.second); return extracted; }
/** * Extract the first values from a list of pairs. * * @param data the data * @return extracted first values */ public static gnu.trove.list.array.TShortArrayList getFirst(Iterable<ShortFloatPair> data) { gnu.trove.list.array.TShortArrayList extracted = new gnu.trove.list.array.TShortArrayList(); for (ShortFloatPair item : data) extracted.add(item.first); return extracted; }
/** * Extract the second values from a list of pairs. * * @param data the data * @return extracted second values */ public static gnu.trove.list.array.TShortArrayList getSecond(Iterable<FloatShortPair> data) { gnu.trove.list.array.TShortArrayList extracted = new gnu.trove.list.array.TShortArrayList(); for (FloatShortPair item : data) extracted.add(item.second); return extracted; }
/** * Extract the first values from a list of pairs. * * @param data the data * @return extracted first values */ public static gnu.trove.list.array.TShortArrayList getFirst(Iterable<ShortShortPair> data) { gnu.trove.list.array.TShortArrayList extracted = new gnu.trove.list.array.TShortArrayList(); for (ShortShortPair item : data) extracted.add(item.first); return extracted; }
/** * Extract the first values from a list of pairs. * * @param data the data * @return extracted first values */ public static gnu.trove.list.array.TShortArrayList getFirst(Iterable<ShortIntPair> data) { gnu.trove.list.array.TShortArrayList extracted = new gnu.trove.list.array.TShortArrayList(); for (ShortIntPair item : data) extracted.add(item.first); return extracted; }
/** * Extract the second values from a list of pairs. * * @param data the data * @return extracted second values */ public static gnu.trove.list.array.TShortArrayList getSecond(Iterable<LongShortPair> data) { gnu.trove.list.array.TShortArrayList extracted = new gnu.trove.list.array.TShortArrayList(); for (LongShortPair item : data) extracted.add(item.second); return extracted; }
/** * Extract the second values from a list of pairs. * * @param data the data * @return extracted second values */ public static gnu.trove.list.array.TShortArrayList getSecond(Iterable<ShortShortPair> data) { gnu.trove.list.array.TShortArrayList extracted = new gnu.trove.list.array.TShortArrayList(); for (ShortShortPair item : data) extracted.add(item.second); return extracted; }
/** {@inheritDoc} */ public TShortList inverseGrep( TShortProcedure condition ) { TShortArrayList list = new TShortArrayList(); for ( int i = 0; i < _pos; i++ ) { if ( !condition.execute( _data[ i ] ) ) { list.add( _data[ i ] ); } } return list; }
/** {@inheritDoc} */ public TShortList grep( TShortProcedure condition ) { TShortArrayList list = new TShortArrayList(); for ( int i = 0; i < _pos; i++ ) { if ( condition.execute( _data[ i ] ) ) { list.add( _data[ i ] ); } } return list; }
/** {@inheritDoc} */ public TShortList grep( TShortProcedure condition ) { TShortArrayList list = new TShortArrayList(); for ( int i = 0; i < _pos; i++ ) { if ( condition.execute( _data[ i ] ) ) { list.add( _data[ i ] ); } } return list; }
protected TShortArrayList getDefaults(AbstractChemicalDatabase db, InChI inchi) throws CDKException { try { final Fingerprint fp = db.lookupFingerprintByInChI(inchi); if (fp!=null) return new TShortArrayList(fp.toIndizesArray()); } catch (ChemicalDatabaseException e) { e.printStackTrace(); } return getDefaults(inchi); }