prefuse.data.util
Interface Index

All Known Implementing Classes:
TreeIndex

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.

Author:
jeffrey heer

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

TYPE_ASCENDING

static final int TYPE_ASCENDING
Flag for an ascending sort order.

See Also:
Constant Field Values

TYPE_DESCENDING

static final int TYPE_DESCENDING
Flag for a descending sort order.

See Also:
Constant Field Values

TYPE_LEFT_INCLUSIVE

static final int TYPE_LEFT_INCLUSIVE
Flag for including the lowest value of a range.

See Also:
Constant Field Values

TYPE_LEFT_EXCLUSIVE

static final int TYPE_LEFT_EXCLUSIVE
Flag for excluding the lowest value of a range.

See Also:
Constant Field Values

TYPE_RIGHT_INCLUSIVE

static final int TYPE_RIGHT_INCLUSIVE
Flag for including the highest value of a range.

See Also:
Constant Field Values

TYPE_RIGHT_EXCLUSIVE

static final int TYPE_RIGHT_EXCLUSIVE
Flag for excluding the highest value of a range.

See Also:
Constant Field Values

TYPE_AII

static final int TYPE_AII
Composite flag for an ascending, left and right inclusive range.

See Also:
Constant Field Values

TYPE_DII

static final int TYPE_DII
Composite flag for a descending, left and right inclusive range.

See Also:
Constant Field Values

TYPE_AEI

static final int TYPE_AEI
Composite flag for an ascending, left exclusive, right inclusive range.

See Also:
Constant Field Values

TYPE_DEI

static final int TYPE_DEI
Composite flag for a descending, left exclusive, right inclusive range.

See Also:
Constant Field Values

TYPE_AIE

static final int TYPE_AIE
Composite flag for an ascending, left inclusive, right exclusive range.

See Also:
Constant Field Values

TYPE_DIE

static final int TYPE_DIE
Composite flag for a descending, left inclusive, right exclusive range.

See Also:
Constant Field Values

TYPE_AEE

static final int TYPE_AEE
Composite flag for an ascending, left and right exclusive range.

See Also:
Constant Field Values

TYPE_DEE

static final int TYPE_DEE
Composite flag for a descending, left and right exclusive range.

See Also:
Constant Field Values
Method Detail

index

void index()
Perform an initial indexing of a data column.


dispose

void dispose()
Dispose of an index, deregistering all listeners.


getComparator

java.util.Comparator getComparator()
Get the comparator used to compare column data values.

Returns:
the sort comparator

minimum

int minimum()
Get the row (or one of the rows) with the minimum data value.

Returns:
a row with a minimum data value

maximum

int maximum()
Get the row (or one of the rows) with the maximum data value.

Returns:
a row with a maximum data value

median

int median()
Get the row (or one of the rows) with the median data value.

Returns:
a row with a median data value

uniqueCount

int uniqueCount()
Get the number of unique data values in the index.

Returns:
the number of unique data values

size

int size()
Get the size of this index, the number of data value / row pairs included.

Returns:
the size of the index

allRows

IntIterator allRows(int type)
Get an iterator over all rows in the index, in sorted order.

Parameters:
type - the sort type, one of TYPE_ASCENDING or TYPE_DESCENDING.
Returns:
an iterator over all rows in the index

rows

IntIterator rows(java.lang.Object lo,
                 java.lang.Object hi,
                 int type)
Get an iterator over a sorted range of rows.

Parameters:
lo - the minimum data value
hi - the maximum data value
type - the iteration type, one of the composite flags involving both a sort order, and whether each bound of the range should inclusive or exclusive
Returns:
an iterator over a sorted range of rows

rows

IntIterator rows(int lo,
                 int hi,
                 int type)
Get an iterator over a sorted range of rows.

Parameters:
lo - the minimum data value
hi - the maximum data value
type - the iteration type, one of the composite flags involving both a sort order, and whether each bound of the range should inclusive or exclusive
Returns:
an iterator over a sorted range of rows

rows

IntIterator rows(long lo,
                 long hi,
                 int type)
Get an iterator over a sorted range of rows.

Parameters:
lo - the minimum data value
hi - the maximum data value
type - the iteration type, one of the composite flags involving both a sort order, and whether each bound of the range should inclusive or exclusive
Returns:
an iterator over a sorted range of rows

rows

IntIterator rows(float lo,
                 float hi,
                 int type)
Get an iterator over a sorted range of rows.

Parameters:
lo - the minimum data value
hi - the maximum data value
type - the iteration type, one of the composite flags involving both a sort order, and whether each bound of the range should inclusive or exclusive
Returns:
an iterator over a sorted range of rows

rows

IntIterator rows(double lo,
                 double hi,
                 int type)
Get an iterator over a sorted range of rows.

Parameters:
lo - the minimum data value
hi - the maximum data value
type - the iteration type, one of the composite flags involving both a sort order, and whether each bound of the range should inclusive or exclusive
Returns:
an iterator over a sorted range of rows

rows

IntIterator rows(java.lang.Object val)
Get an iterator over all rows with the given data value.

Parameters:
val - the data value
Returns:
an iterator over all rows matching the data value

rows

IntIterator rows(int val)
Get an iterator over all rows with the given data value.

Parameters:
val - the data value
Returns:
an iterator over all rows matching the data value

rows

IntIterator rows(long val)
Get an iterator over all rows with the given data value.

Parameters:
val - the data value
Returns:
an iterator over all rows matching the data value

rows

IntIterator rows(float val)
Get an iterator over all rows with the given data value.

Parameters:
val - the data value
Returns:
an iterator over all rows matching the data value

rows

IntIterator rows(double val)
Get an iterator over all rows with the given data value.

Parameters:
val - the data value
Returns:
an iterator over all rows matching the data value

rows

IntIterator rows(boolean val)
Get an iterator over all rows with the given data value.

Parameters:
val - the data value
Returns:
an iterator over all rows matching the data value

get

int get(java.lang.Object x)
Get the first row found with the given data value.

Parameters:
x - the data value
Returns:
the first row matching the data value

get

int get(int x)
Get the first row found with the given data value.

Parameters:
x - the data value
Returns:
the first row matching the data value

get

int get(long x)
Get the first row found with the given data value.

Parameters:
x - the data value
Returns:
the first row matching the data value

get

int get(float x)
Get the first row found with the given data value.

Parameters:
x - the data value
Returns:
the first row matching the data value

get

int get(double x)
Get the first row found with the given data value.

Parameters:
x - the data value
Returns:
the first row matching the data value


Copyright © 2007 Regents of the University of California