|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectweka.classifiers.functions.pace.IntVector
| Constructor Summary | |
IntVector()
Constructs a null vector. |
|
IntVector(int n)
Constructs an n-vector of zeros. |
|
IntVector(int[] v)
Constructs a vector given an int array |
|
IntVector(int n,
int s)
Constructs an n-vector of a constant |
|
| Method Summary | |
int |
capacity()
Returns the capacity of the vector |
java.lang.Object |
clone()
Clones the IntVector object. |
IntVector |
copy()
Makes a deep copy of the vector |
int |
get(int i)
Gets the value of an element. |
int[] |
getArrayCopy()
Returns a copy of the internal one-dimensional array. |
boolean |
isEmpty()
Returns true if the vector is empty |
static void |
main(java.lang.String[] args)
Tests the IntVector class |
static IntVector |
seq(int i0,
int i1)
Generates an IntVector that stores all integers inclusively between two integers. |
void |
set(int s)
Sets the value of an element. |
void |
set(int i,
int s)
Sets a single element. |
void |
set(int i0,
int i1,
int[] v,
int j0)
Sets the values of elements from an int array. |
void |
set(int i0,
int i1,
IntVector v,
int j0)
Sets the values of elements from another IntVector. |
void |
set(IntVector v)
Sets the values of elements from another IntVector. |
void |
setCapacity(int capacity)
Sets the capacity of the vector |
void |
setSize(int size)
Sets the size of the vector. |
void |
shift(int i,
int j)
Shifts an element to another position. |
void |
shiftToEnd(int j)
Shifts an element to the end of the vector. |
int |
size()
Gets the size of the vector. |
void |
sort()
Sorts the elements in place |
IntVector |
subvector(int i0,
int i1)
Returns a subvector. |
IntVector |
subvector(IntVector index)
Returns a subvector as indexed by an IntVector. |
void |
swap(int i,
int j)
Swaps the values stored at i and j |
java.lang.String |
toString()
Converts the IntVecor to a string |
java.lang.String |
toString(int digits,
boolean trailing)
Convert the IntVecor to a string |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public IntVector()
public IntVector(int n)
n - Length.
public IntVector(int n,
int s)
n - Length.public IntVector(int[] v)
v - the int array| Method Detail |
public int size()
public void setSize(int size)
public void set(int s)
s - the value for the element
public void set(int i0,
int i1,
int[] v,
int j0)
i0 - the index of the first elementi1 - the index of the last elementv - the int array that stores the valuesj0 - the index of the first element in the int array
public void set(int i0,
int i1,
IntVector v,
int j0)
i0 - the index of the first elementi1 - the index of the last elementv - the IntVector that stores the valuesj0 - the index of the first element in the IntVectorpublic void set(IntVector v)
v - the IntVector that stores the values
public static IntVector seq(int i0,
int i1)
i0 - the first integeri1 - the second integerpublic void sort()
public int[] getArrayCopy()
public int capacity()
public void setCapacity(int capacity)
capacity - the new capacity of the vector
public void set(int i,
int s)
i - the index of the elements - the new valuepublic int get(int i)
i - the index of the element
public IntVector copy()
public java.lang.Object clone()
public IntVector subvector(int i0,
int i1)
i0 - the index of the first elementi1 - the index of the last element
public IntVector subvector(IntVector index)
public void swap(int i,
int j)
i - the index ij - the index j
public void shift(int i,
int j)
i - the index of the elementj - the index of the new positionpublic void shiftToEnd(int j)
j - the index of the new positionpublic boolean isEmpty()
public java.lang.String toString()
public java.lang.String toString(int digits,
boolean trailing)
digits - number of digits to be showntrailing - true if trailing zeros are to be shownpublic static void main(java.lang.String[] args)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||