|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectprefuse.data.util.TreeIndex
public class TreeIndex
Index instance that uses red-black trees to provide an index over a column of data.
| Field Summary | |
|---|---|
protected Column |
m_col
|
protected int |
m_colidx
|
protected IntSortedMap |
m_index
|
protected boolean |
m_reindex
|
protected RowManager |
m_rows
|
protected Table |
m_table
|
| Fields inherited from interface prefuse.data.util.Index |
|---|
TYPE_AEE, TYPE_AEI, TYPE_AIE, TYPE_AII, TYPE_ASCENDING, TYPE_DEE, TYPE_DEI, TYPE_DESCENDING, TYPE_DIE, TYPE_DII, TYPE_LEFT_EXCLUSIVE, TYPE_LEFT_INCLUSIVE, TYPE_RIGHT_EXCLUSIVE, TYPE_RIGHT_INCLUSIVE |
| Constructor Summary | |
|---|---|
TreeIndex(Table t,
RowManager rows,
Column col,
java.util.Comparator cmp)
Create a new TreeIndex. |
|
| Method Summary | |
|---|---|
IntIterator |
allRows(int type)
Get an iterator over all rows in the index, in sorted order. |
void |
columnChanged(Column src,
int idx,
boolean prev)
Notification that a data column has changed. |
void |
columnChanged(Column src,
int idx,
double prev)
Notification that a data column has changed. |
void |
columnChanged(Column src,
int idx,
float prev)
Notification that a data column has changed. |
void |
columnChanged(Column src,
int idx,
int prev)
Notification that a data column has changed. |
void |
columnChanged(Column src,
int type,
int start,
int end)
Notification that a data column has changed. |
void |
columnChanged(Column src,
int idx,
long prev)
Notification that a data column has changed. |
void |
columnChanged(Column src,
int idx,
java.lang.Object prev)
Notification that a data column has changed. |
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. |
void |
tableChanged(Table t,
int start,
int end,
int col,
int type)
Notification that a table has changed. |
int |
uniqueCount()
Get the number of unique data values in the index. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Table m_table
protected RowManager m_rows
protected Column m_col
protected IntSortedMap m_index
protected boolean m_reindex
protected int m_colidx
| Constructor Detail |
|---|
public TreeIndex(Table t,
RowManager rows,
Column col,
java.util.Comparator cmp)
throws IncompatibleComparatorException
t - the Table containing the data column to indexrows - the RowManager of the Tablecol - the Column instance to indexcmp - the Comparator to use to sort data values
IncompatibleComparatorException - if the comparator is not
compatible with the column's data type| Method Detail |
|---|
public void dispose()
Index
dispose in interface IndexIndex.dispose()public java.util.Comparator getComparator()
Index
getComparator in interface IndexIndex.getComparator()public int size()
Index
size in interface IndexIndex.size()public void index()
Index
index in interface IndexIndex.index()
public void tableChanged(Table t,
int start,
int end,
int col,
int type)
TableListener
tableChanged in interface TableListenert - the table that has changedstart - the starting row index of the changed table regionend - the ending row index of the changed table regioncol - the column that has changed, or
EventConstants.ALL_COLUMNS if the operation affects all
columnstype - the type of modification, one of
EventConstants.INSERT, EventConstants.DELETE, or
EventConstants.UPDATE.TableListener.tableChanged(prefuse.data.Table, int, int, int, int)
public void columnChanged(Column src,
int type,
int start,
int end)
ColumnListener
columnChanged in interface ColumnListenersrc - the column that has changedtype - One of EventConstants.INSERT,
EventConstants.DELETE, or EventConstants.UPDATE.start - the first column index that has been changedend - the last column index that has been changedColumnListener.columnChanged(prefuse.data.column.Column, int, int, int)
public void columnChanged(Column src,
int idx,
boolean prev)
ColumnListener
columnChanged in interface ColumnListenersrc - the column that has changedidx - the column row index that has changedprev - the previous value at the given locationColumnListener.columnChanged(prefuse.data.column.Column, int, boolean)
public void columnChanged(Column src,
int idx,
int prev)
ColumnListener
columnChanged in interface ColumnListenersrc - the column that has changedidx - the column row index that has changedprev - the previous value at the given locationColumnListener.columnChanged(prefuse.data.column.Column, int, int)
public void columnChanged(Column src,
int idx,
long prev)
ColumnListener
columnChanged in interface ColumnListenersrc - the column that has changedidx - the column row index that has changedprev - the previous value at the given locationColumnListener.columnChanged(prefuse.data.column.Column, int, long)
public void columnChanged(Column src,
int idx,
float prev)
ColumnListener
columnChanged in interface ColumnListenersrc - the column that has changedidx - the column row index that has changedprev - the previous value at the given locationColumnListener.columnChanged(prefuse.data.column.Column, int, float)
public void columnChanged(Column src,
int idx,
double prev)
ColumnListener
columnChanged in interface ColumnListenersrc - the column that has changedidx - the column row index that has changedprev - the previous value at the given locationColumnListener.columnChanged(prefuse.data.column.Column, int, double)
public void columnChanged(Column src,
int idx,
java.lang.Object prev)
ColumnListener
columnChanged in interface ColumnListenersrc - the column that has changedidx - the column row index that has changedprev - the previous value at the given locationColumnListener.columnChanged(prefuse.data.column.Column, int, java.lang.Object)public int minimum()
Index
minimum in interface IndexIndex.minimum()public int maximum()
Index
maximum in interface IndexIndex.maximum()public int median()
Index
median in interface IndexIndex.median()public int uniqueCount()
Index
uniqueCount in interface IndexIndex.uniqueCount()public IntIterator allRows(int type)
Index
allRows in interface Indextype - the sort type, one of Index.TYPE_ASCENDING or
Index.TYPE_DESCENDING.
Index.allRows(int)
public IntIterator rows(java.lang.Object lo,
java.lang.Object hi,
int type)
Index
rows in interface Indexlo - 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
Index.rows(java.lang.Object, java.lang.Object, int)
public IntIterator rows(int lo,
int hi,
int type)
Index
rows in interface Indexlo - 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
Index.rows(int, int, int)
public IntIterator rows(long lo,
long hi,
int type)
Index
rows in interface Indexlo - 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
Index.rows(long, long, int)
public IntIterator rows(float lo,
float hi,
int type)
Index
rows in interface Indexlo - 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
Index.rows(float, float, int)
public IntIterator rows(double lo,
double hi,
int type)
Index
rows in interface Indexlo - 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
Index.rows(double, double, int)public IntIterator rows(int val)
Index
rows in interface Indexval - the data value
Index.rows(int)public IntIterator rows(long val)
Index
rows in interface Indexval - the data value
Index.rows(long)public IntIterator rows(float val)
Index
rows in interface Indexval - the data value
Index.rows(float)public IntIterator rows(double val)
Index
rows in interface Indexval - the data value
Index.rows(double)public IntIterator rows(boolean val)
Index
rows in interface Indexval - the data value
Index.rows(boolean)public IntIterator rows(java.lang.Object val)
Index
rows in interface Indexval - the data value
Index.rows(java.lang.Object)public int get(double x)
Index
get in interface Indexx - the data value
Index.get(double)public int get(float x)
Index
get in interface Indexx - the data value
Index.get(float)public int get(int x)
Index
get in interface Indexx - the data value
Index.get(int)public int get(long x)
Index
get in interface Indexx - the data value
Index.get(long)public int get(java.lang.Object x)
Index
get in interface Indexx - the data value
Index.get(java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||