kiwi.util
Class ArraySequence

java.lang.Object
  |
  +--kiwi.util.ArraySequence

public class ArraySequence
extends Object
implements Sequence

An implementation of Sequence for wrapping arrays.

Version:
1.0 (05/98)
Author:
Mark Lindner, PING Software Group

Constructor Summary
ArraySequence(Object[] array)
          Construct a new ArraySequence.
 
Method Summary
 int getSize()
          Get the size of the sequence.
 boolean hasMoreElements()
          Check if the sequence has more elements.
 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
 

Constructor Detail

ArraySequence

public ArraySequence(Object[] array)
Construct a new ArraySequence.
Parameters:
array - The array to wrap.
Method Detail

hasMoreElements

public boolean hasMoreElements()
Check if the sequence has more elements.
Returns:
true if there are more elements, and false otherwise.

nextElement

public Object nextElement()
Get the next element in the sequence.
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.