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,Cloneable
- Direct Known Subclasses:
PhraseSegmentItem
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, documentFrequency, explicitSignificance, significance, uniqueID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedIndexedSegmentItem(String rawWord, String current, boolean isFromQuery, boolean stemmed, Substring origin) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendIndexString(StringBuilder buffer) Appends the index prefix if necessaryvoidprotected voidencodeThis(ByteBuffer buffer) Encodes just this item, not its regular subitems, to the given buffer.booleanReturns whether this item is of the same class and contains the same state as the given item.abstract StringReturn the searchable term contents of this item.The name of the index this belongs to, or "" (never null) if not specifiedinthashCode()voidsetIndexName(String index) Sets the name of the index to searchMethods inherited from class com.yahoo.prelude.query.TaggableSegmentItem
getConnectedItem, getConnectivity, getDocumentFrequency, getSignificance, getUniqueID, hasExplicitSignificance, hasUniqueID, setConnectivity, setDocumentFrequency, setExplicitSignificance, setSignificance, setUniqueIDMethods 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, setStemmed, shouldFoldIntoWand, shouldFoldIntoWand, stringValueMethods inherited from class com.yahoo.prelude.query.CompositeItem
acceptsItemsOfType, adding, appendBodyString, encode, encodingArity, ensureNotInSubtree, extractSingleChild, getItem, getItemCount, getItemIndex, getItemIterator, getTermCount, items, setItem, shouldParenthesizeMethods inherited from class com.yahoo.prelude.query.Item
addAnnotation, appendHeadingString, getAnnotation, getBytes, getCode, getCreator, getItemType, getLabel, getLanguage, getName, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, hasPrefixMatchSemantics, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, toString, usePositionDataMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.yahoo.prelude.query.HasIndexItem
getNumWords
-
Constructor Details
-
IndexedSegmentItem
-
-
Method Details
-
getIndexName
The name of the index this belongs to, or "" (never null) if not specified- Specified by:
getIndexNamein interfaceHasIndexItem
-
encodeThis
Description copied from class:CompositeItemEncodes just this item, not its regular subitems, to the given buffer.- Overrides:
encodeThisin classCompositeItem
-
setIndexName
Sets the name of the index to search- Specified by:
setIndexNamein interfaceIndexedItem- Overrides:
setIndexNamein classCompositeItem
-
appendIndexString
Appends the index prefix if necessary -
equals
Description copied from class:CompositeItemReturns whether this item is of the same class and contains the same state as the given item.- Overrides:
equalsin classSegmentItem
-
hashCode
public int hashCode()- Overrides:
hashCodein classSegmentItem
-
getIndexedString
Description copied from interface:IndexedItemReturn the searchable term contents of this item.- Specified by:
getIndexedStringin interfaceIndexedItem- Returns:
- a string representation of what is presumably stored in an index which will match this item
-
disclose
- Overrides:
disclosein classSegmentItem
-