|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Index
Represents an index over a column of data, allowing quick lookups by data value and providing iterators over sorted ranges of data. For convenience, there are index lookup methods for a variety of data types; which ones to use depend on the data type of the column being indexed and calling a lookup method for an incompatible data type could lead to an exception being thrown.
Field Summary | |
---|---|
static int |
TYPE_AEE
Composite flag for an ascending, left and right exclusive range. |
static int |
TYPE_AEI
Composite flag for an ascending, left exclusive, right inclusive range. |
static int |
TYPE_AIE
Composite flag for an ascending, left inclusive, right exclusive range. |
static int |
TYPE_AII
Composite flag for an ascending, left and right inclusive range. |
static int |
TYPE_ASCENDING
Flag for an ascending sort order. |
static int |
TYPE_DEE
Composite flag for a descending, left and right exclusive range. |
static int |
TYPE_DEI
Composite flag for a descending, left exclusive, right inclusive range. |
static int |
TYPE_DESCENDING
Flag for a descending sort order. |
static int |
TYPE_DIE
Composite flag for a descending, left inclusive, right exclusive range. |
static int |
TYPE_DII
Composite flag for a descending, left and right inclusive range. |
static int |
TYPE_LEFT_EXCLUSIVE
Flag for excluding the lowest value of a range. |
static int |
TYPE_LEFT_INCLUSIVE
Flag for including the lowest value of a range. |
static int |
TYPE_RIGHT_EXCLUSIVE
Flag for excluding the highest value of a range. |
static int |
TYPE_RIGHT_INCLUSIVE
Flag for including the highest value of a range. |
Method Summary | |
---|---|
IntIterator |
allRows(int type)
Get an iterator over all rows in the index, in sorted order. |
void |
dispose()
Dispose of an index, deregistering all listeners. |
int |
get(double x)
Get the first row found with the given data value. |
int |
get(float x)
Get the first row found with the given data value. |
int |
get(int x)
Get the first row found with the given data value. |
int |
get(long x)
Get the first row found with the given data value. |
int |
get(java.lang.Object x)
Get the first row found with the given data value. |
java.util.Comparator |
getComparator()
Get the comparator used to compare column data values. |
void |
index()
Perform an initial indexing of a data column. |
int |
maximum()
Get the row (or one of the rows) with the maximum data value. |
int |
median()
Get the row (or one of the rows) with the median data value. |
int |
minimum()
Get the row (or one of the rows) with the minimum data value. |
IntIterator |
rows(boolean val)
Get an iterator over all rows with the given data value. |
IntIterator |
rows(double val)
Get an iterator over all rows with the given data value. |
IntIterator |
rows(double lo,
double hi,
int type)
Get an iterator over a sorted range of rows. |
IntIterator |
rows(float val)
Get an iterator over all rows with the given data value. |
IntIterator |
rows(float lo,
float hi,
int type)
Get an iterator over a sorted range of rows. |
IntIterator |
rows(int val)
Get an iterator over all rows with the given data value. |
IntIterator |
rows(int lo,
int hi,
int type)
Get an iterator over a sorted range of rows. |
IntIterator |
rows(long val)
Get an iterator over all rows with the given data value. |
IntIterator |
rows(long lo,
long hi,
int type)
Get an iterator over a sorted range of rows. |
IntIterator |
rows(java.lang.Object val)
Get an iterator over all rows with the given data value. |
IntIterator |
rows(java.lang.Object lo,
java.lang.Object hi,
int type)
Get an iterator over a sorted range of rows. |
int |
size()
Get the size of this index, the number of data value / row pairs included. |
int |
uniqueCount()
Get the number of unique data values in the index. |
Field Detail |
---|
static final int TYPE_ASCENDING
static final int TYPE_DESCENDING
static final int TYPE_LEFT_INCLUSIVE
static final int TYPE_LEFT_EXCLUSIVE
static final int TYPE_RIGHT_INCLUSIVE
static final int TYPE_RIGHT_EXCLUSIVE
static final int TYPE_AII
static final int TYPE_DII
static final int TYPE_AEI
static final int TYPE_DEI
static final int TYPE_AIE
static final int TYPE_DIE
static final int TYPE_AEE
static final int TYPE_DEE
Method Detail |
---|
void index()
void dispose()
java.util.Comparator getComparator()
int minimum()
int maximum()
int median()
int uniqueCount()
int size()
IntIterator allRows(int type)
type
- the sort type, one of TYPE_ASCENDING
or
TYPE_DESCENDING
.
IntIterator rows(java.lang.Object lo, java.lang.Object hi, int type)
lo
- the minimum data valuehi
- the maximum data valuetype
- the iteration type, one of the composite flags
involving both a sort order, and whether each bound of
the range should inclusive or exclusive
IntIterator rows(int lo, int hi, int type)
lo
- the minimum data valuehi
- the maximum data valuetype
- the iteration type, one of the composite flags
involving both a sort order, and whether each bound of
the range should inclusive or exclusive
IntIterator rows(long lo, long hi, int type)
lo
- the minimum data valuehi
- the maximum data valuetype
- the iteration type, one of the composite flags
involving both a sort order, and whether each bound of
the range should inclusive or exclusive
IntIterator rows(float lo, float hi, int type)
lo
- the minimum data valuehi
- the maximum data valuetype
- the iteration type, one of the composite flags
involving both a sort order, and whether each bound of
the range should inclusive or exclusive
IntIterator rows(double lo, double hi, int type)
lo
- the minimum data valuehi
- the maximum data valuetype
- the iteration type, one of the composite flags
involving both a sort order, and whether each bound of
the range should inclusive or exclusive
IntIterator rows(java.lang.Object val)
val
- the data value
IntIterator rows(int val)
val
- the data value
IntIterator rows(long val)
val
- the data value
IntIterator rows(float val)
val
- the data value
IntIterator rows(double val)
val
- the data value
IntIterator rows(boolean val)
val
- the data value
int get(java.lang.Object x)
x
- the data value
int get(int x)
x
- the data value
int get(long x)
x
- the data value
int get(float x)
x
- the data value
int get(double x)
x
- the data value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |