atg.search.routing.command.search
Class ConstraintsGroup

java.lang.Object
  extended by atg.search.routing.command.SearchXMLObject
      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()
           
ConstraintsGroup(java.util.Collection<DocumentSetConstraint> pConstraints)
          Create a constraints group specifying the constraints list.
ConstraintsGroup(java.util.Collection<DocumentSetConstraint> pConstraints, BooleanExpressionType pOperation)
          Create a constraints group specifying the operation and constraints list.
ConstraintsGroup(DocumentSetConstraint[] pConstraints)
          Create a constraints group specifying a constraints array.
ConstraintsGroup(DocumentSetConstraint[] pConstraints, BooleanExpressionType pOperation)
          Create a constraints group specifying the operation and constraints array.
 
Method Summary
 ConstraintsGroup add(DocumentSetConstraint pConstraint)
          Adds a constraint to the list of constraints, and returns this.
protected  ConstraintsGroup createFromParser(atg.search.routing.utils.SearchMessageNode pRoot)
           
 boolean equals(java.lang.Object pObject)
          compares this with another by an XML comparison Note that this will generate full xml.
protected  void getAttributeXML(java.lang.StringBuilder sb)
           
protected  void getBodyXML(java.lang.StringBuilder sb)
           
 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
 java.lang.String getRequestTag()
           
 int hashCode()
           
 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()
           
 
Methods inherited from class atg.search.routing.command.search.BaseConstraint
getXml, setXml
 
Methods inherited from class atg.search.routing.command.search.DocumentSetConstraint
createFromXML, getParser, valueOf
 
Methods inherited from class atg.search.routing.command.SearchXMLObject
appendComplexXml, appendOptionalAttr, appendOptionalElem, appendOptionalElem, appendOptionalElem, appendOptionalValue, appendRequiredAttr, appendRequiredElem, appendRequiredElem, appendRequiredValue, getAllAttributeXML, getAllBodyXML, getDefaultXmlBytes, getParentXMLObject, getXmlPath, isPrintedFirstChild, setParentXMLObject, setPrintedFirstChild, toString, toXML, toXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, 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()

ConstraintsGroup

public ConstraintsGroup(java.util.Collection<DocumentSetConstraint> pConstraints)
Create a constraints group specifying the constraints list.

Parameters:
pConstraints - a collection of constraints, possibly null

ConstraintsGroup

public ConstraintsGroup(java.util.Collection<DocumentSetConstraint> pConstraints,
                        BooleanExpressionType pOperation)
Create a constraints group specifying the operation and constraints list.

Parameters:
pOperation - The operation type
pConstraints - a collection of constraints, possibly null

ConstraintsGroup

public ConstraintsGroup(DocumentSetConstraint[] pConstraints)
Create a constraints group specifying a constraints array.

Parameters:
pConstraints - an array of constraints, possibly null

ConstraintsGroup

public ConstraintsGroup(DocumentSetConstraint[] pConstraints,
                        BooleanExpressionType pOperation)
Create a constraints group specifying the operation and constraints array.

Parameters:
pOperation - The operation type
pConstraints - an array of constraints, possibly null
Method Detail

equals

public boolean equals(java.lang.Object pObject)
compares this with another by an XML comparison Note that this will generate full xml. It's not fast.

Overrides:
equals in class java.lang.Object
Parameters:
pObject - another DocumentSetConstraint
Returns:
true if they produce identical XML

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

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

toXml

public java.lang.String toXml()

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

getAttributeXML

protected void getAttributeXML(java.lang.StringBuilder sb)
                        throws atg.search.routing.command.IncompleteCommandException
Overrides:
getAttributeXML in class atg.search.routing.command.SearchXMLObject
Throws:
atg.search.routing.command.IncompleteCommandException

getBodyXML

protected void getBodyXML(java.lang.StringBuilder sb)
                   throws atg.search.routing.command.IncompleteCommandException
Overrides:
getBodyXML in class atg.search.routing.command.SearchXMLObject
Throws:
atg.search.routing.command.IncompleteCommandException

createFromParser

protected ConstraintsGroup createFromParser(atg.search.routing.utils.SearchMessageNode pRoot)
Specified by:
createFromParser in class DocumentSetConstraint

getRequestTag

public java.lang.String getRequestTag()
Specified by:
getRequestTag in class atg.search.routing.command.SearchXMLObject