Class PhraseTerm
- java.lang.Object
-
- com.attivio.sdk.search.query.phrase.Phrase
-
- com.attivio.sdk.search.query.phrase.PhraseTerm
-
- All Implemented Interfaces:
TokenAnnotationSet,java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
FuzzyTerm,RegexTerm,SearchTerm,TermRange,WildcardTerm
public abstract class PhraseTerm extends Phrase implements TokenAnnotationSet
Represents an atomic term in a 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 longannotationsArbitrary token annotations.protected intendOffsetprotected intstartOffset-
Fields inherited from class com.attivio.sdk.search.query.phrase.Phrase
boost, parameters
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPhraseTerm()Constructor.protectedPhraseTerm(PhraseTerm base)Constructor.protectedPhraseTerm(TokenAnnotation annotation)Constructor.protectedPhraseTerm(TokenAnnotation... annotation)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsAnnotation(TokenAnnotation value)Returns true if the specified annotation is set.booleancontainsParameters(boolean compact)Does this phrase operand contain any parameters in a non-default state.booleanequals(java.lang.Object other)longgetAnnotations()Get all set token annotations as a bit mask.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.inthashCode()intoffsetGap(PhraseTerm previous)Get the offset gap betweenpreviousand this term.PhraserewriteChildren(PhraseHandler handler)Rewrite any children of this phrase usinghandler.voidsetAnnotation(TokenAnnotation value)Set a TokenAnnotation.voidsetAnnotations(long value)Set the token annotations from a bit mask.voidsetEndOffset(int value)Set the end offset (0 indexed, exclusive) for this term in the original query string.voidsetParameter(java.lang.String name, java.lang.Object value)Set parameternametovalue.voidsetStartOffset(int value)Set the start offset (0 indexed, inclusive) for this term in the original query string.voidunsetAnnotation(TokenAnnotation value)Unset a TokenAnnotation.-
Methods inherited from class com.attivio.sdk.search.query.phrase.Phrase
clone, containsParameters, copyParameters, getBoost, getParameter, getParameter, getParameter, getParameter, getParameterInternal, isMatchAll, parameters, parseIntParameter, removeParameter, rewrite, setBoost, setParameters, toArray, toString, toString, toString
-
-
-
-
Constructor Detail
-
PhraseTerm
protected PhraseTerm()
Constructor.
-
PhraseTerm
protected PhraseTerm(TokenAnnotation annotation)
Constructor.
-
PhraseTerm
protected PhraseTerm(TokenAnnotation... annotation)
Constructor.
-
PhraseTerm
protected PhraseTerm(PhraseTerm base)
Constructor.
-
-
Method Detail
-
setParameter
public void setParameter(java.lang.String name, java.lang.Object value)Description copied from class:PhraseSet parameternametovalue.NOTE:
nameis case insensitive.- Overrides:
setParameterin classPhrase
-
getStartOffset
public int getStartOffset()
Get 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
-
setStartOffset
public void setStartOffset(int value)
Set the start offset (0 indexed, inclusive) for this term in the original query string.
-
getEndOffset
public int getEndOffset()
Get 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
-
setEndOffset
public void setEndOffset(int value)
Set the end offset (0 indexed, exclusive) for this term in the original query string.
-
getAnnotations
public long getAnnotations()
Get all set token annotations as a bit mask.- Specified by:
getAnnotationsin interfaceTokenAnnotationSet
-
setAnnotations
public void setAnnotations(long value)
Set the token annotations from a bit mask.- Specified by:
setAnnotationsin interfaceTokenAnnotationSet
-
setAnnotation
public void setAnnotation(TokenAnnotation value)
Set a TokenAnnotation.- Specified by:
setAnnotationin interfaceTokenAnnotationSet
-
containsAnnotation
public boolean containsAnnotation(TokenAnnotation value)
Returns true if the specified annotation is set.- Specified by:
containsAnnotationin interfaceTokenAnnotationSet
-
unsetAnnotation
public void unsetAnnotation(TokenAnnotation value)
Unset a TokenAnnotation.- Specified by:
unsetAnnotationin interfaceTokenAnnotationSet
-
offsetGap
public int offsetGap(PhraseTerm previous)
Get the offset gap betweenpreviousand this term.NOTE: if this term or the
previousterm do not contain offsets,1is returned.NOTE: Returns
0ifpreviousisnull.
-
containsParameters
public boolean containsParameters(boolean compact)
Does this phrase operand contain any parameters in a non-default state.If
compactistruethis will only return true if at least one parameter in the compact representation of this phrase exists.- Overrides:
containsParametersin classPhrase
-
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
-
-