Package com.yahoo.prelude.query
Class BoolItem
java.lang.Object
com.yahoo.prelude.query.Item
com.yahoo.prelude.query.SimpleTaggableItem
com.yahoo.prelude.query.SimpleIndexedItem
com.yahoo.prelude.query.TermItem
com.yahoo.prelude.query.BoolItem
- All Implemented Interfaces:
BlockItem,HasIndexItem,IndexedItem,TaggableItem,Cloneable
A true/false term suitable for searching bool indexes.
- 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendHeadingString(StringBuilder buffer) Word items uses a empty heading instead of "WORD "protected voidencodeThis(ByteBuffer buffer) booleanReturns whether this item is of the same class and contains the same state as the given item.Return the searchable term contents of this item.Returns ItemType.WORD as we do not want a string binding from the parsed query to index typesgetName()Returns the name of this itemintReturns how many phrase words does this item containReturns the same as stringValueinthashCode()booleanbooleanisWords()Returns true if this consists of regular word characters.voidsetValue(boolean value) voidSets the value from a stringReturns "true" or "false"booleanvalue()Methods 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
-
BoolItem
public BoolItem(boolean value) -
BoolItem
-
BoolItem
-
-
Method Details
-
getItemType
Returns ItemType.WORD as we do not want a string binding from the parsed query to index types- Specified by:
getItemTypein classItem
-
getName
Description copied from class:ItemReturns the name of this item -
encodeThis
- Overrides:
encodeThisin classSimpleIndexedItem
-
value
public boolean value() -
stringValue
Returns "true" or "false" -
setValue
public void setValue(boolean value) -
setValue
Sets the value from a string- Specified by:
setValuein classTermItem- Parameters:
stringValue- "true" or "false"- Throws:
IllegalArgumentException- if the given value is not equal to "true" nor "false" (ignoring case)
-
getRawWord
Returns the same as stringValue- Specified by:
getRawWordin interfaceBlockItem- Specified by:
getRawWordin classTermItem
-
isStemmed
public boolean isStemmed() -
appendHeadingString
Word items uses a empty heading instead of "WORD "- 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. -
getNumWords
public int getNumWords()Description copied from interface:HasIndexItemReturns how many phrase words does this item contain -
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
-
isWords
public boolean isWords()Returns true if this consists of regular word characters. Returns false if this represents a "special token"
-