org.mmbase.storage.search
Interface CompositeConstraint

All Superinterfaces:
Constraint
All Known Implementing Classes:
BasicCompositeConstraint

public interface CompositeConstraint
extends Constraint

A constraint combining several child constraints, using either logical AND or OR.

This corresponds to a AND- or OR-expression in SQL SELECT-syntax.

Since:
MMBase-1.7
Version:
$Id: CompositeConstraint.java 41186 2010-02-26 17:54:31Z michiel $
Author:
Rob van Maris

Field Summary
static int LOGICAL_AND
          Logical operator 'and'
static String[] LOGICAL_OPERATOR_DESCRIPTIONS
          Operator descriptions corresponding to the operator values: LOGICAL_AND, and LOGICAL_OR
static int LOGICAL_OR
          Logical operator 'or'
 
Method Summary
 boolean equals(Object obj)
          Compares this constraint to the specified object.
 List<Constraint> getChilds()
          Gets the child constraints.
 int getLogicalOperator()
          Gets the logical operator used to combine the child constraints.
 int hashCode()
           
 String toString()
          Returns a string representation of this CompositeConstraint.
 
Methods inherited from interface org.mmbase.storage.search.Constraint
getBasicSupportLevel, isInverse, setUnmodifiable
 

Field Detail

LOGICAL_AND

static final int LOGICAL_AND
Logical operator 'and'

See Also:
Constant Field Values

LOGICAL_OR

static final int LOGICAL_OR
Logical operator 'or'

See Also:
Constant Field Values

LOGICAL_OPERATOR_DESCRIPTIONS

static final String[] LOGICAL_OPERATOR_DESCRIPTIONS
Operator descriptions corresponding to the operator values: LOGICAL_AND, and LOGICAL_OR

Method Detail

getChilds

List<Constraint> getChilds()
Gets the child constraints.


getLogicalOperator

int getLogicalOperator()
Gets the logical operator used to combine the child constraints. This must be either LOGICAL_AND or LOGICAL_OR.


equals

boolean equals(Object obj)
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 Constraint
Overrides:
equals in class Object
Parameters:
obj - The object to compare with.
Returns:
true if the objects are equal, false otherwise.

hashCode

int hashCode()
Specified by:
hashCode in interface Constraint
Overrides:
hashCode in class Object

toString

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

Overrides:
toString in class Object
Returns:
A string representation of this CompositeConstraint.


MMBase 2.0-SNAPSHOT - null