de.unidu.is.retrieval
Class QueryCondition

java.lang.Object
  extended byde.unidu.is.retrieval.QueryCondition
All Implemented Interfaces:
QueryNode
Direct Known Subclasses:
WeightedQueryCondition

public class QueryCondition
extends java.lang.Object
implements QueryNode

A single query condition.

Since:
2004-04-12
Version:
$Revision: 1.8 $, $Date: 2005/02/28 22:27:55 $
Author:
Henrik Nottelmann

Field Summary
protected  java.lang.String operator
          An operator used for retrieval.
protected  java.lang.String path
          An XPath expression or an alias.
protected  java.lang.String value
          A comparison value.
 
Constructor Summary
QueryCondition()
          Creates a new, empty object.
QueryCondition(java.lang.String condition)
          Creates a new object by parsing the XIRQL condition string.
QueryCondition(java.lang.String path, java.lang.String operator, java.lang.String value)
          Creates a new object.
 
Method Summary
 QueryNode cloneNode()
          Clones this node.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getOperator()
          Returns the operator.
 java.lang.String getPath()
          Returns the path.
 java.lang.String getValue()
          Returns the value.
 int hashCode()
           
 boolean isDF()
          Returns true iff the node is in disjunctive form.
 java.util.Iterator iterator()
          Returns an iterator over the children of this node.
protected  void parse(java.lang.String condition)
          Fills this instance by parsing the XIRQL condition string.
 void setOperator(java.lang.String operator)
          Sets the operator.
 void setPath(java.lang.String path)
          Sets the path.
 void setValue(java.lang.String value)
          Sets the value.
 QueryNode simplifiedNode()
          Simplifies this node.
 QueryNode toDF()
          Converts the node and its subtree into disjunctive form.
 java.lang.String toPrefix()
          Returns the node in prefix notation.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

path

protected java.lang.String path
An XPath expression or an alias.


operator

protected java.lang.String operator
An operator used for retrieval.


value

protected java.lang.String value
A comparison value.

Constructor Detail

QueryCondition

public QueryCondition()
Creates a new, empty object.


QueryCondition

public QueryCondition(java.lang.String condition)
Creates a new object by parsing the XIRQL condition string.

Parameters:
condition - XIRQL condition string

QueryCondition

public QueryCondition(java.lang.String path,
                      java.lang.String operator,
                      java.lang.String value)
Creates a new object.

Parameters:
path - path
operator - name
value - comparison value
Method Detail

parse

protected void parse(java.lang.String condition)
Fills this instance by parsing the XIRQL condition string.

Parameters:
condition - XIRQL condition string

getOperator

public java.lang.String getOperator()
Returns the operator.

Returns:
operator.

setOperator

public void setOperator(java.lang.String operator)
Sets the operator.

Parameters:
operator - operator to set.

getPath

public java.lang.String getPath()
Returns the path.

Returns:
path.

setPath

public void setPath(java.lang.String path)
Sets the path.

Parameters:
path - path to set.

getValue

public java.lang.String getValue()
Returns the value.

Returns:
value.

setValue

public void setValue(java.lang.String value)
Sets the value.

Parameters:
value - value to set.

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()

toString

public java.lang.String toString()

toPrefix

public java.lang.String toPrefix()
Description copied from interface: QueryNode
Returns the node in prefix notation.

Specified by:
toPrefix in interface QueryNode
Returns:
node in prefix notation

simplifiedNode

public QueryNode simplifiedNode()
Description copied from interface: QueryNode
Simplifies this node.

Specified by:
simplifiedNode in interface QueryNode
Returns:
simplified node (or this node, if no simplication is required)

toDF

public QueryNode toDF()
Description copied from interface: QueryNode
Converts the node and its subtree into disjunctive form.

Specified by:
toDF in interface QueryNode
Returns:
node in disjunctive form (or this node, if no simplication is required)

isDF

public boolean isDF()
Description copied from interface: QueryNode
Returns true iff the node is in disjunctive form.

Specified by:
isDF in interface QueryNode
Returns:
true iff the node is in disjunctive form

iterator

public java.util.Iterator iterator()
Description copied from interface: QueryNode
Returns an iterator over the children of this node.

Specified by:
iterator in interface QueryNode
Returns:
iterator over children nodes

cloneNode

public QueryNode cloneNode()
Description copied from interface: QueryNode
Clones this node.

Specified by:
cloneNode in interface QueryNode
Returns:
cloned node