All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.classifiers.functions.pace.IntVector

java.lang.Object
    |
    +----weka.classifiers.functions.pace.IntVector

public class IntVector
extends java.lang.Object
implements java.lang.Cloneable

Constructor Index

 o IntVector()
Constructs a null vector.
 o IntVector(int)
Constructs an n-vector of zeros.
 o IntVector(int[])
Constructs a vector given an int array
 o IntVector(int, int)
Constructs an n-vector of a constant

Method Index

 o capacity()
Returns the capacity of the vector
 o clone()
Clones the IntVector object.
 o copy()
Makes a deep copy of the vector
 o get(int)
Gets the value of an element.
 o getArrayCopy()
Returns a copy of the internal one-dimensional array.
 o isEmpty()
Returns true if the vector is empty
 o main(String[])
Tests the IntVector class
 o seq(int, int)
Generates an IntVector that stores all integers inclusively between two integers.
 o set(int)
Sets the value of an element.
 o set(int, int)
Sets a single element.
 o set(int, int, int[], int)
Sets the values of elements from an int array.
 o set(int, int, IntVector, int)
Sets the values of elements from another IntVector.
 o set(IntVector)
Sets the values of elements from another IntVector.
 o setCapacity(int)
Sets the capacity of the vector
 o setSize(int)
Sets the size of the vector.
 o shift(int, int)
Shifts an element to another position.
 o shiftToEnd(int)
Shifts an element to the end of the vector.
 o size()
Gets the size of the vector.
 o sort()
Sorts the elements in place
 o subvector(int, int)
Returns a subvector.
 o subvector(IntVector)
Returns a subvector as indexed by an IntVector.
 o swap(int, int)
Swaps the values stored at i and j
 o toString()
Converts the IntVecor to a string
 o toString(int, boolean)
Convert the IntVecor to a string

Constructor Detail

 o IntVector
public IntVector()
          Constructs a null vector.
 o IntVector
public IntVector(int n)
          Constructs an n-vector of zeros.
Parameters:
n - Length.
 o IntVector
public IntVector(int n,
                 int s)
          Constructs an n-vector of a constant
Parameters:
n - Length.
 o IntVector
public IntVector(int v[])
          Constructs a vector given an int array
Parameters:
v - the int array

Method Detail

 o size
public int size()
          Gets the size of the vector.
Returns:
Size.
 o setSize
public void setSize(int size)
          Sets the size of the vector. The provided size can't be greater than the capacity of the vector.
Returns:
Size.
 o set
public void set(int s)
          Sets the value of an element.
Parameters:
s - the value for the element
 o set
public void set(int i0,
                int i1,
                int v[],
                int j0)
          Sets the values of elements from an int array.
Parameters:
i0 - the index of the first element
i1 - the index of the last element
v - the int array that stores the values
j0 - the index of the first element in the int array
 o set
public void set(int i0,
                int i1,
                IntVector v,
                int j0)
          Sets the values of elements from another IntVector.
Parameters:
i0 - the index of the first element
i1 - the index of the last element
v - the IntVector that stores the values
j0 - the index of the first element in the IntVector
 o set
public void set(IntVector v)
          Sets the values of elements from another IntVector.
Parameters:
v - the IntVector that stores the values
 o seq
public static IntVector seq(int i0,
                            int i1)
          Generates an IntVector that stores all integers inclusively between two integers.
Parameters:
i0 - the first integer
i1 - the second integer
 o sort
public void sort()
          Sorts the elements in place
 o getArrayCopy
public int[] getArrayCopy()
          Returns a copy of the internal one-dimensional array.
Returns:
One-dimensional array copy of vector elements.
 o capacity
public int capacity()
          Returns the capacity of the vector
 o setCapacity
public void setCapacity(int capacity)
          Sets the capacity of the vector
Parameters:
capacity - the new capacity of the vector
 o set
public void set(int i,
                int s)
          Sets a single element.
Parameters:
i - the index of the element
s - the new value
 o get
public int get(int i)
          Gets the value of an element.
Parameters:
i - the index of the element
Returns:
the value of the element
 o copy
public IntVector copy()
          Makes a deep copy of the vector
 o clone
public java.lang.Object clone()
          Clones the IntVector object.
 o subvector
public IntVector subvector(int i0,
                           int i1)
          Returns a subvector.
Parameters:
i0 - the index of the first element
i1 - the index of the last element
Returns:
the subvector
 o subvector
public IntVector subvector(IntVector index)
          Returns a subvector as indexed by an IntVector.
Parameters:
i0 - the index of the first element
i1 - the index of the last element
Returns:
the subvector
 o swap
public void swap(int i,
                 int j)
          Swaps the values stored at i and j
Parameters:
i - the index i
j - the index j
 o shift
public void shift(int i,
                  int j)
          Shifts an element to another position. Elements between them are shifted one position left.
Parameters:
i - the index of the element
j - the index of the new position
 o shiftToEnd
public void shiftToEnd(int j)
          Shifts an element to the end of the vector. Elements between them are shifted one position left.
Parameters:
i - the index of the element
j - the index of the new position
 o isEmpty
public boolean isEmpty()
          Returns true if the vector is empty
 o toString
public java.lang.String toString()
          Converts the IntVecor to a string
Overrides:
toString in class java.lang.Object
 o toString
public java.lang.String toString(int digits,
                       boolean trailing)
          Convert the IntVecor to a string
Parameters:
digits - number of digits to be shown
trailing - true if trailing zeros are to be shown
 o main
public static void main(java.lang.String args[])
          Tests the IntVector class

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home