de.unidu.is.retrieval
Class BooleanQueryNode

java.lang.Object
  extended byde.unidu.is.retrieval.BooleanQueryNode
All Implemented Interfaces:
QueryNode
Direct Known Subclasses:
AndQueryNode, OrQueryNode

public abstract class BooleanQueryNode
extends java.lang.Object
implements QueryNode

A query node representating a Boolean connector.

Since:
2004-05-22
Version:
$Revision: 1.6 $, $Date: 2005/02/28 22:27:55 $
Author:
Henrik Nottelmann

Field Summary
protected  java.util.Set children
          Set of children nodes (QueryNode instances).
 
Constructor Summary
BooleanQueryNode()
          Creates a new object.
BooleanQueryNode(java.util.Set children)
          Creates a new object.
 
Method Summary
 void add(QueryNode node)
          Adds the specified query node as a child.
 QueryNode cloneNode()
          Clones this node.
 boolean equals(java.lang.Object obj)
           
 java.util.Set getChildren()
          Returns the children.
protected abstract  java.lang.String getConnector()
          Returns a XIRQL representation of the connector represented by this node.
 int hashCode()
           
 java.util.Iterator iterator()
          Returns an iterator over the children of this node.
protected abstract  BooleanQueryNode newNode()
          Returns a new, empty node of this type.
protected abstract  boolean sameClass(QueryNode node)
          Returns true iff the specified query node represents the same class as this node.
 void setChildren(java.util.Set list)
          Sets the children.
 QueryNode simplifiedNode()
          Simplifies this node.
 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
 
Methods inherited from interface de.unidu.is.retrieval.QueryNode
isDF, toDF
 

Field Detail

children

protected java.util.Set children
Set of children nodes (QueryNode instances).

Constructor Detail

BooleanQueryNode

public BooleanQueryNode()
Creates a new object.


BooleanQueryNode

public BooleanQueryNode(java.util.Set children)
Creates a new object.

Parameters:
children - children nodes
Method Detail

getChildren

public java.util.Set getChildren()
Returns the children.

Returns:
children nodes

setChildren

public void setChildren(java.util.Set list)
Sets the children.

Parameters:
list - children nodes

add

public void add(QueryNode node)
Adds the specified query node as a child.

Parameters:
node - new child node

getConnector

protected abstract java.lang.String getConnector()
Returns a XIRQL representation of the connector represented by this node.

Returns:
XIRQL representation of the connector

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

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

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)

sameClass

protected abstract boolean sameClass(QueryNode node)
Returns true iff the specified query node represents the same class as this node.

Parameters:
node - query node to compare
Returns:
true iff the specified query node represents the same class as this node

cloneNode

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

Specified by:
cloneNode in interface QueryNode
Returns:
cloned node

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()

newNode

protected abstract BooleanQueryNode newNode()
Returns a new, empty node of this type.

Returns:
new, empty node of this type