com.starbase.starteam
Class QueryNode

java.lang.Object
  |
  +--com.starbase.starteam.QueryNode

public 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.


Field Summary
static int OP_AND
          A constant defining an AND query expression.
static int OP_NOT
          A constant defining a NOT query expression.
static int OP_OR
          A constant defining an OR query expression.
 
Constructor Summary
QueryNode(int 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 parts.
 void clearQueryParts()
          A convenience method to remove all query parts.
 QueryNode copyQueryNode()
          Returns a deep copy of this QueryNode.
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 boolean evaluate(Item item)
          Evaluate this QueryPart with respect to the specified item.
 int 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.
 int hashCode()
          returns a unique hash for all instances of this type
 void setOperator(int anOperator)
          Change the operator type for this expression.
 void setQueryNodes(QueryNode[] nodes)
           
 void setQueryParts(QueryPart[] parts)
          Changes the QueryParts associated with this QueryNode.
 java.lang.String toDebugString()
          Returns a String with debug information about 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
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

OP_AND

public static final int OP_AND
A constant defining an AND query expression.

See Also:
Constant Field Values

OP_OR

public static final int OP_OR
A constant defining an OR query expression.

See Also:
Constant Field Values

OP_NOT

public static final int OP_NOT
A constant defining a NOT query expression. This is not available on all servers.

See Also:
SupportedFeatures.hasNOTQueryOperator(), Constant Field Values
Constructor Detail

QueryNode

public QueryNode(int anOperator)
Creates a new QueryNode of the specified type. The possible values can only be OP_AND and OP_OR. Newer server revisions also support the OP_NOT operator.

See Also:
QueryNode.OP_AND, QueryNode.OP_OR, QueryNode.OP_NOT, SupportedFeatures.hasNOTQueryOperator()
Method Detail

copyQueryNode

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

Returns:
a deep copy of this QueryNode

getOperator

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

See Also:
QueryNode.OP_AND, QueryNode.OP_OR, QueryNode.OP_NOT

setOperator

public void setOperator(int anOperator)
Change the operator type for this expression. Only allowed values are OP_AND or OP_OR. Newer server versions also support the OP_NOT operator.

See Also:
QueryNode.OP_AND, QueryNode.OP_OR, QueryNode.OP_NOT, SupportedFeatures.hasNOTQueryOperator()

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 QueryParts associated with this QueryNode.

setQueryNodes

public void setQueryNodes(QueryNode[] nodes)

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 parts.


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.

toDebugString

public java.lang.String toDebugString()
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.

Returns:
a debug string for this QueryNode.

evaluate

public boolean evaluate(Item item)
Evaluate this QueryPart with respect to the specified item.

Parameters:
item - the item whose specified property value to test against
Returns:
true if the item satisfies the query and false otherwise.

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.