|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--coins.alias.util.BitVectorIterator
BitVectorIteratorImpl class: (##6)
This class offers methods for iterating over a BitVector
instance. As BitVector
s in general cannot be efficiently scanned, this class is just a compromise for when there is really a need to scan over a BitVector
. If iteration performance is important, other data structures than a BitVector
should be considered.
The iteration is implemented by maintaining and advancing the cursor position, which is the bit position of the underlying BitVector
this BitVectorIterator
currently has hold on.
The methods in this class do not necessarily throw appropriate exceptions; an instance of this class may silently enter an invalid state, so care should be taken.
Some of the methods' names (hasNext
and next
) are carried over from java.util.Iterator
interface, but their behaviors may be different from what may be expected from their names.
コンストラクタの概要 | |
BitVectorIterator(BitVector pBitVector)
Creates a BitVectorIterator instance that scans the given argument. |
メソッドの概要 | |
int |
currentIndex()
Returns the current cursor position. |
boolean |
hasNext()
Returns true if the cursor is not at or beyond the end of the underlying BitVector . |
int |
next()
Returns the next bit position and advances the cursor by one. |
int |
nextIndex()
Returns the next bit position that is set and advances the cursor up to the returned position. |
void |
resetBit()
Resets the bit at the current cursor position. |
void |
setBit()
Sets the bit at the current cursor position. |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
public BitVectorIterator(BitVector pBitVector)
BitVectorIterator
instance that scans the given argument. The cursor position (returned by currentIndex) is set to -1.
pBitVector
- the BitVector
this BitVectorIterator
scans.メソッドの詳細 |
public boolean hasNext()
true
if the cursor is not at or beyond the end of the underlying BitVector
. (In other words, returns true if next would return a number less than the length of the underlying BitVector
.)
public int next()
public int nextIndex()
public int currentIndex()
public void resetBit()
public void setBit()
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |