Package org.gephi.graph.api
Interface Table
-
- All Superinterfaces:
ColumnIterable,Iterable<Column>
public interface Table extends ColumnIterable
The table is the container for columns. Column ids in all methods are converted to lower case.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ColumnaddColumn(String id, Class type)Adds a new column to this table.ColumnaddColumn(String id, Class type, Origin origin)Adds a new column to this table.ColumnaddColumn(String id, String title, Class type, Object defaultValue)Adds a new column to this table.ColumnaddColumn(String id, String title, Class type, Origin origin, Object defaultValue, boolean indexed)Adds a new column to this table.intcountColumns()Counts the columns in this table.intcountColumns(Origin origin)Counts the columns of the given origin.TableObservercreateTableObserver(boolean withDiff)Creates a new table observer and return it.ColumngetColumn(int index)Returns the column at the given index.ColumngetColumn(String id)Returns the column with the given identifier.ClassgetElementClass()The element class of this column.GraphgetGraph()Returns the graph this table is associated with.TableLockgetLock()Returns the table lock, which controls the multi-thread access to the table.booleanhasColumn(String id)Returns true if this table has the column.booleanisEdgeTable()Returns true if this table is the node table.booleanisNodeTable()Returns true if this table is the node table.voidremoveColumn(String id)Removes the given column based on its identifier from this table.voidremoveColumn(Column column)Removes the given column from this table.-
Methods inherited from interface org.gephi.graph.api.ColumnIterable
doBreak, iterator, toArray, toList
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
addColumn
Column addColumn(String id, Class type)
Adds a new column to this table.- Parameters:
id- the unique column identifiertype- the column type- Returns:
- the newly created column
-
addColumn
Column addColumn(String id, Class type, Origin origin)
Adds a new column to this table.- Parameters:
id- the unique column identifiertype- the column typeorigin- the column's origin- Returns:
- the newly created column
-
addColumn
Column addColumn(String id, String title, Class type, Object defaultValue)
Adds a new column to this table.- Parameters:
id- the unique column identifiertitle- the column titletype- the column typedefaultValue- the default value- Returns:
- the newly created column
-
addColumn
Column addColumn(String id, String title, Class type, Origin origin, Object defaultValue, boolean indexed)
Adds a new column to this table.- Parameters:
id- the unique column identifiertitle- the column titletype- the column typeorigin- the column's origindefaultValue- the default valueindexed- whether the column should be indexed- Returns:
- the newly created column
-
getColumn
Column getColumn(int index)
Returns the column at the given index.- Parameters:
index- the column's index- Returns:
- the found column
-
getColumn
Column getColumn(String id)
Returns the column with the given identifier.- Parameters:
id- the column's id- Returns:
- the found column or null if not found
-
hasColumn
boolean hasColumn(String id)
Returns true if this table has the column.- Parameters:
id- the column's identifier- Returns:
- true if the column exists, false otherwise
-
removeColumn
void removeColumn(Column column)
Removes the given column from this table.- Parameters:
column- the column to remove
-
removeColumn
void removeColumn(String id)
Removes the given column based on its identifier from this table.- Parameters:
id- the column's identifier
-
countColumns
int countColumns()
Counts the columns in this table.- Returns:
- the number of columns
-
countColumns
int countColumns(Origin origin)
Counts the columns of the given origin.- Parameters:
origin- the origin- Returns:
- the number of columns set with this origin
-
getElementClass
Class getElementClass()
The element class of this column.- Returns:
- the element class
-
createTableObserver
TableObserver createTableObserver(boolean withDiff)
Creates a new table observer and return it.- Parameters:
withDiff- true if table observer should provide column differences- Returns:
- a newly created table observer
-
getGraph
Graph getGraph()
Returns the graph this table is associated with.- Returns:
- graph
-
isNodeTable
boolean isNodeTable()
Returns true if this table is the node table.- Returns:
- true if node table, false otherwise
-
isEdgeTable
boolean isEdgeTable()
Returns true if this table is the node table.- Returns:
- true if node table, false otherwise
-
getLock
TableLock getLock()
Returns the table lock, which controls the multi-thread access to the table.- Returns:
- table lock
-
-