Package com.yahoo.prelude.query
Class Limit
- java.lang.Object
-
- com.yahoo.prelude.query.Limit
-
public class Limit extends java.lang.Object
An immutable numeric range limit which can be inclusive or exclusive- Author:
- bratseth
-
-
Field Summary
Fields Modifier and Type Field Description static Limit
NEGATIVE_INFINITY
static Limit
POSITIVE_INFINITY
-
Constructor Summary
Constructors Constructor Description Limit(java.lang.Number number, boolean inclusive)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
hashCode()
boolean
isInclusive()
Returns true if this limit includes its number, false if it excludes itboolean
isInfinite()
boolean
isLargerOrEqualTo(Limit other)
boolean
isSmallerOrEqualTo(Limit other)
Limit
max(Limit other)
Returns the larger of this and the given limitLimit
min(Limit other)
Returns the smaller of this and the given limitjava.lang.Number
number()
java.lang.String
toString()
-
-
-
Method Detail
-
number
public java.lang.Number number()
-
isInclusive
public boolean isInclusive()
Returns true if this limit includes its number, false if it excludes it
-
isSmallerOrEqualTo
public boolean isSmallerOrEqualTo(Limit other)
-
isLargerOrEqualTo
public boolean isLargerOrEqualTo(Limit other)
-
isInfinite
public boolean isInfinite()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-