Gephi Toolkit Javadoc

org.gephi.filters.api
Interface Query


public interface Query

Queries are wrapping filters and are assembled in a query tree. Each query is built from a single filter instance and it's role is to basically to execute the filter. The graph that is passed to the filter depends on the fact the query belongs to a complex query tree or if the tree is a single leaf.

The system works like this. Leaves of the query tree receives the complete graph and the subgraphs they return are passed to the parent query. Thus the root query is the last query to get the subgraphs and returns the final result. This querying system make possible to create query chains and complex scenario with various operators (AND, OR, ...).

Queries are built by the FilterController from filter instances.

Author:
Mathieu Bastian
See Also:
FilterController

Method Summary
 Query[] getChildren()
          Returns queries that are children of this query.
 int getChildrenSlotsCount()
          Returns the limit number of children this query can have.
 Query[] getDescendantsAndSelf()
          Utility method that returns all descendant queries plus this query.
 Filter getFilter()
          Returns the filter this query is wrapping.
 java.lang.String getName()
          Returns query's full name.
 Query getParent()
          Returns the parent query or null if this query is root.
 int getPropertiesCount()
          Returns the number of properties this query has.
 java.lang.String getPropertyName(int index)
          Returns the name of the property at the specified index.
 java.lang.Object getPropertyValue(int index)
          Returns the value of the property at the specified index.
 Query[] getQueries(java.lang.Class<? extends Filter> filterClass)
          Utility method that returns all queries in this query hierarchy that are filterClass instance.
 

Method Detail

getName

java.lang.String getName()
Returns query's full name.

Returns:
query's name

getChildren

Query[] getChildren()
Returns queries that are children of this query.

Returns:
query's children

getChildrenSlotsCount

int getChildrenSlotsCount()
Returns the limit number of children this query can have. Return 1 for a standard query.

Returns:
the number of allowed children query

getParent

Query getParent()
Returns the parent query or null if this query is root.

Returns:
the query's parent query, or null

getPropertiesCount

int getPropertiesCount()
Returns the number of properties this query has.

Returns:
the query's number of properties

getPropertyName

java.lang.String getPropertyName(int index)
Returns the name of the property at the specified index.

Parameters:
index - the index of the property
Returns:
the query's property name
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index is out of bounds

getPropertyValue

java.lang.Object getPropertyValue(int index)
Returns the value of the property at the specified index.

Parameters:
index - the index of the property
Returns:
the query's property value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index is out of bounds

getQueries

Query[] getQueries(java.lang.Class<? extends Filter> filterClass)
Utility method that returns all queries in this query hierarchy that are filterClass instance.

Parameters:
filterClass - the filter class that is to be queried
Returns:
all queries, including self that are filterClass instance

getDescendantsAndSelf

Query[] getDescendantsAndSelf()
Utility method that returns all descendant queries plus this query.

Returns:
all descendant queries and self

getFilter

Filter getFilter()
Returns the filter this query is wrapping.

Returns:
the filter

Gephi Toolkit Javadoc