Qizx/Open v0.4p2

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.


Constructor Summary
BitIdSet()
           
BitIdSet(int id)
           
 
Method Summary
 void add(int id)
           
 IdSet copy()
           
 void dump()
           
 int getNext(int id)
          Iteration mechanism: returns the first id in the set that is >= to argument.
 void load(InputByteStream input)
           
 void remove(int id)
           
 void save(OutputByteStream output)
           
 int size()
           
 boolean test(int id)
          Identifier containment test.
 IdSet unionWith(BitIdSet other)
          Merges an IdSet with this set.
 
Methods inherited from class net.xfra.qizxopen.util.IdSet
intersects, isEmpty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitIdSet

public BitIdSet()

BitIdSet

public BitIdSet(int id)
Method Detail

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()

 Copyright Xavier FRANC 2003-2004