Class Index

java.lang.Object
  |
  +--Index

public class Index
extends java.lang.Object

Index is a index for one column of tabular data.


Constructor Summary
Index(double[] doubleArr, int rows)
          Constructor creates index on given array (column).
Index(int[] classArr, int rows)
          Constructor creates index on given array (column).
Index(long[] longArr, int rows)
          Constructor creates index on given array (column).
 
Method Summary
 int findFirst(double value)
          Method finds the first row which is same or bigger than given value.
 int findFirst(int value)
          Method finds the first row which is same or bigger than given value.
 int findFirst(long value)
          Method finds the first row which is same or bigger than given value.
 int getValue(int rowNo)
          Method returns the number of row in valuearray.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Index

public Index(long[] longArr,
             int rows)
Constructor creates index on given array (column).
Parameters:
lognArr - - Array on which the index will be made.
rows - - The number of rows in array.

Index

public Index(double[] doubleArr,
             int rows)
Constructor creates index on given array (column).
Parameters:
lognArr - - Array on which the index will be made.
rows - - The number of rows in array.

Index

public Index(int[] classArr,
             int rows)
Constructor creates index on given array (column).
Parameters:
lognArr - - Array on which the index will be made.
rows - - The number of rows in array.
Method Detail

findFirst

public int findFirst(long value)
Method finds the first row which is same or bigger than given value.
Parameters:
value - - The tested value.
Returns:
The number of the first row in indexarray, which has same or bigger value. -1 if not found.

findFirst

public int findFirst(double value)
Method finds the first row which is same or bigger than given value.
Parameters:
value - - The tested value.
Returns:
The number of the first row in indexarray, which has same or bigger value. -1 if not found.

findFirst

public int findFirst(int value)
Method finds the first row which is same or bigger than given value.
Parameters:
value - - The tested value.
Returns:
The number of the first row in indexarray, which has same or bigger value. -1 if not found.

getValue

public int getValue(int rowNo)
Method returns the number of row in valuearray. The number of row in indexarray is given.
Parameters:
rowNo - - The number of row in indexarray.
Returns:
The number of row in valuearray.