atg.search.routing.command.search
Class Refinements

java.lang.Object
  extended by atg.search.routing.command.SearchXMLObject
      extended by atg.search.routing.command.search.Refinements
All Implemented Interfaces:
java.io.Serializable

public class Refinements
extends atg.search.routing.command.SearchXMLObject
implements java.io.Serializable

Search Refinements value object, a list of Refinements and some other info.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
Refinements()
           
 
Method Summary
protected static int compareValueTo(int pType, RefinementValue pLeft, RefinementValue pRight)
           
 boolean equals(java.lang.Object pObject)
           
protected  void getAttributeXML(java.lang.StringBuilder sb)
           
protected  void getBodyXML(java.lang.StringBuilder sb)
           
 java.lang.String getDebugString()
          Returns the debug string
protected static int getIntFromType(atg.search.routing.command.search.RefinementType pType, boolean pIsRange)
           
 java.lang.String getMapping()
          Returns the refinement mapping
 java.lang.String getName()
          Returns the refinement configuration name
 Refinement getRefinement(int index)
          Get a single Refinement.
 Refinement[] getRefinements()
          Returns array of refinements
 java.util.ArrayList<Refinement> getRefinementsList()
          Get a list of Refinements.
 java.lang.String getRequestTag()
           
 SelectConfig getSelectConfig()
          If refineDebug is true, and $map is passed as the refineConfig, this element shows what configurations were considered and the one that was selected
 int getSize()
          Return the number of Refinements.
 Source getSource()
          Returns source information about how the refinement configuration was constructed
 int hashCode()
          Returns a hash code that is the concatenation of the hashes of the child refinements
protected  void mergeRefinements(Refinements pRefinements, int pRefineMin, int pRefineTop)
          Maps refinements by type and name to the index in the list of refinements.
 void setDebugString(java.lang.String ds)
          Sets the debug string
 void setMapping(java.lang.String mapping)
          Sets the refinement mapping
 void setName(java.lang.String pName)
          Sets the refinement configuration name
 void setRefinements(Refinement[] refinements)
          Appends a set of Refinements to this Refinements object.
 void setRefinementsList(java.util.ArrayList<Refinement> refinementList)
          Replaces the list of mRefinements
 void setSelectConfig(SelectConfig pSelectConfig)
          Sets the select config.
 void setSource(Source pSource)
          Sets source information about how the refinement configuration was constructed
 
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 java.lang.String CLASS_VERSION
Class version string

Constructor Detail

Refinements

public Refinements()
Method Detail

equals

public boolean equals(java.lang.Object pObject)
Overrides:
equals in class java.lang.Object

getSize

public int getSize()
Return the number of Refinements.

Returns:
number of individual Refinements available

getRefinements

public Refinement[] getRefinements()
Returns array of refinements

Returns:
array of refinements

setRefinements

public void setRefinements(Refinement[] refinements)
Appends a set of Refinements to this Refinements object.

Parameters:
refinements - array of Refinements to add

getRefinement

public Refinement getRefinement(int index)
                         throws java.lang.IndexOutOfBoundsException
Get a single Refinement.

Parameters:
index - which Refinement
Returns:
Refinement object
Throws:
java.lang.IndexOutOfBoundsException
See Also:
setRefinements(atg.search.routing.command.search.Refinement[])

getRefinementsList

public java.util.ArrayList<Refinement> getRefinementsList()
Get a list of Refinements.

Returns:
ArrayList of refinement objects

setRefinementsList

public void setRefinementsList(java.util.ArrayList<Refinement> refinementList)
Replaces the list of mRefinements

Parameters:
refinementList - the list of refinements

getRequestTag

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

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

hashCode

public int hashCode()
Returns a hash code that is the concatenation of the hashes of the child refinements

Overrides:
hashCode in class java.lang.Object

getDebugString

public java.lang.String getDebugString()
Returns the debug string

Returns:
the debug string

setDebugString

public void setDebugString(java.lang.String ds)
Sets the debug string

Parameters:
ds - the debug string

getMapping

public java.lang.String getMapping()
Returns the refinement mapping

Returns:
the refinement mapping

setMapping

public void setMapping(java.lang.String mapping)
Sets the refinement mapping

Parameters:
mapping - the refinement mapping

getName

public java.lang.String getName()
Returns the refinement configuration name

Returns:
the refinement configuration name

setName

public void setName(java.lang.String pName)
Sets the refinement configuration name

Parameters:
pName - the refinement configuration name

setSelectConfig

public void setSelectConfig(SelectConfig pSelectConfig)
Sets the select config. If refineDebug is true, and $map is passed as the refineConfig, this element shows what configurations were considered and the one that was selected.

Parameters:
pSelectConfig - the select config

getSelectConfig

public SelectConfig getSelectConfig()
If refineDebug is true, and $map is passed as the refineConfig, this element shows what configurations were considered and the one that was selected

Returns:
select config

setSource

public void setSource(Source pSource)
Sets source information about how the refinement configuration was constructed

Parameters:
pSource - source information about how the refinement configuration was constructed

getSource

public Source getSource()
Returns source information about how the refinement configuration was constructed

Returns:
Source information about how the refinement configuration was constructed

getIntFromType

protected static int getIntFromType(atg.search.routing.command.search.RefinementType pType,
                                    boolean pIsRange)

compareValueTo

protected static int compareValueTo(int pType,
                                    RefinementValue pLeft,
                                    RefinementValue pRight)

mergeRefinements

protected void mergeRefinements(Refinements pRefinements,
                                int pRefineMin,
                                int pRefineTop)
Maps refinements by type and name to the index in the list of refinements. For example, <string name="heelHeight.displayName"...> would map to whatever its index is in getRefinementsList().

Parameters:
pRefinements -
pRefineMin - minimum count for a refinement value to be included
pRefineTop - top-number of refinement values to return after sorting