kiwi.util
Class VectorSequence

java.lang.Object
  extended bykiwi.util.VectorSequence
All Implemented Interfaces:
java.util.Enumeration, Sequence

public class VectorSequence
extends java.lang.Object
implements Sequence

An implementation of Sequence for wrapping Vectors.

Author:
Mark Lindner, PING Software Group

Field Summary
private  int offset
           
private  java.util.Vector vector
           
 
Constructor Summary
VectorSequence(java.util.Vector vector)
          Construct a new VectorSequence.
 
Method Summary
 int getSize()
          Get the size of the sequence.
 boolean hasMoreElements()
          Check if the sequence has more elements.
 java.lang.Object nextElement()
          Get the next element in the sequence.
 void rewind()
          Rewind the sequence to the beginning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vector

private java.util.Vector vector

offset

private int offset
Constructor Detail

VectorSequence

public VectorSequence(java.util.Vector vector)
Construct a new VectorSequence.

Parameters:
vector - The Vector to wrap.
Method Detail

hasMoreElements

public boolean hasMoreElements()
Check if the sequence has more elements.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if there are more elements, and false otherwise.

nextElement

public java.lang.Object nextElement()
Get the next element in the sequence.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
The next element in the sequence, or null if the end has been reached.

rewind

public void rewind()
Rewind the sequence to the beginning.

Specified by:
rewind in interface Sequence

getSize

public int getSize()
Get the size of the sequence.

Specified by:
getSize in interface Sequence
Returns:
The number of items in the sequence.