public class Indices extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PRIMARY_KEY_NAME |
| Constructor and Description |
|---|
Indices(DataFrame dataFrame)
Creates an index for a data frame
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIndex(String name,
boolean unique,
DataFrameColumn... columns)
Creates and adds a new index using one or more columns
|
void |
addIndex(String name,
DataFrameColumn... columns)
Creates and adds a new index using one or more columns
|
void |
clearValues()
Clears the values of all indices
|
boolean |
containsIndex(String name)
Returns true if an index with the specified name exists
|
void |
copyTo(DataFrame dataFrame)
Copies all indices into another data frame
|
Collection<Integer> |
find(String name,
Comparable... values)
Returns the row numbers for a index and a set of values for the index
|
Integer |
findByPrimaryKey(Comparable... values)
Returns the row number for a set of primary key values
|
Integer |
findFirst(String name,
Comparable... values)
Returns the first found row number for a index and a set of values for the index
If no row is found, null is returned
|
boolean |
isIndexColumn(DataFrameColumn column)
Returns true if the specified column is part of at least one index.
|
void |
remove(DataRow dataRow)
Removes a row from all indices
|
void |
removeColumn(DataFrameColumn column)
Removes all indices that contain a certain column
|
void |
removeIndex(String name)
Removes an index based on its name
|
void |
setPrimaryKey(DataFrameColumn... columns)
sets the primary key using one or more columns
|
void |
update(DataRow dataRow)
Updates a data row in all available indices
|
void |
updateColumn(DataFrameColumn column)
Updates all indices that contain a certain row.
|
void |
updateValue(DataFrameColumn column,
DataRow dataRow)
Updates the specified in each index that contains the specified column
|
public static final String PRIMARY_KEY_NAME
public Indices(DataFrame dataFrame)
dataFrame - input data framepublic boolean isIndexColumn(DataFrameColumn column)
column - input columnpublic void copyTo(DataFrame dataFrame)
dataFrame - data frame the indices are copied topublic void update(DataRow dataRow)
dataRow - data row to updatepublic Collection<Integer> find(String name, Comparable... values)
name - name of the indexvalues - row valuespublic Integer findFirst(String name, Comparable... values)
name - name of the indexvalues - row valuespublic Integer findByPrimaryKey(Comparable... values)
values - primary key valuespublic void addIndex(String name, DataFrameColumn... columns)
name - name of the indexcolumns - columns the index is based onpublic void addIndex(String name, boolean unique, DataFrameColumn... columns)
name - name of the indexunique - allow only unique values in this indexcolumns - columns the index is based onpublic void setPrimaryKey(DataFrameColumn... columns)
columns - columns the index is based onpublic boolean containsIndex(String name)
name - name of indexpublic void clearValues()
public void updateValue(DataFrameColumn column, DataRow dataRow)
column - index columndataRow - row to updatepublic void updateColumn(DataFrameColumn column)
column - update columnpublic void remove(DataRow dataRow)
dataRow - row to removepublic void removeIndex(String name)
name - name of index to removepublic void removeColumn(DataFrameColumn column)
column - column to removeCopyright © 2017. All rights reserved.