com.android.dx.util
Class BitIntSet

java.lang.Object
  extended by com.android.dx.util.BitIntSet
All Implemented Interfaces:
IntSet

public class BitIntSet
extends Object
implements IntSet

A set of integers, represented by a bit set


Constructor Summary
BitIntSet(int max)
          Constructs an instance.
 
Method Summary
 void add(int value)
          Adds an int to a set
 int elements()
          Returns the count of unique elements in this set.
 boolean has(int value)
          Checks to see if a value is in the set
 IntIterator iterator()
          Iterates the set
 void merge(IntSet other)
          Merges other into this set, so this set becomes the union of the two.
 void remove(int value)
          Removes an int from a set.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BitIntSet

public BitIntSet(int max)
Constructs an instance.

Parameters:
max - the maximum value of ints in this set.
Method Detail

add

public void add(int value)
Description copied from interface: IntSet
Adds an int to a set

Specified by:
add in interface IntSet
Parameters:
value - int to add

remove

public void remove(int value)
Description copied from interface: IntSet
Removes an int from a set.

Specified by:
remove in interface IntSet
Parameters:
value - int to remove

has

public boolean has(int value)
Description copied from interface: IntSet
Checks to see if a value is in the set

Specified by:
has in interface IntSet
Parameters:
value - int to check
Returns:
true if in set

merge

public void merge(IntSet other)
Description copied from interface: IntSet
Merges other into this set, so this set becomes the union of the two.

Specified by:
merge in interface IntSet
Parameters:
other - non-null; other set to merge with.

elements

public int elements()
Description copied from interface: IntSet
Returns the count of unique elements in this set.

Specified by:
elements in interface IntSet
Returns:
> = 0; count of unique elements

iterator

public IntIterator iterator()
Description copied from interface: IntSet
Iterates the set

Specified by:
iterator in interface IntSet
Returns:
non-null; a set iterator

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.