public class IntItem extends TermItem
Item.ItemCreator, Item.ItemType
Modifier and Type | Field and Description |
---|---|
private String |
expression
The number expression of this
|
private Limit |
from
The inclusive lower end of this range
|
private int |
hitLimit |
private Limit |
to
The inclusive upper end of this range
|
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
Constructor and Description |
---|
IntItem(int number,
String indexName)
Creates an int item which must be equal to the given int number -
that is both the lower and upper limit is this number
|
IntItem(Limit from,
Limit to,
int hitLimit,
String indexName,
boolean isFromQuery) |
IntItem(Limit from,
Limit to,
String indexName) |
IntItem(long number,
String indexName)
Creates an int item which must be equal to the given long number -
that is both the lower and upper limit is this number
|
IntItem(String expression) |
IntItem(String expression,
boolean isFromQuery) |
IntItem(String expression,
String indexName) |
IntItem(String expression,
String indexName,
boolean isFromQuery) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendHeadingString(StringBuilder buffer)
Int items uses a empty heading instead of "INT "
|
private Number |
asNumber(String numberString) |
protected void |
encodeThis(ByteBuffer buffer) |
boolean |
equals(Object object)
Returns whether this item is of the same class and
contains the same state as the given item
|
static IntItem |
from(String indexName,
Limit from,
Limit to,
int hitLimit)
Creates an int item from arguments.
|
protected String |
getEncodedInt()
Returns the number for encoding; the number expression as-is.
|
Limit |
getFromLimit()
Returns the lower limit of this range, which may be negative infinity
|
int |
getHitLimit()
Returns the number of hits this will match, or 0 if all should be matched.
|
String |
getIndexedString()
Return the searchable term contents of this item.
|
Item.ItemType |
getItemType()
Return the enumerated type of this item.
|
String |
getName()
Returns the name of this item
|
String |
getNumber()
Sets the number expression of this - a number or range
|
int |
getNumWords() |
private Number |
getOr(Number defaultValue,
int valueIndex,
String[] values) |
String |
getRawWord()
Returns the raw form of the text leading to this term, exactly as received, including original casing
|
Limit |
getToLimit()
Returns the upper limit of this range, which may be positive infinity
|
int |
hashCode() |
boolean |
isStemmed() |
boolean |
isWords()
Does this item represent "usual words"?
|
private void |
parseAndAssignLimits(String e) |
void |
setHitLimit(int hitLimit)
Sets the number of hits this will match, or 0 if all should be
matched.
|
private void |
setLimits(Limit from,
Limit to)
Sets limit and flip them if "from" is greater than "to"
|
void |
setNumber(String expression)
Sets the number expression of this - a number or range following the syntax specified in the class javadoc
|
void |
setValue(String value)
Same as
setNumber(java.lang.String) |
String |
stringValue()
Returns the value of this term as a string
|
private String |
toExpression(Limit from,
Limit to,
int hitLimit)
Returns the simplest expression matching this
|
appendBodyString, disclose, encode, getOrigin, getSegmentingRule, getTermCount, isFromQuery, isNormalizable, setNormalizable, setOrigin, setSegmentingRule
appendIndexString, getIndexName, setIndexName
getConnectedItem, getConnectivity, getSignificance, getUniqueID, hasExplicitSignificance, hasUniqueID, setConnectivity, setExplicitSignificance, setSignificance, setUniqueID
addAnnotation, clone, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, shouldParenthize, toString, usePositionData
finalize, getClass, notify, notifyAll, wait, wait, wait
getIndexName
private Limit from
private Limit to
private int hitLimit
private String expression
public IntItem(int number, String indexName)
public IntItem(long number, String indexName)
public IntItem(String expression)
public IntItem(String expression, boolean isFromQuery)
private String toExpression(Limit from, Limit to, int hitLimit)
private final void setLimits(Limit from, Limit to)
public void setNumber(String expression)
private void parseAndAssignLimits(String e)
public String getNumber()
public final Limit getFromLimit()
public final Limit getToLimit()
public final int getHitLimit()
from
are returned, and if
this number is negative the hits closest to to
are returned.public final void setHitLimit(int hitLimit)
from
are returned, and if this number is negative the hits
closest to to
are returned.hitLimit
- number of hits to match for this operatorpublic String getRawWord()
TermItem
getRawWord
in interface BlockItem
getRawWord
in class TermItem
public Item.ItemType getItemType()
Item
getItemType
in class Item
public String stringValue()
BlockItem
public void setValue(String value)
setNumber(java.lang.String)
protected void appendHeadingString(StringBuilder buffer)
appendHeadingString
in class Item
public int hashCode()
hashCode
in class SimpleIndexedItem
public boolean equals(Object object)
Item
equals
in class SimpleIndexedItem
protected String getEncodedInt()
public String getIndexedString()
IndexedItem
getIndexedString
in interface IndexedItem
getIndexedString
in class SimpleIndexedItem
protected void encodeThis(ByteBuffer buffer)
encodeThis
in class SimpleIndexedItem
public int getNumWords()
public boolean isStemmed()
public boolean isWords()
BlockItem
public static IntItem from(String indexName, Limit from, Limit to, int hitLimit)
hitLimit
or both from
and to
is set to a value other than defaults (respectively 0, double negative and positive infinity).
And different from each other.indexName
- the index this searchesfrom
- the lower limit (inclusive) on hitsto
- the higher limit (inclusive) on hitshitLimit
- the number of hits to match, or 0 to return allCopyright © 2018. All rights reserved.