public class BoundedRangePredicate extends AbstractIndexAwarePredicate implements RangePredicate
Instances of this class are never transferred between members, the serialization is disabled.
Constructor and Description |
---|
BoundedRangePredicate(String attribute,
Comparable from,
boolean fromInclusive,
Comparable to,
boolean toInclusive)
Creates a new instance of bounded range predicate.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
applyForSingleAttributeValue(Comparable value) |
Set<QueryableEntry> |
filter(QueryContext queryContext)
Produces a filtered entry set by utilizing the indexes available while
executing the query in the given query context.
|
String |
getAttribute() |
Comparable |
getFrom() |
int |
getId()
Returns type identifier for this class.
|
Comparable |
getTo() |
boolean |
isFromInclusive() |
boolean |
isToInclusive() |
String |
toString() |
getIndex, isIndexed, matchIndex
apply, canEqual, convert, equals, getFactoryId, hashCode, readData, writeData
public BoundedRangePredicate(String attribute, Comparable from, boolean fromInclusive, Comparable to, boolean toInclusive)
attribute
- the attribute to act on.from
- the lower/left range bound.fromInclusive
- true
if the range is left-closed,
false
otherwise.to
- the upper/right range bound.toInclusive
- true
if the range is right-closed,
false
otherwise.public Set<QueryableEntry> filter(QueryContext queryContext)
IndexAwarePredicate
The query engine assumes this method produces the result set faster than a simple evaluation of the predicate on every entry.
filter
in interface IndexAwarePredicate
queryContext
- the query context to access the indexes. The passed
query context is valid only for a duration of a single
call to the method.protected boolean applyForSingleAttributeValue(Comparable value)
applyForSingleAttributeValue
in class AbstractPredicate
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public String getAttribute()
getAttribute
in interface RangePredicate
public Comparable getFrom()
getFrom
in interface RangePredicate
null
if
the predicate range is left-unbounded.public boolean isFromInclusive()
isFromInclusive
in interface RangePredicate
true
if the predicate range is left-closed, false
otherwise.
Can't be true
if the predicate range is left-unbounded.
public Comparable getTo()
getTo
in interface RangePredicate
null
if
the predicate range is right-unbounded.public boolean isToInclusive()
isToInclusive
in interface RangePredicate
true
if the predicate range is right-closed, false
otherwise.
Can't be true
if the predicate range is right-unbounded.
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.