Package com.github.jelmerk.knn.util
Class ArrayBitSet
java.lang.Object
com.github.jelmerk.knn.util.ArrayBitSet
- All Implemented Interfaces:
Serializable
Bitset.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionArrayBitSet
(int count) Initializes a new instance of theArrayBitSet
class.ArrayBitSet
(ArrayBitSet other, int count) Initializes a new instance of theArrayBitSet
class. -
Method Summary
-
Constructor Details
-
ArrayBitSet
public ArrayBitSet(int count) Initializes a new instance of theArrayBitSet
class.- Parameters:
count
- The number of items in the set.
-
ArrayBitSet
Initializes a new instance of theArrayBitSet
class. and copies the values of another bitset.- Parameters:
other
- other bitsetcount
- The number of items in the set.
-
-
Method Details
-
contains
public boolean contains(int bitIndex) Returns true if this set contains the specified element -
add
public void add(int id) Add element to the bitset.- Parameters:
id
- element to add
-
remove
public void remove(int id) Removes element from the bitset.- Parameters:
id
- element to remove
-
clear
public void clear()Clears the bitset.
-