/** * Adds all of the elements in <tt>array</tt> to the set. * * @param array an <code>array</code> of long primitives. * @return true if the set was modified by the add all operation. */ public boolean addAll(long[] array) { boolean changed = false; for (int i = array.length; i-- > 0;) { if (add(array[i])) { changed = true; } } return changed; }
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); int size = stream.readInt(); setUp(size); while (size-- > 0) { long val = stream.readLong(); add(val); } } } // TLongHashSet
/** * Inserts a value into the set. * * @param true if the set was modified by the insertion */ public boolean add(Object value) { return _set.add(unwrap(value)); }
@Override public Document getDocument() { long docno; try { docno = Long.parseLong(((FlatJSONDocument)currentDocument).getProperty("docno") ); } catch (Exception e) { logger.warn("WARN: Parsing failure... skipping document"); return null; } if(alldocnos.contains(docno)) return null; alldocnos.add(docno); return currentDocument; }
@Override public Document getDocument() { long docno; try { docno = Long.parseLong(((FlatJSONDocument)currentDocument).getProperty("docno") ); } catch (Exception e) { logger.warn("WARN: Parsing failure... skipping document"); return null; } if(alldocnos.contains(docno)) return null; alldocnos.add(docno); return currentDocument; }