Package weka.core
Class FastVector<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
weka.core.FastVector<E>
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<E>
,Collection<E>
,List<E>
,RandomAccess
,Copyable
,RevisionHandler
Deprecated.
Simple extension of ArrayList. Exists for legacy reasons.
- Version:
- $Revision: 10203 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
- See Also:
-
Constructor Summary
ConstructorDescriptionDeprecated.Constructs an empty vector with initial capacity zero.FastVector
(int capacity) Deprecated.Constructs a vector with the given capacity. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addElement
(E element) Deprecated.Adds an element to this vector.final void
appendElements
(Collection<? extends E> toAppend) Deprecated.Appends all elements of the supplied vector to this vector.final FastVector<E>
copy()
Deprecated.Produces a shallow copy of this vector.final FastVector<E>
Deprecated.Clones the vector and shallow copies all its elements.final E
elementAt
(int index) Deprecated.Returns the element at the given position.final Enumeration<E>
elements()
Deprecated.Returns an enumeration of this vector.final Enumeration<E>
elements
(int index) Deprecated.Returns an enumeration of this vector, skipping the element with the given index.final E
Deprecated.Returns the first element of the vector.Deprecated.Returns the revision string.final void
insertElementAt
(E element, int index) Deprecated.Inserts an element at the given position.final E
Deprecated.Returns the last element of the vector.final void
Deprecated.Removes all components from this vector and sets its size to zero.final void
removeElementAt
(int index) Deprecated.Deletes an element from this vector.final void
setCapacity
(int capacity) Deprecated.Sets the vector's capacity to the given value.final void
setElementAt
(E element, int index) Deprecated.Sets the element at the given index.final 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, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
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 Details
-
addElement
Deprecated.Adds an element to this vector. Increases its capacity if its not large enough.- Parameters:
element
- the element to add
-
copy
Deprecated.Produces a shallow copy of this vector. -
copyElements
Deprecated.Clones the vector and shallow copies all its elements. The elements have to implement the Copyable interface.- Returns:
- the new vector
-
elementAt
Deprecated.Returns the element at the given position.- Parameters:
index
- the element's index- Returns:
- the element with the given index
-
elements
Deprecated.Returns an enumeration of this vector.- Returns:
- an enumeration of this vector
-
elements
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
Deprecated.Returns the first element of the vector.- Returns:
- the first element of the vector
-
insertElementAt
Deprecated.Inserts an element at the given position.- Parameters:
element
- the element to be insertedindex
- the element's index
-
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
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
Deprecated.Sets the element at the given index.- Parameters:
element
- the element to be put into the vectorindex
- 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 elementsecond
- index of the second element
-
getRevision
Deprecated.Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-