Gephi Toolkit Javadoc

org.gephi.data.attributes.api
Interface AttributeModel


public interface AttributeModel

Represents the data model, like a standard database would do. As a database, contains a list of tables, where columns are defined. By default, a model owns a node and edge table, but more could exist, depending of the model implementation.

The model also provides factories that are linked to this model. Use row factory to build new rows and value factory to push new values to these rows. Columns are manipulated from the AttributeTable class.

Author:
Mathieu Bastian
See Also:
AttributeController

Method Summary
 void addAttributeListener(AttributeListener listener)
          Adds listener to the listeners of this table.
 AttributeTable getEdgeTable()
          Returns the edge table.
 AttributeTable getGraphTable()
          Returns the graph table.
 AttributeTable getNodeTable()
          Returns the node table.
 AttributeTable getTable(java.lang.String name)
          Returns the AttributeTable which has the given name or null if this table doesn't exist.
 AttributeTable[] getTables()
          Returns all tables this model contains.
 void mergeModel(AttributeModel model)
          Merge model in this model.
 void removeAttributeListener(AttributeListener listener)
          Removes listener to the listeners of this table.
 AttributeRowFactory rowFactory()
          Returns the row factory.
 AttributeValueFactory valueFactory()
          Return the value factory.
 

Method Detail

getNodeTable

AttributeTable getNodeTable()
Returns the node table. Contains all the columns associated to node elements.

An AttributeModel has always node, edge and graph tables by default.

Returns:
the node table, contains node columns

getEdgeTable

AttributeTable getEdgeTable()
Returns the edge table. Contains all the columns associated to edge elements.

An AttributeModel has always node, edge and graph tables by default.

Returns:
the edge table, contains edge columns

getGraphTable

AttributeTable getGraphTable()
Returns the graph table. Contains all the columns associated to the graph.

An AttributeModel has always node, edge and graph tables by default.

Returns:
the edge table, contains edge columns

getTable

AttributeTable getTable(java.lang.String name)
Returns the AttributeTable which has the given name or null if this table doesn't exist.

Parameters:
name - the table's name
Returns:
the table that has been found, or null

getTables

AttributeTable[] getTables()
Returns all tables this model contains. By default, only contains node and edge tables.

Returns:
all the tables of this model

valueFactory

AttributeValueFactory valueFactory()
Return the value factory.

Returns:
the value factory

rowFactory

AttributeRowFactory rowFactory()
Returns the row factory.

Returns:
the row factory

addAttributeListener

void addAttributeListener(AttributeListener listener)
Adds listener to the listeners of this table. It receives events when columns are added or removed, as well as when values are set.

Parameters:
listener - the listener that is to be added

removeAttributeListener

void removeAttributeListener(AttributeListener listener)
Removes listener to the listeners of this table.

Parameters:
listener - the listener that is to be removed

mergeModel

void mergeModel(AttributeModel model)
Merge model in this model. Makes the union of tables and columns of both models. Copy tables this model don't have and merge existing ones. For existing tables, call AttributeTable.mergeTable(AttributeTable) to merge columns.

Columns are compared according to their id and type. Columns found in model are appended only if they no column exist with the same id and type.

Parameters:
model - the model that is to be merged in this model

Gephi Toolkit Javadoc