All Packages Class Hierarchy This Package Previous Next Index WEKA's home
Class weka.core.DynamicArrayOfPosInt
java.lang.Object
|
+----weka.core.DynamicArrayOfPosInt
- public class DynamicArrayOfPosInt
- extends java.lang.Object
Implements a dynamic array of positive integers.
- Version:
- $Revision: 1.1 $
- Author:
- Gabi Schmidberger (gabi@cs.waikato.ac.nz)
DynamicArrayOfPosInt()
- Constructor
DynamicArrayOfPosInt(int)
- Constructor with size larger than 1.
deleteOneIndex(int)
- Deletes an entry.
get(int)
-
length()
-
set(int, int)
- Stores the value in the specified position in the array.
squeezeIn(int, int)
- Sqeezes in the value in the specified position in the array.
toString()
- Build a string representing this array.
DynamicArrayOfPosInt
public DynamicArrayOfPosInt()
Constructor
DynamicArrayOfPosInt
public DynamicArrayOfPosInt(int size)
Constructor with size larger than 1.
- Parameters:
size - initial size of the array
length
public int length()
get
public int get(int position)
set
public void set(int position,
int value)
Stores the value in the specified position in the array.
The data array will increase in size to include this
position, if necessary.
- Parameters:
position - position to write value to
value - value that is written to array
deleteOneIndex
public int deleteOneIndex(int value)
Deletes an entry. The positive integers are here understood as indices.
Every indices is in the array only once.
So if one is deleted all the others with a value higher have to
have substracted a 1.
- Parameters:
value - value that is to be deleted
squeezeIn
public void squeezeIn(int position,
int value)
Sqeezes in the value in the specified position in the array.
The used array size is increased by one and also the data array
increases in size.
- Parameters:
position - position to write value to
value - value that is written to array
toString
public java.lang.String toString()
Build a string representing this array.
- Overrides:
- toString in class java.lang.Object
All Packages Class Hierarchy This Package Previous Next Index WEKA's home