Class PhraseOr
- java.lang.Object
-
- com.attivio.sdk.search.query.phrase.Phrase
-
- com.attivio.sdk.search.query.phrase.PhraseOr
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public final class PhraseOr extends Phrase
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.attivio.sdk.search.query.phrase.Phrase
Phrase.Parameter
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<Phrase>termsList of terms for matching.-
Fields inherited from class com.attivio.sdk.search.query.phrase.Phrase
boost, parameters
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTerm(Phrase term)Addtermto this phrase.voidaddTerm(java.lang.String term)Add aSearchTermto this phrase.voidaddTerms(Phrase[] terms)Addtermsto this phrase.voidaddTerms(Phrase[] terms, int offset, int length)AddvoidaddTerms(java.util.List<Phrase> terms)Addtermsto this phrase.PhraseOrclone()protected Phraseclone(Phrase[] terms, int length)Clone to facilitate rewrite().booleanequals(java.lang.Object other)intgetEndOffset()Get the end offset (0 indexed, exclusive) for this term in the original query string.intgetStartOffset()Get the start offset (0 indexed, inclusive) for this term in the original query string.java.util.List<Phrase>getTerms()Get the terms for this phrase.inthashCode()Phraserewrite(PhraseHandler handler)Recursively rewrite this phrase usinghandler.PhraserewriteChildren(PhraseHandler handler)Rewrite any children of this phrase usinghandler.voidsetTerms(Phrase... args)Set the terms for this phrase.voidsetTerms(java.lang.String... args)Set the terms for this phrase.voidsetTerms(java.util.List<Phrase> value)Set the terms for this phrase.intsize()Get the number of terms in this phrase.voidtoString(java.lang.StringBuilder buffer, boolean compact)Appends the string representation of this query tobuffer.-
Methods inherited from class com.attivio.sdk.search.query.phrase.Phrase
containsParameters, containsParameters, copyParameters, getBoost, getParameter, getParameter, getParameter, getParameter, getParameterInternal, isMatchAll, parameters, parseIntParameter, removeParameter, setBoost, setParameter, setParameters, toArray, toString, toString
-
-
-
-
Field Detail
-
terms
protected java.util.List<Phrase> terms
List of terms for matching.
-
-
Method Detail
-
addTerm
public void addTerm(Phrase term)
Addtermto this phrase.
-
hashCode
public int hashCode()
-
equals
public boolean equals(java.lang.Object other)
-
clone
public PhraseOr clone()
-
toString
public void toString(java.lang.StringBuilder buffer, boolean compact)Appends the string representation of this query tobuffer.
-
getStartOffset
public int getStartOffset()
Description copied from class:PhraseGet the start offset (0 indexed, inclusive) for this term in the original query string.This value is set during parsing and indicates the start offset into the original query string that this term represents. In general, offsets should not be set/modified by query transformers and it is recommended that start and end offsets are set to zero when cloning.
NOTE: if
Phrase.getStartOffset()==Phrase.getEndOffset(), this indicates that the term did not come from a parsed query string.- Specified by:
getStartOffsetin classPhrase
-
getEndOffset
public int getEndOffset()
Description copied from class:PhraseGet the end offset (0 indexed, exclusive) for this term in the original query string.This value is set during parsing and indicates the end offset of the original query string that this term represents. In general, offsets should not be set/modified by query transformers and it is recommended that start and end offsets are set to zero when cloning.
NOTE: if
Phrase.getStartOffset()==Phrase.getEndOffset(), this indicates that the term did not come from a parsed query string.- Specified by:
getEndOffsetin classPhrase
-
size
public int size()
Get the number of terms in this phrase.
-
getTerms
public java.util.List<Phrase> getTerms()
Get the terms for this phrase.
-
setTerms
public void setTerms(java.util.List<Phrase> value)
Set the terms for this phrase.
-
setTerms
public void setTerms(java.lang.String... args)
Set the terms for this phrase.
-
setTerms
public void setTerms(Phrase... args)
Set the terms for this phrase.
-
addTerm
public void addTerm(java.lang.String term)
Add aSearchTermto this phrase.
-
addTerms
public void addTerms(Phrase[] terms)
Addtermsto this phrase.
-
addTerms
public void addTerms(Phrase[] terms, int offset, int length)
Addlength terms from
termsstarting atoffset.
-
addTerms
public void addTerms(java.util.List<Phrase> terms)
Addtermsto this phrase.
-
rewrite
public Phrase rewrite(PhraseHandler handler)
Recursively rewrite this phrase usinghandler.NOTE: If a phrase has any children, the phrase itself will be passed to
handlerfirst, prior to its children. Ifhandlerreturns a new phrase, its children will not be traversed automatically.
-
rewriteChildren
public Phrase rewriteChildren(PhraseHandler handler)
Description copied from class:PhraseRewrite any children of this phrase usinghandler.Returns the modified phrase, which may be
nullif all children were removed byhandler.This method may have no effect if this
Phraserepresents a leaf in the tree.NOTE: child phrases are not recursively traversed.
- Specified by:
rewriteChildrenin classPhrase
-
-