com.starteam
Class QueryPart

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

public final class QueryPart
extends java.lang.Object

A QueryPart object represents a boolean expression on the value of a particular property of an item. For example, it could be used to define query to match file objects whose name starts with a specific string.


Nested Class Summary
static class QueryPart.Relation
          Relations that can be used in the expression
static class QueryPart.WebCacheQueryPart
           
 
Method Summary
 QueryPart copyQueryPart()
          Returns a copy of this QueryPart.
 boolean evaluate(Query.Context context, ViewMember viewMember)
          Evaluates the query part on the given view member, based on the given user context.
 boolean evaluateAgainst(java.lang.Object value)
          Evaluate this QueryPart with respect to the specified value.
 java.lang.String getDebugString()
          Returns a debug string representation of this QueryPart.
 Property getProperty()
          Gets the property being tested by this query part.
 QueryPart.Relation getRelation()
          Returns the relation type for this expression.
 java.lang.Object getValue()
          Gets the value of the item property in question
 boolean isCaseIgnored()
          Verify if case has been ignored
 void setCaseIgnored(boolean ignore)
          Set if case needs to be ignored
 void setRelation(QueryPart.Relation relation)
          Sets the relation type for this expression.
 java.lang.String toString()
          Returns the debug string representation of this QueryPart.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

copyQueryPart

public QueryPart copyQueryPart()
Returns a copy of this QueryPart. It is a deep copy so the new one may be freely modified without affecting the original. The copy will be identical but for the ID which will be -1 for the new copy.

Returns:
a copy of this QueryPart

toString

public java.lang.String toString()
Returns the debug string representation of this QueryPart.

Overrides:
toString in class java.lang.Object
Returns:
the debug string representation of this QueryPart.
See Also:
QueryPart.getDebugString()

getDebugString

public java.lang.String getDebugString()
Returns a debug string representation of this QueryPart.

Returns:
a debug string representation of this QueryPart.

evaluate

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

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

evaluateAgainst

public boolean evaluateAgainst(java.lang.Object value)
Evaluate this QueryPart with respect to the specified value. The value must be of the appropriate type for the relation type. The possible types are Integer, Double, Date, DateTime, String, byte[] int[] and Map

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

getRelation

public QueryPart.Relation getRelation()
Returns the relation type for this expression.


setRelation

public void setRelation(QueryPart.Relation relation)
Sets the relation type for this expression.

Parameters:
relation - Relation to be used

isCaseIgnored

public boolean isCaseIgnored()
Verify if case has been ignored

Returns:
if case has been ignored while evaluating the expression

setCaseIgnored

public void setCaseIgnored(boolean ignore)
Set if case needs to be ignored

Parameters:
ignore - boolean true if case is ignored while evaluating the expression

getProperty

public Property getProperty()
Gets the property being tested by this query part.

Returns:
The property being tested by this query part.

getValue

public java.lang.Object getValue()
Gets the value of the item property in question

Returns:
value of the item property


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