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, documentFrequency, explicitSignificance, significance, uniqueID -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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 voidappendHeadingString(StringBuilder buffer) Int items uses a empty heading instead of "INT "asWord()Returns this as a wordItemprotected voidencodeThis(ByteBuffer buffer) booleanReturns whether this item is of the same class and contains the same state as the given item.static IntItemCreates an int item from arguments.protected StringReturns the number for encoding; the number expression as-is.final LimitReturns the lower limit of this range, which may be negative infinityfinal intReturns 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 rangeintReturns how many phrase words does this item containReturns the raw form of the text leading to this term, exactly as received, including original casingfinal LimitReturns the upper limit of this range, which may be positive infinityinthashCode()booleanbooleanisWords()Returns whether this item represents normal textfinal voidsetHitLimit(int hitLimit) Sets the number of hits this will match, or 0 if all should be matched.voidSets the number expression of this - a number or range following the syntax specified in the class javadocvoidSame 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, isLowercased, isNormalizable, setFromQuery, setLowercased, setNormalizable, setOrigin, setSegmentingRuleMethods inherited from class com.yahoo.prelude.query.SimpleIndexedItem
appendIndexString, getFieldName, getIndexName, setIndexNameMethods inherited from class com.yahoo.prelude.query.SimpleTaggableItem
getConnectedItem, getConnectivity, getDocumentFrequency, getSignificance, getUniqueID, hasExplicitSignificance, hasUniqueID, setConnectivity, setDocumentFrequency, setExplicitSignificance, setSignificance, setUniqueIDMethods inherited from class com.yahoo.prelude.query.Item
addAnnotation, clone, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, hasPrefixMatchSemantics, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, shouldParenthesize, toString, usePositionDataMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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
-
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 tofromare returned, and if this number is negative the hits closest totoare 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 tofromare returned, and if this number is negative the hits closest totoare returned.- Parameters:
hitLimit- number of hits to match for this operator
-
asWord
Returns this as a wordItem -
getRawWord
Description copied from class:TermItemReturns the raw form of the text leading to this term, exactly as received, including original casing- Specified by:
getRawWordin interfaceBlockItem- Specified by:
getRawWordin classTermItem
-
getItemType
Description copied from class:ItemReturn the enumerated type of this item.- Specified by:
getItemTypein classItem
-
getName
Description copied from class:ItemReturns the name of this item -
stringValue
Description copied from interface:BlockItemReturns 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:
appendHeadingStringin classItem
-
hashCode
public int hashCode() -
equals
Description copied from class:ItemReturns 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:IndexedItemReturn the searchable term contents of this item.- Specified by:
getIndexedStringin interfaceIndexedItem- Specified by:
getIndexedStringin classSimpleIndexedItem- Returns:
- a string representation of what is presumably stored in an index which will match this item
-
encodeThis
- Overrides:
encodeThisin classSimpleIndexedItem
-
getNumWords
public int getNumWords()Description copied from interface:HasIndexItemReturns how many phrase words does this item contain -
isStemmed
public boolean isStemmed() -
isWords
public boolean isWords()Description copied from interface:BlockItemReturns whether this item represents normal text -
from
Creates an int item from arguments. This will return an instance of the RankItem subclass if eitherhitLimitor bothfromandtois 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
-