coins.flow
Class BitVectorIteratorImpl

java.lang.Object
  extended bycoins.flow.BitVectorIteratorImpl
All Implemented Interfaces:
BitVectorIterator
Direct Known Subclasses:
ExpVectorIteratorImpl, PointVectorIteratorImpl

public class BitVectorIteratorImpl
extends java.lang.Object
implements BitVectorIterator

BitVectorIteratorImpl class (##6)


Field Summary
protected  int fBitCount
           
protected  int fBitPosition
           
protected  BitVector fBitVector
           
protected  int fLongWordLength
           
protected  int fShiftMax
           
 SubpFlow fSubpFlow
           
protected  long[] fVectorWord
           
 
Constructor Summary
BitVectorIteratorImpl(SubpFlow pSubpFlow, BitVector pBitVector)
           
 
Method Summary
 int currentIndex()
          Returns the current index of bit position.
 boolean hasNext()
          hasNext Sees whether the BitVector associated with this BitVectorIterator has more elements.
 int next()
          Returns the next bit position of this BitVectorIterator.
 int nextIndex()
          nextIndex Returns the next index of bit position that has value 1.
 void resetBit()
          Resets the bit for the position returned by the last call to next() or nextIndex().
 void setBit()
          Sets the bit for the position returned by the last call to next() or nextIndex().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fLongWordLength

protected int fLongWordLength

fBitCount

protected int fBitCount

fShiftMax

protected int fShiftMax

fVectorWord

protected long[] fVectorWord

fBitVector

protected final BitVector fBitVector

fBitPosition

protected int fBitPosition

fSubpFlow

public final SubpFlow fSubpFlow
Constructor Detail

BitVectorIteratorImpl

public BitVectorIteratorImpl(SubpFlow pSubpFlow,
                             BitVector pBitVector)
Method Detail

hasNext

public boolean hasNext()
Description copied from interface: BitVectorIterator
hasNext Sees whether the BitVector associated with this BitVectorIterator has more elements. This method does not check the contents of the remaining bits.

Specified by:
hasNext in interface BitVectorIterator
Returns:
true if the vector has next element, false otherwise.

next

public int next()
Description copied from interface: BitVectorIterator
Returns the next bit position of this BitVectorIterator.

Specified by:
next in interface BitVectorIterator

nextIndex

public int nextIndex()
Description copied from interface: BitVectorIterator
nextIndex Returns the next index of bit position that has value 1. If the there is no non-zero bit remaining, then 0 is returned. Therefore, having hasNext returned true does not guarantee this method returns meaningful (nonzero) value.

Specified by:
nextIndex in interface BitVectorIterator

currentIndex

public int currentIndex()
Description copied from interface: BitVectorIterator
Returns the current index of bit position. This is what was last returned by next() or nextIndex().

Specified by:
currentIndex in interface BitVectorIterator

resetBit

public void resetBit()
Description copied from interface: BitVectorIterator
Resets the bit for the position returned by the last call to next() or nextIndex(). The behavior is undefined if there was no such call or the call returned 0.

Specified by:
resetBit in interface BitVectorIterator

setBit

public void setBit()
Description copied from interface: BitVectorIterator
Sets the bit for the position returned by the last call to next() or nextIndex(). The behavior is undefined if there was no such call or the call returned 0.

Specified by:
setBit in interface BitVectorIterator