Package com.yahoo.prelude.query
Class IndexedSegmentItem
- java.lang.Object
-
- com.yahoo.prelude.query.Item
-
- com.yahoo.prelude.query.CompositeItem
-
- com.yahoo.prelude.query.SegmentItem
-
- com.yahoo.prelude.query.TaggableSegmentItem
-
- com.yahoo.prelude.query.IndexedSegmentItem
-
- All Implemented Interfaces:
BlockItem
,HasIndexItem
,IndexedItem
,TaggableItem
,java.lang.Cloneable
- Direct Known Subclasses:
PhraseSegmentItem
public abstract class IndexedSegmentItem extends TaggableSegmentItem implements IndexedItem
Common implementation for Item classes implementing the IndexedItem interface. Note that this file exist in 3 copies that should be kept in sync: CompositeIndexedItem.java SimpleIndexedItem.java IndexedSegmentItem.java These should only have trivial differences. (multiple inheritance or mixins would have been nice).- Author:
- arnej27959
-
-
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
Constructors Modifier Constructor Description protected
IndexedSegmentItem(java.lang.String rawWord, java.lang.String current, boolean isFromQuery, boolean stemmed, Substring origin)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
appendIndexString(java.lang.StringBuilder buffer)
Appends the index prefix if necessaryvoid
disclose(com.yahoo.prelude.query.textualrepresentation.Discloser discloser)
protected void
encodeThis(java.nio.ByteBuffer buffer)
Encodes just this item, not it's usual subitems, to the given buffer.boolean
equals(java.lang.Object object)
Returns whether this item is of the same class and contains the same state as the given itemabstract java.lang.String
getIndexedString()
Return the searchable term contents of this item.java.lang.String
getIndexName()
The name of the index this belongs to, or "" (never null) if not specifiedint
hashCode()
void
setIndexName(java.lang.String index)
Sets the name of the index to search-
Methods inherited from class com.yahoo.prelude.query.TaggableSegmentItem
getConnectedItem, getConnectivity, getSignificance, getUniqueID, hasExplicitSignificance, hasUniqueID, setConnectivity, setExplicitSignificance, setSignificance, setUniqueID
-
Methods inherited from class com.yahoo.prelude.query.SegmentItem
addItem, addItem, clone, getNormalized, getNumWords, getOrigin, getRawWord, getSegmentingRule, isFromQuery, isFromUser, isLocked, isStemmed, isWords, lock, removeItem, removeItem, setFromUser, setSegmentingRule, stringValue
-
Methods inherited from class com.yahoo.prelude.query.CompositeItem
adding, appendBodyString, encode, encodingArity, ensureNotInSubtree, extractSingleChild, getItem, getItemCount, getItemIndex, getItemIterator, getTermCount, items, setItem, shouldParenthize
-
Methods inherited from class com.yahoo.prelude.query.Item
addAnnotation, appendHeadingString, getAnnotation, getBytes, getCode, getCreator, getItemType, getLabel, getLanguage, getName, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, 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
getNumWords
-
-
-
-
Constructor Detail
-
IndexedSegmentItem
protected IndexedSegmentItem(java.lang.String rawWord, java.lang.String current, boolean isFromQuery, boolean stemmed, Substring origin)
-
-
Method Detail
-
getIndexName
public java.lang.String getIndexName()
The name of the index this belongs to, or "" (never null) if not specified- Specified by:
getIndexName
in interfaceHasIndexItem
-
encodeThis
protected void encodeThis(java.nio.ByteBuffer buffer)
Description copied from class:CompositeItem
Encodes just this item, not it's usual subitems, to the given buffer.- Overrides:
encodeThis
in classCompositeItem
-
setIndexName
public void setIndexName(java.lang.String index)
Sets the name of the index to search- Specified by:
setIndexName
in interfaceIndexedItem
- Overrides:
setIndexName
in classCompositeItem
-
appendIndexString
protected void appendIndexString(java.lang.StringBuilder buffer)
Appends the index prefix if necessary
-
equals
public boolean equals(java.lang.Object object)
Description copied from class:CompositeItem
Returns whether this item is of the same class and contains the same state as the given item- Overrides:
equals
in classCompositeItem
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classCompositeItem
-
getIndexedString
public abstract java.lang.String getIndexedString()
Description copied from interface:IndexedItem
Return the searchable term contents of this item.- Specified by:
getIndexedString
in interfaceIndexedItem
- Returns:
- a string representation of what is presumably stored in an index which will match this item
-
disclose
public void disclose(com.yahoo.prelude.query.textualrepresentation.Discloser discloser)
- Overrides:
disclose
in classSegmentItem
-
-