/** * Adds all of the elements in <tt>collection</tt> to the set. * * @param collection a <code>Collection</code> value * @return true if the set was modified by the add all operation. */ public boolean addAll( Collection<? extends E> collection ) { boolean changed = false; int size = collection.size(); ensureCapacity( size ); Iterator<? extends E> it = collection.iterator(); while ( size-- > 0 ) { if ( add( it.next() ) ) { changed = true; } } return changed; }
@SuppressWarnings({"unchecked"}) public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { // VERSION byte version = in.readByte(); // NOTE: super was not written in version 0 if ( version != 0 ) { super.readExternal( in ); } // NUMBER OF ENTRIES int size = in.readInt(); setUp( size ); // ENTRIES while ( size-- > 0 ) { E val = (E) in.readObject(); add( val ); } } }
/** * Adds all of the elements in <tt>collection</tt> to the set. * * @param collection a <code>Collection</code> value * @return true if the set was modified by the add all operation. */ public boolean addAll( Collection<? extends E> collection ) { boolean changed = false; int size = collection.size(); ensureCapacity( size ); Iterator<? extends E> it = collection.iterator(); while ( size-- > 0 ) { if ( add( it.next() ) ) { changed = true; } } return changed; }
/** * Adds all of the elements in <tt>collection</tt> to the set. * * @param collection a <code>Collection</code> value * @return true if the set was modified by the add all operation. */ public boolean addAll( Collection<? extends E> collection ) { boolean changed = false; int size = collection.size(); ensureCapacity( size ); Iterator<? extends E> it = collection.iterator(); while ( size-- > 0 ) { if ( add( it.next() ) ) { changed = true; } } return changed; }
/** * Adds all of the elements in <tt>collection</tt> to the set. * * @param collection a <code>Collection</code> value * @return true if the set was modified by the add all operation. */ public boolean addAll( Collection<? extends E> collection ) { boolean changed = false; int size = collection.size(); ensureCapacity( size ); Iterator<? extends E> it = collection.iterator(); while ( size-- > 0 ) { if ( add( it.next() ) ) { changed = true; } } return changed; }
/** * Adds all of the elements in <tt>collection</tt> to the set. * * @param collection a <code>Collection</code> value * @return true if the set was modified by the add all operation. */ @Override public boolean addAll( Collection<? extends E> collection ) { boolean changed = false; int size = collection.size(); ensureCapacity( size ); Iterator<? extends E> it = collection.iterator(); while ( size-- > 0 ) { if ( add( it.next() ) ) { changed = true; } } return changed; }
@SuppressWarnings({"unchecked"}) public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { // VERSION byte version = in.readByte(); // NOTE: super was not written in version 0 if ( version != 0 ) { super.readExternal( in ); } // NUMBER OF ENTRIES int size = in.readInt(); setUp( size ); // ENTRIES while ( size-- > 0 ) { E val = (E) in.readObject(); add( val ); } } }
@SuppressWarnings({"unchecked"}) public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { // VERSION byte version = in.readByte(); // NOTE: super was not written in version 0 if ( version != 0 ) { super.readExternal( in ); } // NUMBER OF ENTRIES int size = in.readInt(); setUp( size ); // ENTRIES while ( size-- > 0 ) { E val = (E) in.readObject(); add( val ); } } }
@SuppressWarnings({"unchecked"}) @Override public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { // VERSION byte version = in.readByte(); // NOTE: super was not written in version 0 if ( version != 0 ) { super.readExternal( in ); } // NUMBER OF ENTRIES int size = in.readInt(); setUp( size ); // ENTRIES while ( size-- > 0 ) { E val = (E) in.readObject(); add( val ); } } }
@SuppressWarnings({"unchecked"}) public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { // VERSION byte version = in.readByte(); // NOTE: super was not written in version 0 if ( version != 0 ) { super.readExternal( in ); } // NUMBER OF ENTRIES int size = in.readInt(); setUp( size ); // ENTRIES while ( size-- > 0 ) { E val = (E) in.readObject(); add( val ); } } }
/** * returns a new whiteset of all formulas that can be explained with the given mass and one * of the precursor ions */ public List<Decomposition> resolve(double parentMass, Deviation deviation, Collection<PrecursorIonType> allowedPrecursorIonTypes) { final TCustomHashSet<Decomposition> decompositionSet = Decomposition.newDecompositionSet(); eachFormula: for (MolecularFormula formula : formulas) { for (PrecursorIonType ionType : allowedPrecursorIonTypes) { if (deviation.inErrorWindow(parentMass, ionType.neutralMassToPrecursorMass(formula.getMass()))) { decompositionSet.add(new Decomposition(ionType.neutralMoleculeToMeasuredNeutralMolecule(formula), ionType.getIonization(), 0d)); continue eachFormula; } } } return Arrays.asList(decompositionSet.toArray(new Decomposition[decompositionSet.size()])); }