程序包 weka.core

类 FastVector

java.lang.Object
weka.core.FastVector
所有已实现的接口:
Serializable, Copyable, RevisionHandler
直接已知子类:
BestFirst.LinkedList2, LFSMethods.LinkedList2

public class FastVector extends Object implements Copyable, Serializable, RevisionHandler
Implements a fast vector class without synchronized methods. Replaces java.util.Vector. (Synchronized methods tend to be slow.)
版本:
$Revision: 1.16 $
作者:
Eibe Frank (eibe@cs.waikato.ac.nz)
另请参阅:
  • 嵌套类概要

    嵌套类
    修饰符和类型
    说明
    class 
    Class for enumerating the vector's elements.
  • 构造器概要

    构造器
    构造器
    说明
    Constructs an empty vector with initial capacity zero.
    FastVector(int capacity)
    Constructs a vector with the given capacity.
  • 方法概要

    修饰符和类型
    方法
    说明
    final void
    addElement(Object element)
    Adds an element to this vector.
    final void
    Appends all elements of the supplied vector to this vector.
    final int
    Returns the capacity of the vector.
    boolean
    added by akibriya
    final Object
    Produces a shallow copy of this vector.
    final Object
    Clones the vector and shallow copies all its elements.
    final Object
    elementAt(int index)
    Returns the element at the given position.
    Returns an enumeration of this vector.
    elements(int index)
    Returns an enumeration of this vector, skipping the element with the given index.
    final Object
    Returns the first element of the vector.
    Returns the revision string.
    final int
    indexOf(Object element)
    Searches for the first occurence of the given argument, testing for equality using the equals method.
    final void
    insertElementAt(Object element, int index)
    Inserts an element at the given position.
    final Object
    Returns the last element of the vector.
    final void
    Removes all components from this vector and sets its size to zero.
    final void
    removeElementAt(int index)
    Deletes an element from this vector.
    final void
    setCapacity(int capacity)
    Sets the vector's capacity to the given value.
    final void
    setElementAt(Object element, int index)
    Sets the element at the given index.
    final int
    Returns the vector's current size.
    final void
    swap(int first, int second)
    Swaps two elements in the vector.
    final Object[]
    Returns all the elements of this vector as an array
    final void
    Sets the vector's capacity to its size.

    从类继承的方法 java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • FastVector

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

      public FastVector(int capacity)
      Constructs a vector with the given capacity.
      参数:
      capacity - the vector's initial capacity
  • 方法详细资料

    • addElement

      public final void addElement(Object element)
      Adds an element to this vector. Increases its capacity if its not large enough.
      参数:
      element - the element to add
    • capacity

      public final int capacity()
      Returns the capacity of the vector.
      返回:
      the capacity of the vector
    • copy

      public final Object copy()
      Produces a shallow copy of this vector.
      指定者:
      copy 在接口中 Copyable
      返回:
      the new vector
    • copyElements

      public final Object copyElements()
      Clones the vector and shallow copies all its elements. The elements have to implement the Copyable interface.
      返回:
      the new vector
    • elementAt

      public final Object elementAt(int index)
      Returns the element at the given position.
      参数:
      index - the element's index
      返回:
      the element with the given index
    • elements

      public final Enumeration elements()
      Returns an enumeration of this vector.
      返回:
      an enumeration of this vector
    • elements

      public final Enumeration elements(int index)
      Returns an enumeration of this vector, skipping the element with the given index.
      参数:
      index - the element to skip
      返回:
      an enumeration of this vector
    • contains

      public boolean contains(Object o)
      added by akibriya
    • firstElement

      public final Object firstElement()
      Returns the first element of the vector.
      返回:
      the first element of the vector
    • indexOf

      public final int indexOf(Object element)
      Searches for the first occurence of the given argument, testing for equality using the equals method.
      参数:
      element - the element to be found
      返回:
      the index of the first occurrence of the argument in this vector; returns -1 if the object is not found
    • insertElementAt

      public final void insertElementAt(Object element, int index)
      Inserts an element at the given position.
      参数:
      element - the element to be inserted
      index - the element's index
    • lastElement

      public final Object lastElement()
      Returns the last element of the vector.
      返回:
      the last element of the vector
    • removeElementAt

      public final void removeElementAt(int index)
      Deletes an element from this vector.
      参数:
      index - the index of the element to be deleted
    • removeAllElements

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

      public final void appendElements(FastVector toAppend)
      Appends all elements of the supplied vector to this vector.
      参数:
      toAppend - the FastVector containing elements to append.
    • toArray

      public final Object[] toArray()
      Returns all the elements of this vector as an array
      返回:
      an array containing all the elements of this vector
    • setCapacity

      public final void setCapacity(int capacity)
      Sets the vector's capacity to the given value.
      参数:
      capacity - the new capacity
    • setElementAt

      public final void setElementAt(Object element, int index)
      Sets the element at the given index.
      参数:
      element - the element to be put into the vector
      index - the index at which the element is to be placed
    • size

      public final int size()
      Returns the vector's current size.
      返回:
      the vector's current size
    • swap

      public final void swap(int first, int second)
      Swaps two elements in the vector.
      参数:
      first - index of the first element
      second - index of the second element
    • trimToSize

      public final void trimToSize()
      Sets the vector's capacity to its size.
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      返回:
      the revision