Javolution 6.0.0 java
|
Public Member Functions | |
FastBitSet () | |
FastBitSet | unmodifiable () |
FastBitSet | shared () |
void | and (FastBitSet that) |
void | andNot (FastBitSet that) |
int | cardinality () |
void | clear () |
void | clear (int bitIndex) |
void | clear (int fromIndex, int toIndex) |
void | flip (int bitIndex) |
void | flip (int fromIndex, int toIndex) |
boolean | get (int bitIndex) |
FastBitSet | get (int fromIndex, int toIndex) |
boolean | intersects (FastBitSet that) |
int | length () |
int | nextClearBit (int fromIndex) |
int | nextSetBit (int fromIndex) |
int | previousClearBit (int fromIndex) |
int | previousSetBit (int fromIndex) |
void | or (FastBitSet that) |
void | set (int bitIndex) |
void | set (int bitIndex, boolean value) |
void | set (int fromIndex, int toIndex) |
void | set (int fromIndex, int toIndex, boolean value) |
void | xor (FastBitSet that) |
FastBitSet | addAll (Index... elements) |
FastBitSet | addAll (FastCollection<? extends Index > elements) |
FastSet< E > | atomic () |
FastSet< E > | filtered (final Predicate<? super E > filter) |
boolean | isEmpty () |
int | size () |
boolean | contains (Object obj) |
boolean | remove (Object obj) |
FastSet< E > | addAll (E... elements) |
FastSet< E > | addAll (FastCollection<? extends E > that) |
Protected Member Functions | |
FastBitSet (BitSetService impl) | |
BitSetService | service () |
Private Attributes | |
final BitSetService | service |
Static Private Attributes | |
static final long | serialVersionUID = 0x600L |
A high-performance bitset with real-time behavior.
This class is integrated with the collection framework as a set of indices and obeys the collection semantic for methods such as size (cardinality) or equals (same set of indices).
Definition at line 27 of file FastBitSet.java.
javolution.util.FastBitSet.FastBitSet | ( | ) |
Creates an empty bit set.
Definition at line 39 of file FastBitSet.java.
References javolution.util.FastBitSet.service.
Referenced by javolution.util.FastBitSet.get().
|
protected |
Creates a fast bit set based on the specified implementation.
Definition at line 46 of file FastBitSet.java.
|
inherited |
Returns this collection with the specified element added.
elements | the elements to be added. |
Definition at line 133 of file FastSet.java.
|
inherited |
Returns this collection with the specified collection's elements added in sequence.
Definition at line 138 of file FastSet.java.
FastBitSet javolution.util.FastBitSet.addAll | ( | FastCollection<? extends Index > | elements | ) |
Definition at line 352 of file FastBitSet.java.
References javolution.util.FastBitSet.addAll().
FastBitSet javolution.util.FastBitSet.addAll | ( | Index... | elements | ) |
Definition at line 347 of file FastBitSet.java.
References javolution.util.FastBitSet.addAll().
Referenced by javolution.util.FastBitSet.addAll().
void javolution.util.FastBitSet.and | ( | FastBitSet | that | ) |
Performs the logical AND operation on this bit set and the given bit set. This means it builds the intersection of the two sets. The result is stored into this bit set.
that | the second bit set. |
Definition at line 76 of file FastBitSet.java.
References javolution.util.service.BitSetService.and(), and javolution.util.FastBitSet.service.
void javolution.util.FastBitSet.andNot | ( | FastBitSet | that | ) |
Performs the logical AND operation on this bit set and the complement of the given bit set. This means it selects every element in the first set, that isn't in the second set. The result is stored into this bit set.
that | the second bit set |
Definition at line 89 of file FastBitSet.java.
References javolution.util.service.BitSetService.andNot(), and javolution.util.FastBitSet.service.
|
inherited |
Returns an atomic view over this collection. All operations that write or access multiple elements in the collection (such as addAll(), retainAll()) are atomic. Iterators on atomic collections are thread-safe (no ConcurrentModificationException possible).
Definition at line 75 of file FastSet.java.
int javolution.util.FastBitSet.cardinality | ( | ) |
Returns the number of bits set to
(or the size of this set).
Definition at line 99 of file FastBitSet.java.
References javolution.util.service.BitSetService.cardinality(), and javolution.util.FastBitSet.service.
void javolution.util.FastBitSet.clear | ( | ) |
Sets all bits in the set to
(empty the set).
Definition at line 107 of file FastBitSet.java.
References javolution.util.service.BitSetService.clear(), and javolution.util.FastBitSet.service.
void javolution.util.FastBitSet.clear | ( | int | bitIndex | ) |
Removes the specified integer value from this set. That is the corresponding bit is cleared.
bitIndex | a non-negative integer. |
IndexOutOfBoundsException | if index < 0
|
Definition at line 118 of file FastBitSet.java.
References javolution.util.service.BitSetService.clear(), and javolution.util.FastBitSet.service.
void javolution.util.FastBitSet.clear | ( | int | fromIndex, |
int | toIndex | ||
) |
Sets the bits from the specified
(inclusive) to the specified
(exclusive) to
.
fromIndex | index of the first bit to be cleared. |
toIndex | index after the last bit to be cleared. |
IndexOutOfBoundsException | if (fromIndex < 0) | (toIndex < fromIndex)
|
Definition at line 132 of file FastBitSet.java.
References javolution.util.service.BitSetService.clear(), and javolution.util.FastBitSet.service.
|
inherited |
Indicates if this collection contains the specified element.
Definition at line 118 of file FastSet.java.
|
inherited |
Returns a view exposing only the elements matching the specified filter. Adding elements not matching the specified filter has no effect. If this collection is initially empty, using a filtered view to add new elements ensure that this collection has only elements satisfying the filter predicate.
Definition at line 80 of file FastSet.java.
void javolution.util.FastBitSet.flip | ( | int | bitIndex | ) |
Sets the bit at the index to the opposite value.
bitIndex | the index of the bit. |
IndexOutOfBoundsException | if bitIndex < 0
|
Definition at line 142 of file FastBitSet.java.
References javolution.util.service.BitSetService.flip(), and javolution.util.FastBitSet.service.
void javolution.util.FastBitSet.flip | ( | int | fromIndex, |
int | toIndex | ||
) |
Sets a range of bits to the opposite value.
fromIndex | the low index (inclusive). |
toIndex | the high index (exclusive). |
IndexOutOfBoundsException | if (fromIndex < 0) | (toIndex < fromIndex)
|
Definition at line 155 of file FastBitSet.java.
References javolution.util.service.BitSetService.flip(), and javolution.util.FastBitSet.service.
boolean javolution.util.FastBitSet.get | ( | int | bitIndex | ) |
Returns
if the specified integer is in this bit set;
otherwise.
bitIndex | a non-negative integer. |
IndexOutOfBoundsException | if bitIndex < 0
|
Definition at line 167 of file FastBitSet.java.
References javolution.util.service.BitSetService.get(), and javolution.util.FastBitSet.service.
FastBitSet javolution.util.FastBitSet.get | ( | int | fromIndex, |
int | toIndex | ||
) |
Returns a new bit set composed of a range of bits from this one.
fromIndex | the low index (inclusive). |
toIndex | the high index (exclusive). |
IndexOutOfBoundsException | if (fromIndex < 0) | (toIndex < fromIndex)
|
Definition at line 181 of file FastBitSet.java.
References javolution.util.FastBitSet.FastBitSet(), javolution.util.service.BitSetService.get(), and javolution.util.FastBitSet.service.
boolean javolution.util.FastBitSet.intersects | ( | FastBitSet | that | ) |
Returns
if this bit set shares at least one common bit with the specified bit set.
that | the bit set to check for intersection |
Definition at line 193 of file FastBitSet.java.
References javolution.util.service.BitSetService.intersects(), and javolution.util.FastBitSet.service.
|
inherited |
Indicates if this collection is empty.
Definition at line 100 of file FastSet.java.
int javolution.util.FastBitSet.length | ( | ) |
Returns the logical number of bits actually used by this bit set. It returns the index of the highest set bit plus one.
Note: This method does not return the number of set bits which is returned by size
Definition at line 206 of file FastBitSet.java.
References javolution.util.service.BitSetService.length(), and javolution.util.FastBitSet.service.
int javolution.util.FastBitSet.nextClearBit | ( | int | fromIndex | ) |
Returns the index of the next
bit, from the specified bit (inclusive).
fromIndex | the start location. |
IndexOutOfBoundsException | if fromIndex < 0
|
Definition at line 218 of file FastBitSet.java.
References javolution.util.service.BitSetService.nextClearBit(), and javolution.util.FastBitSet.service.
int javolution.util.FastBitSet.nextSetBit | ( | int | fromIndex | ) |
Returns the index of the next
bit, from the specified bit (inclusive). If there is none,
is returned. The following code will iterates through the bit set:[code] for (int i=nextSetBit(0); i >= 0; i = nextSetBit(i+1)) { ... }[/code]
fromIndex | the start location. |
IndexOutOfBoundsException | if fromIndex < 0
|
Definition at line 234 of file FastBitSet.java.
References javolution.util.service.BitSetService.nextSetBit(), and javolution.util.FastBitSet.service.
void javolution.util.FastBitSet.or | ( | FastBitSet | that | ) |
Performs the logical OR operation on this bit set and the one specified. In other words, builds the union of the two sets.
The result is stored into this bit set.
that | the second bit set. |
Definition at line 274 of file FastBitSet.java.
References javolution.util.service.BitSetService.or(), and javolution.util.FastBitSet.service.
int javolution.util.FastBitSet.previousClearBit | ( | int | fromIndex | ) |
Returns the index of the previous
bit, from the specified bit (inclusive).
fromIndex | the start location. |
IndexOutOfBoundsException | if fromIndex < -1
|
Definition at line 246 of file FastBitSet.java.
References javolution.util.service.BitSetService.previousClearBit(), and javolution.util.FastBitSet.service.
int javolution.util.FastBitSet.previousSetBit | ( | int | fromIndex | ) |
Returns the index of the previous
bit, from the specified bit (inclusive). If there is none,
is returned. The following code will iterates through the bit set:[code] for (int i = length(); (i = previousSetBit(i-1)) >= 0; ) { ... }[/code]
fromIndex | the start location. |
IndexOutOfBoundsException | if fromIndex < -1
|
Definition at line 262 of file FastBitSet.java.
References javolution.util.service.BitSetService.previousSetBit(), and javolution.util.FastBitSet.service.
|
inherited |
Removes the specified element from this collection.
Definition at line 124 of file FastSet.java.
|
protected |
Definition at line 357 of file FastBitSet.java.
References javolution.util.FastBitSet.service.
void javolution.util.FastBitSet.set | ( | int | bitIndex | ) |
Adds the specified integer to this set (corresponding bit is set to
.
bitIndex | a non-negative integer. |
IndexOutOfBoundsException | if bitIndex < 0
|
Definition at line 285 of file FastBitSet.java.
References javolution.util.FastBitSet.service, and javolution.util.service.BitSetService.set().
void javolution.util.FastBitSet.set | ( | int | bitIndex, |
boolean | value | ||
) |
Sets the bit at the given index to the specified value.
bitIndex | the position to set. |
value | the value to set it to. |
IndexOutOfBoundsException | if bitIndex < 0
|
Definition at line 296 of file FastBitSet.java.
References javolution.util.FastBitSet.service, and javolution.util.service.BitSetService.set().
void javolution.util.FastBitSet.set | ( | int | fromIndex, |
int | toIndex | ||
) |
Sets the bits from the specified
(inclusive) to the specified
(exclusive) to
.
fromIndex | index of the first bit to be set. |
toIndex | index after the last bit to be set. |
IndexOutOfBoundsException | if (fromIndex < 0) | (toIndex < fromIndex)
|
Definition at line 310 of file FastBitSet.java.
References javolution.util.FastBitSet.service, and javolution.util.service.BitSetService.set().
void javolution.util.FastBitSet.set | ( | int | fromIndex, |
int | toIndex, | ||
boolean | value | ||
) |
Sets the bits between from (inclusive) and to (exclusive) to the specified value.
fromIndex | the start range (inclusive). |
toIndex | the end range (exclusive). |
value | the value to set it to. |
IndexOutOfBoundsException | if bitIndex < 0
|
Definition at line 325 of file FastBitSet.java.
References javolution.util.FastBitSet.service, and javolution.util.service.BitSetService.set().
FastBitSet javolution.util.FastBitSet.shared | ( | ) |
Definition at line 60 of file FastBitSet.java.
|
inherited |
Returns the size of this collection.
Definition at line 106 of file FastSet.java.
FastBitSet javolution.util.FastBitSet.unmodifiable | ( | ) |
Definition at line 55 of file FastBitSet.java.
void javolution.util.FastBitSet.xor | ( | FastBitSet | that | ) |
Performs the logical XOR operation on this bit set and the one specified. In other words, builds the symmetric remainder of the two sets (the elements that are in one set, but not in the other).
The result is stored into this bit set.
that | the second bit set. |
Definition at line 338 of file FastBitSet.java.
References javolution.util.FastBitSet.service, and javolution.util.service.BitSetService.xor().
|
staticprivate |
Definition at line 29 of file FastBitSet.java.
|
private |
Holds the bit set implementation.
Definition at line 34 of file FastBitSet.java.
Referenced by javolution.util.FastBitSet.and(), javolution.util.FastBitSet.andNot(), javolution.util.FastBitSet.cardinality(), javolution.util.FastBitSet.clear(), javolution.util.FastBitSet.FastBitSet(), javolution.util.FastBitSet.flip(), javolution.util.FastBitSet.get(), javolution.util.FastBitSet.intersects(), javolution.util.FastBitSet.length(), javolution.util.FastBitSet.nextClearBit(), javolution.util.FastBitSet.nextSetBit(), javolution.util.FastBitSet.or(), javolution.util.FastBitSet.previousClearBit(), javolution.util.FastBitSet.previousSetBit(), javolution.util.FastBitSet.service(), javolution.util.FastBitSet.set(), and javolution.util.FastBitSet.xor().