atg.search.routing.command.search
Class SpellingTerm

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

public class SpellingTerm
extends atg.search.routing.command.SearchXMLObject

Spelling term value object.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  int mLength
           
protected  int mOffset
           
protected  java.util.List<Suggestion> mSuggestions
           
protected  java.lang.String mText
           
 
Constructor Summary
SpellingTerm()
           
 
Method Summary
 boolean equals(java.lang.Object pObject)
           
protected  void getAttributeXML(java.lang.StringBuilder sb)
           
protected  void getBodyXML(java.lang.StringBuilder sb)
           
 int getLength()
          Get term length used in the initial query.
 int getOffset()
          Get term offset in the initial query.
 java.lang.String getRequestTag()
           
 java.util.List<Suggestion> getSuggestions()
          Get spell checker suggestions as a List of Strings.
 java.lang.String getText()
          Get spell checker initial text.
static boolean isAlternateTermUsed(java.lang.String pSuggestion)
          Indicates whether the term is an alternate term
protected static boolean isFlag(java.lang.String pSuggestion)
          Helper method for parsing that returns true when the suggestions starts with an underscore '_'
static boolean isUnknown(java.lang.String pSuggestion)
          Indicates whether the term is an unknown
static boolean isUnsearchable(java.lang.String pSuggestion)
          Indicates whether the term is searchable
 void setLength(int pLength)
          Sets the length
 void setOffset(int pOffset)
          Sets the offset
 void setSuggestions(java.util.List<Suggestion> pSuggestions)
          Sets the List of String suggestions
 void setText(java.lang.String pText)
          Sets the text
 
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, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mOffset

protected int mOffset

mLength

protected int mLength

mSuggestions

protected java.util.List<Suggestion> mSuggestions

mText

protected java.lang.String mText
Constructor Detail

SpellingTerm

public SpellingTerm()
Method Detail

equals

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

isFlag

protected static boolean isFlag(java.lang.String pSuggestion)
Helper method for parsing that returns true when the suggestions starts with an underscore '_'

Parameters:
pSuggestion -
Returns:
true if the suggestion is one of the flags (starts with an underscore)

isUnknown

public static boolean isUnknown(java.lang.String pSuggestion)
Indicates whether the term is an unknown

Parameters:
pSuggestion - one of the spelling term suggestions. See getSuggestions()
Returns:
true if it is an unknown

isUnsearchable

public static boolean isUnsearchable(java.lang.String pSuggestion)
Indicates whether the term is searchable

Parameters:
pSuggestion - one of the spelling term suggestions. See getSuggestions()
Returns:
true if it is unsearchable

isAlternateTermUsed

public static boolean isAlternateTermUsed(java.lang.String pSuggestion)
Indicates whether the term is an alternate term

Parameters:
pSuggestion - one of the spelling term suggestions. See getSuggestions()
Returns:
true if it is an alternate term

getSuggestions

public java.util.List<Suggestion> getSuggestions()
Get spell checker suggestions as a List of Strings. This List will not be null.

Returns:
List of String suggestions. See isUnknown(String), isUnsearchable(String), and isAlternateTermUsed(String)

getText

public java.lang.String getText()
Get spell checker initial text.

Returns:
suggestion string.

getOffset

public int getOffset()
Get term offset in the initial query.

Returns:
term offset.

getLength

public int getLength()
Get term length used in the initial query.

Returns:
term length.

setOffset

public void setOffset(int pOffset)
Sets the offset

Parameters:
pOffset - the offset

setLength

public void setLength(int pLength)
Sets the length

Parameters:
pLength - the length

setSuggestions

public void setSuggestions(java.util.List<Suggestion> pSuggestions)
Sets the List of String suggestions

Parameters:
pSuggestions - List of String suggestions

setText

public void setText(java.lang.String pText)
Sets the text

Parameters:
pText - the text

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