atg.search.routing.command.search
Class ConstraintsGroup

java.lang.Object
  extended by atg.search.routing.command.search.DocumentSetConstraint
      extended by atg.search.routing.command.search.BaseConstraint
          extended by atg.search.routing.command.search.ConstraintsGroup
All Implemented Interfaces:
java.io.Serializable

public class ConstraintsGroup
extends BaseConstraint

Represents multiple DocumentSetConstraint or ConstraintGroup instances with an operation definition. This is used to define compositions of multiple constraints.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
           
 
Constructor Summary
ConstraintsGroup()
           
 
Method Summary
 ConstraintsGroup add(DocumentSetConstraint pConstraint)
          Adds a constraint to the list of constraints, and returns this.
protected  ConstraintsGroup createFromParser(atg.search.routing.utils.FastXMLModel pXml, int rootIdx)
           
 DocumentSetConstraint[] getConstraints()
          Returns the constraints as an array
 DocumentSetConstraint getConstraints(int pIndex)
          Indexed getter for constraints
 java.lang.String getName()
          Returns the name of the operation, only used for the root operation
 BooleanExpressionType getOperation()
          Returns the operation for the constraint group
 java.util.List<PropConstraint> getPropConstraints()
          Helper method that returns PropConstraints only
 void setConstraints(DocumentSetConstraint[] pConstraints)
          Sets the list of constraints from an array
 void setConstraints(int pIndex, DocumentSetConstraint pConstraint)
          Sets the constraint at the provided index; if the list of constraints is not big enough, it is enlarged with null constraints in the intervening slots.
 void setName(java.lang.String pName)
          Sets the name of the operation.
 void setOperation(BooleanExpressionType pOperation)
           
 java.lang.String toXml()
          Returns the constraint xml
 
Methods inherited from class atg.search.routing.command.search.BaseConstraint
getXml, setXml
 
Methods inherited from class atg.search.routing.command.search.DocumentSetConstraint
createFromXML, equals, escapeToXml, getParser, toString, valueOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values
Constructor Detail

ConstraintsGroup

public ConstraintsGroup()
Method Detail

getPropConstraints

public java.util.List<PropConstraint> getPropConstraints()
Helper method that returns PropConstraints only

Overrides:
getPropConstraints in class DocumentSetConstraint
Returns:
List of PropConstraints, possibly empty but never null

setOperation

public void setOperation(BooleanExpressionType pOperation)
Parameters:
pOperation - the operation for the constraint group

getOperation

public BooleanExpressionType getOperation()
Returns the operation for the constraint group

Returns:
the operation for the constraint group

getName

public java.lang.String getName()
Returns the name of the operation, only used for the root operation

Returns:
name of the operation

setName

public void setName(java.lang.String pName)
Sets the name of the operation. This is optional, and if used, should only be used for the root operation

Parameters:
pName - a name for the operation

add

public ConstraintsGroup add(DocumentSetConstraint pConstraint)
Adds a constraint to the list of constraints, and returns this.

Parameters:
pConstraint -
Returns:
this, after the add

setConstraints

public void setConstraints(DocumentSetConstraint[] pConstraints)
Sets the list of constraints from an array

Parameters:
pConstraints - Array of DocumentSetConstraint

setConstraints

public void setConstraints(int pIndex,
                           DocumentSetConstraint pConstraint)
Sets the constraint at the provided index; if the list of constraints is not big enough, it is enlarged with null constraints in the intervening slots.

Parameters:
pIndex - index for the constraint
pConstraint - the constraint

getConstraints

public DocumentSetConstraint getConstraints(int pIndex)
Indexed getter for constraints

Parameters:
pIndex -
Returns:
the constraint at the index, or null if it does not exist.

getConstraints

public DocumentSetConstraint[] getConstraints()
Returns the constraints as an array

Returns:
Array of DocumentSetConstraint

toXml

public java.lang.String toXml()
Returns the constraint xml

Specified by:
toXml in class DocumentSetConstraint
Returns:
Constraint XML.

createFromParser

protected ConstraintsGroup createFromParser(atg.search.routing.utils.FastXMLModel pXml,
                                            int rootIdx)
Specified by:
createFromParser in class DocumentSetConstraint