Qizx/open API

net.axyana.qizxopen.util
Class BitIdSet

java.lang.Object
  extended bynet.axyana.qizxopen.util.IdSet
      extended bynet.axyana.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)
           
 void clear()
          Clear all elements.
 IdSet copy()
           
 void dump(java.io.PrintStream output)
           
 int getNext(int id)
          Iteration mechanism: returns the first id in the set that is >= to argument.
 void load(ByteInput input)
           
 void remove(int id)
           
 void save(ByteOutput output)
           
 java.lang.StringBuffer show(int maxSize)
           
 int size()
           
 boolean test(int id)
          Identifier containment test.
 IdSet unionWith(BitIdSet other)
          Merges an IdSet with this set.
 
Methods inherited from class net.axyana.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)

clear

public void clear()
Clear all elements. Does not reallocate.


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(ByteOutput output)
          throws java.io.IOException
Throws:
java.io.IOException

load

public void load(ByteInput input)
          throws java.io.IOException
Throws:
java.io.IOException

dump

public void dump(java.io.PrintStream output)

show

public java.lang.StringBuffer show(int maxSize)

© 2005 Axyana Software