org.jscience.ml.cml.util
Class CyclicVector

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by org.jscience.ml.cml.util.CyclicVector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class CyclicVector
extends java.util.Vector

a 'cyclic vector' that is element[0] succeeds element[nElem-1] where nElem is size. Provides elements(startIndex) as Enumeration which iterates through whole of Vector cyclicly. [Normal elements() is inherited from Vector and starts from element[0]]. This class is not thread-safe. The vector and its contents can be changed but Enumerations will be invalidated.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
CyclicVector()
          create with an empty vector
CyclicVector(java.util.Vector vector)
          create from a (non-empty) vector
 
Method Summary
 java.util.Enumeration elements(int startIndex)
          creates an Enumeration starting at index
 java.util.Enumeration elements(java.lang.Object startObject)
          creates an Enumeration starting with (first) element containing startObject.
static void main(java.lang.String[] args)
          DOCUMENT ME!
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

CyclicVector

public CyclicVector()
create with an empty vector


CyclicVector

public CyclicVector(java.util.Vector vector)
create from a (non-empty) vector

Parameters:
vector - DOCUMENT ME!
Method Detail

elements

public java.util.Enumeration elements(java.lang.Object startObject)
                               throws java.lang.IllegalArgumentException
creates an Enumeration starting with (first) element containing startObject.

Parameters:
startObject - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

elements

public java.util.Enumeration elements(int startIndex)
                               throws java.lang.IllegalArgumentException
creates an Enumeration starting at index

Parameters:
startIndex - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

main

public static void main(java.lang.String[] args)
DOCUMENT ME!

Parameters:
args - DOCUMENT ME!