public class NearItem extends CompositeItem
A set of terms which must be near each other to match.
Item.ItemCreator, Item.ItemType
Modifier and Type | Field and Description |
---|---|
static int |
defaultDistance
The default distance used if none is specified: 2
|
protected int |
distance |
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
Constructor and Description |
---|
NearItem()
Creates a NEAR item with distance 2
|
NearItem(int distance)
Creates a near item with a limit to the distance
between the words.
|
Modifier and Type | Method and Description |
---|---|
protected void |
appendHeadingString(StringBuilder buffer)
Appends the heading of this string -
[getName()]([limit]) |
void |
disclose(Discloser discloser) |
protected void |
encodeThis(ByteBuffer buffer)
Encodes just this item, not it's usual subitems, to the given buffer.
|
boolean |
equals(Object object)
Returns whether this item is of the same class and
contains the same state as the given item
|
int |
getDistance() |
Item.ItemType |
getItemType()
Return the enumerated type of this item.
|
String |
getName()
Returns the name of this item
|
int |
hashCode() |
void |
setDistance(int distance) |
adding, addItem, addItem, appendBodyString, clone, encode, encodingArity, ensureNotInSubtree, getItem, getItemCount, getItemIndex, getItemIterator, getTermCount, insertNullFirstItem, isLocked, lock, removeItem, removeItem, setIndexName, 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
protected int distance
public static final int defaultDistance
public NearItem()
public NearItem(int distance)
distance
- the number of word position which may separate
the words for this near item to matchpublic void setDistance(int distance)
public int getDistance()
public Item.ItemType getItemType()
Item
getItemType
in class Item
protected void encodeThis(ByteBuffer buffer)
CompositeItem
encodeThis
in class CompositeItem
public void disclose(Discloser discloser)
disclose
in class CompositeItem
protected void appendHeadingString(StringBuilder buffer)
[getName()]([limit])
appendHeadingString
in class Item
public int hashCode()
hashCode
in class CompositeItem
public boolean equals(Object object)
equals
in class CompositeItem
Copyright © 2018. All rights reserved.