Package org.gephi.graph.api
Interface Index<T extends Element>
-
- Type Parameters:
T
- Element class
public interface Index<T extends Element>
An index is associated with each table and keeps track of each unique value in columns.Each column is associated with a @{
ColumnIndex
}.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
count(Column column, Object value)
Counts the elements with value in the given column.int
countElements(Column column)
Counts the elements in the given column.int
countValues(Column column)
Counts the unique values in the given column.Iterable<T>
get(Column column, Object value)
Gets an Iterable of all elements in the index with value in the given column.ColumnIndex
getColumnIndex(Column column)
Returns the column index for the given column.Class<T>
getIndexClass()
Returns the element type of this index.String
getIndexName()
Returns the name of this index.Number
getMaxValue(Column column)
Returns the maximum value in the given column.Number
getMinValue(Column column)
Returns the minimum value in the given column.boolean
isSortable(Column column)
Returns whether the column is numeric and sortable, and therefore methodsgetMinValue(org.gephi.graph.api.Column)
andgetMaxValue(org.gephi.graph.api.Column)
are available for the column.Collection
values(Column column)
Returns all unique values in the given column.
-
-
-
Method Detail
-
count
int count(Column column, Object value)
Counts the elements with value in the given column.- Parameters:
column
- the column to count valuesvalue
- the value- Returns:
- the number of elements in the index with value in column, or zero if none
-
get
Iterable<T> get(Column column, Object value)
Gets an Iterable of all elements in the index with value in the given column.- Parameters:
column
- the column to get valuesvalue
- the value- Returns:
- an iterable with element with value in column, or null if value not found
-
values
Collection values(Column column)
Returns all unique values in the given column.- Parameters:
column
- the column to get values from- Returns:
- a collection of all unique values
-
countValues
int countValues(Column column)
Counts the unique values in the given column.- Parameters:
column
- the column to count values- Returns:
- the number of distinct values in column
-
countElements
int countElements(Column column)
Counts the elements in the given column.- Parameters:
column
- the column to count elements- Returns:
- the number of elements in column
-
isSortable
boolean isSortable(Column column)
Returns whether the column is numeric and sortable, and therefore methodsgetMinValue(org.gephi.graph.api.Column)
andgetMaxValue(org.gephi.graph.api.Column)
are available for the column.- Parameters:
column
- the column- Returns:
- true if the column is sortable, false otherwise
-
getMinValue
Number getMinValue(Column column)
Returns the minimum value in the given column.Only applies for numerical columns.
- Parameters:
column
- the column- Returns:
- the minimum value in the column
-
getMaxValue
Number getMaxValue(Column column)
Returns the maximum value in the given column.Only applies for numerical columns.
- Parameters:
column
- the column- Returns:
- the maximum value in the column
-
getIndexClass
Class<T> getIndexClass()
Returns the element type of this index.- Returns:
- the index element class
-
getIndexName
String getIndexName()
Returns the name of this index.- Returns:
- the index name
-
getColumnIndex
ColumnIndex getColumnIndex(Column column)
Returns the column index for the given column.- Parameters:
column
- the column to get the index for- Returns:
- the column index
-
-