Package com.yahoo.prelude.query
Class NonReducibleCompositeItem
- java.lang.Object
-
- com.yahoo.prelude.query.Item
-
- com.yahoo.prelude.query.CompositeItem
-
- com.yahoo.prelude.query.NonReducibleCompositeItem
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
SameElementItem
,WeakAndItem
public abstract class NonReducibleCompositeItem extends CompositeItem
A composite item which specifies semantics which are not maintained if an instance with a single child is replaced by the single child.Most composites, like AND and OR, are reducible as e.g (AND a) is semantically equal to (a).
This type functions as a marker type for query rewriters.
- 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, explicitSignificance, significance, uniqueID
-
-
Constructor Summary
Constructors Constructor Description NonReducibleCompositeItem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<Item>
extractSingleChild()
Will return its single child if itself can safely be omitted.-
Methods inherited from class com.yahoo.prelude.query.CompositeItem
adding, addItem, addItem, appendBodyString, clone, disclose, encode, encodeThis, encodingArity, ensureNotInSubtree, equals, getItem, getItemCount, getItemIndex, getItemIterator, getTermCount, hashCode, isLocked, items, lock, removeItem, removeItem, setIndexName, 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, hasUniqueID, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, toString, usePositionData
-
-
-
-
Method Detail
-
extractSingleChild
public java.util.Optional<Item> extractSingleChild()
Description copied from class:CompositeItem
Will return its single child if itself can safely be omitted.- Overrides:
extractSingleChild
in classCompositeItem
- Returns:
- a valid Item or empty Optional if it can not be done
-
-