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
public class BoolItem extends TermItem
A true/false term suitable for searching bool indexes.
-
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendHeadingString(StringBuilder buffer)
Word items uses a empty heading instead of "WORD "protected void
encodeThis(ByteBuffer buffer)
boolean
equals(Object object)
Returns whether this item is of the same class and contains the same state as the given item.String
getIndexedString()
Return the searchable term contents of this item.Item.ItemType
getItemType()
Returns ItemType.WORD as we do not want a string binding from the parsed query to index typesString
getName()
Returns the name of this itemint
getNumWords()
Returns how many phrase words does this item containString
getRawWord()
Returns the same as stringValueint
hashCode()
boolean
isStemmed()
boolean
isWords()
Returns true if this consists of regular word characters.void
setValue(boolean value)
void
setValue(String stringValue)
Sets the value from a stringString
stringValue()
Returns "true" or "false"boolean
value()
-
Methods 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, shouldParenthize, 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
-
-
-
-
Method Detail
-
getItemType
public Item.ItemType getItemType()
Returns ItemType.WORD as we do not want a string binding from the parsed query to index types- Specified by:
getItemType
in classItem
-
encodeThis
protected void encodeThis(ByteBuffer buffer)
- Overrides:
encodeThis
in classSimpleIndexedItem
-
value
public boolean value()
-
stringValue
public String stringValue()
Returns "true" or "false"
-
setValue
public void setValue(boolean value)
-
setValue
public void setValue(String stringValue)
Sets the value from a string- Specified by:
setValue
in classTermItem
- Parameters:
stringValue
- "true" or "false"- Throws:
IllegalArgumentException
- if the given value is not equal to "true" nor "false" (ignoring case)
-
getRawWord
public String getRawWord()
Returns the same as stringValue- Specified by:
getRawWord
in interfaceBlockItem
- Specified by:
getRawWord
in classTermItem
-
isStemmed
public boolean isStemmed()
-
appendHeadingString
protected void appendHeadingString(StringBuilder buffer)
Word items uses a empty heading instead of "WORD "- Overrides:
appendHeadingString
in classItem
-
equals
public boolean equals(Object object)
Description copied from class:Item
Returns 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:HasIndexItem
Returns how many phrase words does this item contain
-
getIndexedString
public String 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
-
-