com.starteam
Class QueryNode

java.lang.Object
  extended by com.starteam.QueryNode

public final class QueryNode
extends java.lang.Object

A QueryNode represents a boolean expression. The expression is applied to an item to determine if the query is true of the item or not.


Nested Class Summary
static class QueryNode.Operator
          The standard operands OR, AND and NOT
static class QueryNode.WebCacheQueryNode
          A QueryNode represents a boolean expression.
 
Constructor Summary
QueryNode(QueryNode.Operator anOperator)
          Creates a new QueryNode of the specified type.
 
Method Summary
 void appendQueryNode(QueryNode node)
          A convenience method to add a QueryNode at the end of the list.
 void appendQueryPart(QueryPart part)
          A convenience method to add a QueryParts at the end of the list.
 void clearQueryNodes()
          A convenience method to remove all query nodes.
 void clearQueryParts()
          A convenience method to remove all query parts.
 QueryNode copyQueryNode()
          Returns a deep copy of this QueryNode.
 boolean evaluate(Query.Context context, ViewMember viewMember)
          Evaluates the query node on the given view member, based on the given user context.
 java.lang.String getDebugString()
          Returns a String with debug information about this QueryNode.
 QueryNode.Operator getOperator()
          Returns the operator type for this expression.
 QueryNode[] getQueryNodes()
          Returns the QueryNodes associated with this QueryNode.
 QueryPart[] getQueryParts()
          Returns the QueryParts associated with this QueryNode.
 void setOperator(QueryNode.Operator anOperator)
          Change the operator type for this expression.
 void setQueryNodes(QueryNode[] nodes)
          Sets the QueryNodes associated with this QueryNode.
 void setQueryParts(QueryPart[] parts)
          Changes the QueryParts associated with this QueryNode.
 java.lang.String toDebugStringDepth(int depth)
          Returns a String with debug information about this QueryNode.
 java.lang.String toString()
          Returns a String description of this QueryNode.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryNode

public QueryNode(QueryNode.Operator anOperator)
Creates a new QueryNode of the specified type.

Parameters:
anOperator - a Boolean condition of AND, OR or NOT
Method Detail

copyQueryNode

public QueryNode copyQueryNode()
Returns a deep copy of this QueryNode.

Returns:
a deep copy of this QueryNode

getOperator

public QueryNode.Operator getOperator()
Returns the operator type for this expression.

See Also:
QueryNode.Operator.AND, QueryNode.Operator.OR, QueryNode.Operator.NOT

setOperator

public void setOperator(QueryNode.Operator anOperator)
Change the operator type for this expression.

Parameters:
anOperator - the type of condition: OP_AND or OP_OR or OP_NOT
See Also:
QueryNode.Operator.AND, QueryNode.Operator.OR, QueryNode.Operator.NOT

getQueryParts

public QueryPart[] getQueryParts()
Returns the QueryParts associated with this QueryNode. A QueryPart defines an expression on a single property of an item.

Returns:
the QueryParts associated with this QueryNode.

setQueryParts

public void setQueryParts(QueryPart[] parts)
Changes the QueryParts associated with this QueryNode. Cannot be null.

Parameters:
parts - the new QueryParts to associate with this QueryNode.

appendQueryPart

public void appendQueryPart(QueryPart part)
A convenience method to add a QueryParts at the end of the list.

Parameters:
part - the QueryPart to append

clearQueryParts

public void clearQueryParts()
A convenience method to remove all query parts.


getQueryNodes

public QueryNode[] getQueryNodes()
Returns the QueryNodes associated with this QueryNode. These nodes can be thought of as sub-expressions.

Returns:
the QueryNodes associated with this QueryNode.

setQueryNodes

public void setQueryNodes(QueryNode[] nodes)
Sets the QueryNodes associated with this QueryNode. These nodes can be thought of as sub-expressions.

Parameters:
nodes - the QueryParts associated with this QueryNode.

appendQueryNode

public void appendQueryNode(QueryNode node)
A convenience method to add a QueryNode at the end of the list.

Parameters:
node - the QueryNode to append.

clearQueryNodes

public void clearQueryNodes()
A convenience method to remove all query nodes.


toString

public java.lang.String toString()
Returns a String description of this QueryNode.

Overrides:
toString in class java.lang.Object
Returns:
a String description of this QueryNode.

getDebugString

public java.lang.String getDebugString()
Returns a String with debug information about this QueryNode.

Returns:
a debug string for this QueryNode.

toDebugStringDepth

public java.lang.String toDebugStringDepth(int depth)
Returns a String with debug information about this QueryNode. You can specify the current indentation depth to use.

Parameters:
depth - the indentation depth to use. Typically you would pass int 0 for a top-level QueryNode.
Returns:
a debug string for this QueryNode.

evaluate

public boolean evaluate(Query.Context context,
                        ViewMember viewMember)
Evaluates the query node on the given view member, based on the given user context.

Parameters:
context - User Context to be used
viewMember - view member on which the query is evaluated on
Returns:
result of the query evaluation


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.