public LongIterator longIterator() { return (LongIterator) _map.keySet().iterator(); }
@Override public Iterator<Long>iterator() { return _map.keySet().iterator(); }
private void writeObject(java.io.ObjectOutputStream s) throws IOException { s.defaultWriteObject(); // Write nothing for( long K : keySet() ) { final Object V = get(K); // Do an official 'get' s.writeLong (K); // Write the <long,TypeV> pair s.writeObject(V); } s.writeLong(NO_KEY); // Sentinel to indicate end-of-data s.writeObject(null); }
private void writeObject(java.io.ObjectOutputStream s) throws IOException { s.defaultWriteObject(); // Write nothing for( long K : keySet() ) { final Object V = get(K); // Do an official 'get' s.writeLong (K); // Write the <long,TypeV> pair s.writeObject(V); } s.writeLong(NO_KEY); // Sentinel to indicate end-of-data s.writeObject(null); }
private void writeObject(java.io.ObjectOutputStream s) throws IOException { s.defaultWriteObject(); // Write nothing for( long K : keySet() ) { final Object V = get(K); // Do an official 'get' s.writeLong (K); // Write the <long,TypeV> pair s.writeObject(V); } s.writeLong(NO_KEY); // Sentinel to indicate end-of-data s.writeObject(null); }
public long[] getSnapshotAndClear() { final Set<Long> set = map.keySet(); final long[] array = new long[set.size()]; int i=0; for(NonBlockingHashMapLong.IteratorLong it = (NonBlockingHashMapLong.IteratorLong)set.iterator(); it.hasNext(); ) { array[i] = it.nextLong(); it.remove(); i++; } assert i == array.length; return array; } }