edu.ucsb.adl.middleware
Class Query.BooleanConstraint

java.lang.Object
  |
  +--edu.ucsb.adl.middleware.Query.Constraint
        |
        +--edu.ucsb.adl.middleware.Query.BooleanConstraint
Enclosing class:
Query

public static final class Query.BooleanConstraint
extends Query.Constraint

A boolean combination of two or more subconstraints.


Field Summary
static int AND
          Identifies the AND operator.
static int AND_NOT
          Identifies the AND NOT operator.
static int OR
          Identifies the OR operator.
 
Fields inherited from class edu.ucsb.adl.middleware.Query.Constraint
m_parent
 
Constructor Summary
Query.BooleanConstraint(int operator, Query.Constraint[] operands)
          Constructs a BooleanConstraint.
 
Method Summary
 Query.Constraint[] getOperands()
          Returns the subconstraints.
 int getOperator()
          Returns the boolean operator.
 java.lang.String toHTML(java.lang.String mapServerURL)
          Converts the constraint to HTML.
 java.lang.String toXML(int level)
          Converts the constraint to XML.
 
Methods inherited from class edu.ucsb.adl.middleware.Query.Constraint
getParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AND

public static final int AND
Identifies the AND operator.

See Also:
Constant Field Values

OR

public static final int OR
Identifies the OR operator.

See Also:
Constant Field Values

AND_NOT

public static final int AND_NOT
Identifies the AND NOT operator.

See Also:
Constant Field Values
Constructor Detail

Query.BooleanConstraint

public Query.BooleanConstraint(int operator,
                               Query.Constraint[] operands)
Constructs a BooleanConstraint.

Parameters:
operator - The boolean operator.
operands - The subconstraints, which should not be modified after calling this method.
Throws:
java.lang.IllegalArgumentException - If operator is invalid, or if operator is AND_NOT and operands does not have exactly two elements, or if otherwise operands has fewer than two elements, or if any element of operands already has a parent constraint.
java.lang.NullPointerException - If operands, or any element of operands, is null.
Method Detail

getOperator

public int getOperator()
Returns the boolean operator.

Returns:
The operator.

getOperands

public Query.Constraint[] getOperands()
Returns the subconstraints.

Returns:
The subconstraints, which should not be modified.

toHTML

public java.lang.String toHTML(java.lang.String mapServerURL)
Converts the constraint to HTML.

Specified by:
toHTML in class Query.Constraint
Parameters:
mapServerURL - The template URL of a map server or null.
Returns:
An HTML fragment consisting of one or more <li> elements.

toXML

public java.lang.String toXML(int level)
Converts the constraint to XML.

Specified by:
toXML in class Query.Constraint
Parameters:
level - The current indentation level; should be nonnegative.
Returns:
An XML fragment.