Package org.apache.pulsar.client.api
Class Range
java.lang.Object
org.apache.pulsar.client.api.Range
- All Implemented Interfaces:
Comparable<Range>
Int range.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
contains
(int value) Check if the value is in the range.boolean
Check if the range is fully contained in the other range.boolean
int
getEnd()
int
getStart()
int
hashCode()
static Range
of
(int start, int end) int
size()
Get the size of the range.toString()
-
Constructor Details
-
Range
public Range(int start, int end)
-
-
Method Details
-
of
-
getStart
public int getStart() -
getEnd
public int getEnd() -
intersect
-
equals
-
hashCode
public int hashCode() -
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Range>
-
contains
public boolean contains(int value) Check if the value is in the range.- Parameters:
value
-- Returns:
- true if the value is in the range.
-
contains
Check if the range is fully contained in the other range.- Parameters:
otherRange
-- Returns:
- true if the range is fully contained in the other range.
-
size
public int size()Get the size of the range.- Returns:
- the size of the range.
-