weka.core
Class FastVector<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<E>
              extended by weka.core.FastVector<E>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, java.util.RandomAccess, Copyable, RevisionHandler
Direct Known Subclasses:
BestFirst.LinkedList2, LFSMethods.LinkedList2

Deprecated.

@Deprecated
public class FastVector<E>
extends java.util.ArrayList<E>
implements Copyable, RevisionHandler

Simple extension of ArrayList. Exists for legacy reasons.

Version:
$Revision: 5953 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
Serialized Form

Constructor Summary
FastVector()
          Deprecated. Constructs an empty vector with initial capacity zero.
FastVector(int capacity)
          Deprecated. Constructs a vector with the given capacity.
 
Method Summary
 void addElement(E element)
          Deprecated. Adds an element to this vector.
 void appendElements(java.util.Collection<? extends E> toAppend)
          Deprecated. Appends all elements of the supplied vector to this vector.
 FastVector<E> copy()
          Deprecated. Produces a shallow copy of this vector.
 FastVector<E> copyElements()
          Deprecated. Clones the vector and shallow copies all its elements.
 E elementAt(int index)
          Deprecated. Returns the element at the given position.
 java.util.Enumeration elements()
          Deprecated. Returns an enumeration of this vector.
 java.util.Enumeration elements(int index)
          Deprecated. Returns an enumeration of this vector, skipping the element with the given index.
 E firstElement()
          Deprecated. Returns the first element of the vector.
 java.lang.String getRevision()
          Deprecated. Returns the revision string.
 void insertElementAt(E element, int index)
          Deprecated. Inserts an element at the given position.
 E lastElement()
          Deprecated. Returns the last element of the vector.
 void removeAllElements()
          Deprecated. Removes all components from this vector and sets its size to zero.
 void removeElementAt(int index)
          Deprecated. Deletes an element from this vector.
 void setCapacity(int capacity)
          Deprecated. Sets the vector's capacity to the given value.
 void setElementAt(E element, int index)
          Deprecated. Sets the element at the given index.
 void swap(int first, int second)
          Deprecated. Swaps two elements in the vector.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

FastVector

public FastVector()
Deprecated. 
Constructs an empty vector with initial capacity zero.


FastVector

public FastVector(int capacity)
Deprecated. 
Constructs a vector with the given capacity.

Parameters:
capacity - the vector's initial capacity
Method Detail

addElement

public final void addElement(E element)
Deprecated. 
Adds an element to this vector. Increases its capacity if its not large enough.

Parameters:
element - the element to add

copy

public final FastVector<E> copy()
Deprecated. 
Produces a shallow copy of this vector.

Specified by:
copy in interface Copyable
Returns:
the new vector

copyElements

public final FastVector<E> copyElements()
Deprecated. 
Clones the vector and shallow copies all its elements. The elements have to implement the Copyable interface.

Returns:
the new vector

elementAt

public final E elementAt(int index)
Deprecated. 
Returns the element at the given position.

Parameters:
index - the element's index
Returns:
the element with the given index

elements

public final java.util.Enumeration elements()
Deprecated. 
Returns an enumeration of this vector.

Returns:
an enumeration of this vector

elements

public final java.util.Enumeration elements(int index)
Deprecated. 
Returns an enumeration of this vector, skipping the element with the given index.

Parameters:
index - the element to skip
Returns:
an enumeration of this vector

firstElement

public final E firstElement()
Deprecated. 
Returns the first element of the vector.

Returns:
the first element of the vector

insertElementAt

public final void insertElementAt(E element,
                                  int index)
Deprecated. 
Inserts an element at the given position.

Parameters:
element - the element to be inserted
index - the element's index

lastElement

public final E lastElement()
Deprecated. 
Returns the last element of the vector.

Returns:
the last element of the vector

removeElementAt

public final void removeElementAt(int index)
Deprecated. 
Deletes an element from this vector.

Parameters:
index - the index of the element to be deleted

removeAllElements

public final void removeAllElements()
Deprecated. 
Removes all components from this vector and sets its size to zero.


appendElements

public final void appendElements(java.util.Collection<? extends E> toAppend)
Deprecated. 
Appends all elements of the supplied vector to this vector.

Parameters:
toAppend - the FastVector containing elements to append.

setCapacity

public final void setCapacity(int capacity)
Deprecated. 
Sets the vector's capacity to the given value.

Parameters:
capacity - the new capacity

setElementAt

public final void setElementAt(E element,
                               int index)
Deprecated. 
Sets the element at the given index.

Parameters:
element - the element to be put into the vector
index - the index at which the element is to be placed

swap

public final void swap(int first,
                       int second)
Deprecated. 
Swaps two elements in the vector.

Parameters:
first - index of the first element
second - index of the second element

getRevision

public java.lang.String getRevision()
Deprecated. 
Returns the revision string.

Specified by:
getRevision in interface RevisionHandler
Returns:
the revision