Package com.yahoo.prelude.query
Class IntItem
- All Implemented Interfaces:
BlockItem
,HasIndexItem
,IndexedItem
,TaggableItem
,Cloneable
- Direct Known Subclasses:
RangeItem
This represents either
- a number (integer or floating point)
- a partial range, given by "<number" or ">number", where the numbers are exclusive, or
- a full or open range "[number;number], "[number;]" or "[;number]" where the numbers are inclusive, or exclusive if a square bracket is replaced with a pointy one
- Author:
- bratseth
-
Nested Class Summary
Nested classes/interfaces inherited from class com.yahoo.prelude.query.Item
Item.ItemCreator, Item.ItemType
-
Field Summary
Fields inherited from class com.yahoo.prelude.query.Item
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
-
Constructor Summary
ConstructorDescriptionCreates an int item which must be equal to the given int number - that is both the lower and upper limit is this numberCreates an int item which must be equal to the given long number - that is both the lower and upper limit is this number -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendHeadingString
(StringBuilder buffer) Int items uses a empty heading instead of "INT "protected void
encodeThis
(ByteBuffer buffer) boolean
Returns whether this item is of the same class and contains the same state as the given item.static IntItem
Creates an int item from arguments.protected String
Returns the number for encoding; the number expression as-is.final Limit
Returns the lower limit of this range, which may be negative infinityfinal int
Returns the number of hits this will match, or 0 if all should be matched.Return the searchable term contents of this item.Return the enumerated type of this item.getName()
Returns the name of this itemSets the number expression of this - a number or rangeint
Returns how many phrase words does this item containReturns the raw form of the text leading to this term, exactly as received, including original casingfinal Limit
Returns the upper limit of this range, which may be positive infinityint
hashCode()
boolean
boolean
isWords()
Returns whether this item represents normal textfinal void
setHitLimit
(int hitLimit) Sets the number of hits this will match, or 0 if all should be matched.void
Sets the number expression of this - a number or range following the syntax specified in the class javadocvoid
Same assetNumber(java.lang.String)
Returns the value of this term as a stringMethods inherited from class com.yahoo.prelude.query.TermItem
appendBodyString, disclose, encode, getOrigin, getSegmentingRule, getTermCount, isFromQuery, isNormalizable, setFromQuery, setNormalizable, setOrigin, setSegmentingRule
Methods inherited from class com.yahoo.prelude.query.SimpleIndexedItem
appendIndexString, getIndexName, setIndexName
Methods inherited from class com.yahoo.prelude.query.SimpleTaggableItem
getConnectedItem, getConnectivity, getSignificance, getUniqueID, hasExplicitSignificance, hasUniqueID, setConnectivity, setExplicitSignificance, setSignificance, setUniqueID
Methods inherited from class com.yahoo.prelude.query.Item
addAnnotation, clone, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, shouldParenthesize, toString, usePositionData
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.yahoo.prelude.query.HasIndexItem
getIndexName
-
Constructor Details
-
IntItem
Creates an int item which must be equal to the given int number - that is both the lower and upper limit is this number -
IntItem
Creates an int item which must be equal to the given long number - that is both the lower and upper limit is this number -
IntItem
-
IntItem
-
IntItem
-
IntItem
-
IntItem
-
IntItem
-
-
Method Details
-
setNumber
Sets the number expression of this - a number or range following the syntax specified in the class javadoc -
getNumber
Sets the number expression of this - a number or range -
getFromLimit
Returns the lower limit of this range, which may be negative infinity -
getToLimit
Returns the upper limit of this range, which may be positive infinity -
getHitLimit
public final int getHitLimit()Returns the number of hits this will match, or 0 if all should be matched. If this number is positive, the hits closest tofrom
are returned, and if this number is negative the hits closest toto
are returned. -
setHitLimit
public final void setHitLimit(int hitLimit) Sets the number of hits this will match, or 0 if all should be matched. If this number is positive, the hits closest tofrom
are returned, and if this number is negative the hits closest toto
are returned.- Parameters:
hitLimit
- number of hits to match for this operator
-
getRawWord
Description copied from class:TermItem
Returns the raw form of the text leading to this term, exactly as received, including original casing- Specified by:
getRawWord
in interfaceBlockItem
- Specified by:
getRawWord
in classTermItem
-
getItemType
Description copied from class:Item
Return the enumerated type of this item.- Specified by:
getItemType
in classItem
-
getName
Description copied from class:Item
Returns the name of this item -
stringValue
Description copied from interface:BlockItem
Returns the value of this term as a string -
setValue
Same assetNumber(java.lang.String)
-
appendHeadingString
Int items uses a empty heading instead of "INT "- Overrides:
appendHeadingString
in classItem
-
hashCode
public int hashCode() -
equals
Description copied from class:Item
Returns whether this item is of the same class and contains the same state as the given item. -
getEncodedInt
Returns the number for encoding; the number expression as-is. -
getIndexedString
Description copied from interface:IndexedItem
Return the searchable term contents of this item.- Specified by:
getIndexedString
in interfaceIndexedItem
- Specified by:
getIndexedString
in classSimpleIndexedItem
- Returns:
- a string representation of what is presumably stored in an index which will match this item
-
encodeThis
- Overrides:
encodeThis
in classSimpleIndexedItem
-
getNumWords
public int getNumWords()Description copied from interface:HasIndexItem
Returns how many phrase words does this item contain -
isStemmed
public boolean isStemmed() -
isWords
public boolean isWords()Description copied from interface:BlockItem
Returns whether this item represents normal text -
from
Creates an int item from arguments. This will return an instance of the RankItem subclass if eitherhitLimit
or bothfrom
andto
is set to a value other than defaults (respectively 0, double negative and positive infinity). And different from each other.- Parameters:
indexName
- the index this searchesfrom
- the lower limit (inclusive) on hitsto
- the higher limit (inclusive) on hitshitLimit
- the number of hits to match, or 0 to return all
-