coins.flow
Interface BitVectorIterator

All Known Subinterfaces:
DefVectorIterator, ExpVectorIterator, FlowAnalSymVectorIterator, PointVectorIterator
All Known Implementing Classes:
BitVectorIteratorImpl, DefVectorIteratorImpl, ExpVectorIteratorImpl, FlowAnalSymVectorIteratorImpl, PointVectorIteratorImpl

public interface BitVectorIterator

BitVectorIterator interface (##6)


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().
 

Method Detail

hasNext

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

Returns:
true if the vector has next element, false otherwise.

next

public int next()
Returns the next bit position of this BitVectorIterator.


nextIndex

public int nextIndex()
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.


currentIndex

public int currentIndex()
Returns the current index of bit position. This is what was last returned by next() or nextIndex().


setBit

public void setBit()
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.


resetBit

public void resetBit()
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.