Package org.gephi.graph.api
Interface ColumnIndex<K,T extends Element>
-
- Type Parameters:
K
- value typeT
- Element class
public interface ColumnIndex<K,T extends Element> extends Iterable<Map.Entry<K,? extends Set<T>>>
A column index is associated with a column and and keeps track of each unique value and can also return the minimum and maximum values in case of a sortable value type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
count(K value)
Counts the elements with value.int
countElements()
Counts the elements.int
countValues()
Counts the unique values.Iterable<T>
get(K value)
Gets an Iterable of all elements in the column index with value.Column
getColumn()
Returns the column for which this column index belongs to.Number
getMaxValue()
Returns the maximum value.Number
getMinValue()
Returns the minimum value.int
getVersion()
Returns the index's version.boolean
isSortable()
Returns whether the column index is numeric and sortable, and therefore methodsgetMinValue()
andgetMaxValue()
are available.Collection<K>
values()
Returns all unique values.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
count
int count(K value)
Counts the elements with value.- Parameters:
value
- the value- Returns:
- the number of elements in the column index with value, or zero if none
-
get
Iterable<T> get(K value)
Gets an Iterable of all elements in the column index with value.- Parameters:
value
- the value- Returns:
- an iterable with element with value
-
values
Collection<K> values()
Returns all unique values.- Returns:
- a collection of all unique values
-
countValues
int countValues()
Counts the unique values.- Returns:
- the number of distinct values.
-
countElements
int countElements()
Counts the elements.- Returns:
- the number of elements in column
-
isSortable
boolean isSortable()
Returns whether the column index is numeric and sortable, and therefore methodsgetMinValue()
andgetMaxValue()
are available.- Returns:
- true if sortable, false otherwise
-
getMinValue
Number getMinValue()
Returns the minimum value.Only applies for sortable indices.
- Returns:
- the minimum value
-
getMaxValue
Number getMaxValue()
Returns the maximum value.Only applies for sortable indices.
- Returns:
- the maximum value
-
getColumn
Column getColumn()
Returns the column for which this column index belongs to.- Returns:
- the column
-
getVersion
int getVersion()
Returns the index's version. The version is incremented every time the index is modified.- Returns:
- index's version
-
-