com.flexive.shared.search.query
Class QueryRootNode

java.lang.Object
  extended by com.flexive.shared.search.query.QueryNode
      extended by com.flexive.shared.search.query.QueryOperatorNode
          extended by com.flexive.shared.search.query.QueryRootNode
All Implemented Interfaces:
java.io.Serializable

public class QueryRootNode
extends QueryOperatorNode

The root node of a query, containing additional information like its name or its type.

Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Nested Class Summary
static class QueryRootNode.Type
          There are substantally different query types.
 
Nested classes/interfaces inherited from class com.flexive.shared.search.query.QueryOperatorNode
QueryOperatorNode.Operator
 
Field Summary
 
Fields inherited from class com.flexive.shared.search.query.QueryNode
children, id, parent
 
Constructor Summary
QueryRootNode(int id, QueryRootNode.Type type)
          Create a new, empty query of the given type with the given root node id.
QueryRootNode(int id, QueryRootNode.Type type, ResultLocation location)
          Create a new, empty query with the given parameters.
QueryRootNode(QueryRootNode.Type type)
          Create a new, empty query of the given type.
QueryRootNode(QueryRootNode.Type type, ResultLocation location)
          Create a new, empty query with the given parameters.
 
Method Summary
 ResultLocation getLocation()
           
 java.lang.String getName()
           
 int getNewId()
          Return a fresh node ID not used in the tree.
 QueryRootNode.Type getType()
           
 QueryOperatorNode joinNodes(java.util.List<java.lang.Integer> nodeIds, QueryOperatorNode.Operator operator)
          Join the given nodes in a new sub hierarchy with the given operator.
 void setName(java.lang.String name)
           
 
Methods inherited from class com.flexive.shared.search.query.QueryOperatorNode
addChild, addChild, addChildAfter, buildSqlQuery, findChild, getChild, getNodeName, getOperator, getQueryBuilder, getSqlQuery, isValid, removeChild, setOperator, setQueryBuilder, visit
 
Methods inherited from class com.flexive.shared.search.query.QueryNode
equals, getChildren, getId, getLabel, getLevel, getParent, getPath, hashCode, isHidden, isValueNode, isWideInput, setChildren, setId, setParent, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryRootNode

public QueryRootNode(int id,
                     QueryRootNode.Type type,
                     ResultLocation location)
Create a new, empty query with the given parameters.

Parameters:
id - the node ID
type - the query type
location - the query form location (usually matches the search result location)

QueryRootNode

public QueryRootNode(QueryRootNode.Type type)
Create a new, empty query of the given type.

Parameters:
type - the query type

QueryRootNode

public QueryRootNode(QueryRootNode.Type type,
                     ResultLocation location)
Create a new, empty query with the given parameters.

Parameters:
type - the query type
location - the query form location (usually matches the search result location)

QueryRootNode

public QueryRootNode(int id,
                     QueryRootNode.Type type)
Create a new, empty query of the given type with the given root node id.

Parameters:
id - the node ID
type - the query type
Method Detail

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getType

public QueryRootNode.Type getType()

getLocation

public ResultLocation getLocation()

getNewId

public int getNewId()
Return a fresh node ID not used in the tree.

Returns:
a new node ID that can be used for attaching a new node to the tree

joinNodes

public QueryOperatorNode joinNodes(java.util.List<java.lang.Integer> nodeIds,
                                   QueryOperatorNode.Operator operator)
Join the given nodes in a new sub hierarchy with the given operator. The new subquery is inserted in the tree level of the highest node.

Parameters:
nodeIds - the nodes to be joined
operator - the operator used for joining (and/or)
Returns:
the new operator node