org.mmbase.storage.search.implementation
Class BasicCompositeConstraint

java.lang.Object
  extended byorg.mmbase.storage.search.implementation.BasicConstraint
      extended byorg.mmbase.storage.search.implementation.BasicCompositeConstraint
All Implemented Interfaces:
CompositeConstraint, Constraint

public class BasicCompositeConstraint
extends BasicConstraint
implements CompositeConstraint

Basic implementation.

Since:
MMBase-1.7
Version:
$Id: BasicCompositeConstraint.java,v 1.7 2005/05/02 13:02:09 michiel Exp $
Author:
Rob van Maris

Field Summary
 
Fields inherited from interface org.mmbase.storage.search.CompositeConstraint
LOGICAL_AND, LOGICAL_OPERATOR_DESCRIPTIONS, LOGICAL_OR
 
Constructor Summary
BasicCompositeConstraint(int logicalOperator)
          Constructor.
 
Method Summary
 BasicCompositeConstraint addChild(Constraint child)
          Adds new child constraint.
 boolean equals(Object obj)
          Compares this constraint to the specified object.
 int getBasicSupportLevel()
          Tests if this constraint is supported by the basic queryhandler.
 List getChilds()
          Gets the child constraints.
 int getLogicalOperator()
          Gets the logical operator used to combine the child constraints.
 String getLogicalOperatorDescription()
          Returns a description of the logical operator
 int hashCode()
           
 BasicCompositeConstraint removeChild(Constraint child)
           
 String toString()
          Returns a string representation of this CompositeConstraint.
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicConstraint
isInverse, setInverse
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.storage.search.Constraint
isInverse
 

Constructor Detail

BasicCompositeConstraint

public BasicCompositeConstraint(int logicalOperator)
Constructor.

Parameters:
logicalOperator - The logical operator.
Throws:
IllegalArgumentException - when an invalid argument is supplied.
Method Detail

addChild

public BasicCompositeConstraint addChild(Constraint child)
Adds new child constraint.

Parameters:
child - The child constraint.
Returns:
This BasicCompositeConstraint instance.
Throws:
IllegalArgumentException - when an invalid argument is supplied.

removeChild

public BasicCompositeConstraint removeChild(Constraint child)

getChilds

public List getChilds()
Description copied from interface: CompositeConstraint
Gets the child constraints.

Specified by:
getChilds in interface CompositeConstraint

getLogicalOperator

public int getLogicalOperator()
Description copied from interface: CompositeConstraint
Gets the logical operator used to combine the child constraints. This must be either LOGICAL_AND or LOGICAL_OR.

Specified by:
getLogicalOperator in interface CompositeConstraint

getLogicalOperatorDescription

public String getLogicalOperatorDescription()
Returns a description of the logical operator


getBasicSupportLevel

public int getBasicSupportLevel()
Description copied from interface: Constraint
Tests if this constraint is supported by the basic queryhandler.

Specified by:
getBasicSupportLevel in interface Constraint
Overrides:
getBasicSupportLevel in class BasicConstraint

equals

public boolean equals(Object obj)
Description copied from interface: CompositeConstraint
Compares this constraint to the specified object. The result is true if and only if the argument is a non-null CompositeConstraint object representing the same constraint(s).

Specified by:
equals in interface CompositeConstraint
Overrides:
equals in class BasicConstraint

hashCode

public int hashCode()
Specified by:
hashCode in interface CompositeConstraint
Overrides:
hashCode in class BasicConstraint

toString

public String toString()
Description copied from interface: CompositeConstraint
Returns a string representation of this CompositeConstraint. The string representation has the form "CompositeConstraint(inverse:<:inverse>, operator:<operator>, childs:<childs>)" where

Specified by:
toString in interface CompositeConstraint


MMBase build 1.8.1.20060716