Java Code Examples for gnu.trove.set.hash.TLongHashSet#iterator()
The following examples show how to use
gnu.trove.set.hash.TLongHashSet#iterator() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Sets.java From paintera with GNU General Public License v2.0 | 6 votes |
public static final TLongHashSet containedInFirstButNotInSecond( final TLongHashSet first, final TLongHashSet second) { final TLongHashSet notInSecond = new TLongHashSet(); for (final TLongIterator fIt = first.iterator(); fIt.hasNext(); ) { final long p = fIt.next(); if (!second.contains(p)) { notInSecond.add(p); } } LOG.debug("First: {}", first); LOG.debug("Second: {}", second); LOG.debug("Not in second: {}", notInSecond); return notInSecond; }
Example 2
Source File: TLongHashSetSerializer.java From Knowage-Server with GNU Affero General Public License v3.0 | 5 votes |
@Override public void write(Kryo kryo, Output output, TLongHashSet object) { output.writeInt(object.size(), true); TLongIterator it = object.iterator(); while (it.hasNext()) { kryo.writeObject(output, it.next()); } }