net.xfra.qizxopen.util
Class BitIdSet
java.lang.Object
|
+--net.xfra.qizxopen.util.IdSet
|
+--net.xfra.qizxopen.util.BitIdSet
- public class BitIdSet
- extends IdSet
A set of (positive) integer identifiers.
A bit optimized for sparse sets.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BitIdSet
public BitIdSet()
BitIdSet
public BitIdSet(int id)
test
public boolean test(int id)
- Description copied from class:
IdSet
- Identifier containment test.
- Specified by:
test
in class IdSet
copy
public IdSet copy()
- Specified by:
copy
in class IdSet
add
public void add(int id)
remove
public void remove(int id)
unionWith
public IdSet unionWith(BitIdSet other)
- Merges an IdSet with this set.
getNext
public int getNext(int id)
- Iteration mechanism: returns the first id in the set that is >= to argument.
- Specified by:
getNext
in class IdSet
- Returns:
- -1 if no next id.
size
public int size()
save
public void save(OutputByteStream output)
throws java.io.IOException
java.io.IOException
load
public void load(InputByteStream input)
throws java.io.IOException
java.io.IOException
dump
public void dump()