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)

Constructor Index

 o DynamicArrayOfPosInt()
Constructor
 o DynamicArrayOfPosInt(int)
Constructor with size larger than 1.

Method Index

 o deleteOneIndex(int)
Deletes an entry.
 o get(int)
 
 o length()
 
 o set(int, int)
Stores the value in the specified position in the array.
 o squeezeIn(int, int)
Sqeezes in the value in the specified position in the array.
 o toString()
Build a string representing this array.

Constructor Detail

 o DynamicArrayOfPosInt
public DynamicArrayOfPosInt()
          Constructor
 o DynamicArrayOfPosInt
public DynamicArrayOfPosInt(int size)
          Constructor with size larger than 1.
Parameters:
size - initial size of the array

Method Detail

 o length
public int length()
 o get
public int get(int position)
 o 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
 o 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
 o 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
 o 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