public class QueryTree extends CompositeItem
To ease recursive manipulation of the query tree, this is a composite having one child, which is the actual root.
This is also the home of accessor methods which eases querying into and manipulation of the query tree.
Item.ItemCreator, Item.ItemType
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
Modifier and Type | Method and Description |
---|---|
void |
addItem(int index,
Item item)
Inserts the item at a position and increases the index of existing items
starting on this position by one
|
void |
addItem(Item item) |
protected void |
appendHeadingString(StringBuilder sb)
Appends the heading of this string.
|
QueryTree |
clone()
Returns a deep copy of this
|
int |
encode(ByteBuffer buffer) |
boolean |
equals(Object o)
Returns whether this item is of the same class and
contains the same state as the given item
|
Item.ItemType |
getItemType()
Return the enumerated type of this item.
|
String |
getName()
Returns the name of this item
|
static List<IndexedItem> |
getPositiveTerms(Item item)
Returns a flattened list of all positive query terms under the given item
|
Item |
getRoot()
Returns the query root.
|
boolean |
isEmpty()
Returns true if this represents the null query
|
void |
setIndexName(String index)
Sets the index name of all subitems of this
|
void |
setRoot(Item root) |
adding, appendBodyString, disclose, encodeThis, encodingArity, ensureNotInSubtree, getItem, getItemCount, getItemIndex, getItemIterator, getTermCount, hashCode, isLocked, lock, removeItem, removeItem, setItem, shouldParenthize
addAnnotation, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, 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
public QueryTree(Item root)
public void setIndexName(String index)
CompositeItem
setIndexName
in class CompositeItem
public Item.ItemType getItemType()
Item
getItemType
in class Item
public int encode(ByteBuffer buffer)
encode
in class CompositeItem
protected void appendHeadingString(StringBuilder sb)
Item
appendHeadingString
in class Item
public Item getRoot()
public final void setRoot(Item root)
public boolean equals(Object o)
CompositeItem
equals
in class CompositeItem
public QueryTree clone()
clone
in class CompositeItem
public void addItem(Item item)
addItem
in class CompositeItem
public void addItem(int index, Item item)
CompositeItem
addItem
in class CompositeItem
public boolean isEmpty()
public static List<IndexedItem> getPositiveTerms(Item item)
Copyright © 2018. All rights reserved.