Interface Ranges<T>
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
Range
Interface for Ranges
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether an instant is within the range boundaries (lower bound is inclusive, upper bound is exclusive)empty()
A range of size 0L starting at this instance start timeend()
boolean
Collection
<? extends Ranges<T>> int
hashCode()
Get the common range between 2 ranges.boolean
isEmpty()
filter range: exclude a range from current range Note: does not support excluding a range that would result in more than one range.Add 2 rangessize()
start()
-
Method Details
-
empty
A range of size 0L starting at this instance start time- Returns:
- empty range
-
plus
Add 2 ranges- Parameters:
right
- right operand- Returns:
- sum of ranges
-
intersect
Get the common range between 2 ranges. No restrictions.- Parameters:
right
- right operand- Returns:
- the common range or the empty range if the ranges do not intersect.
-
size
T size()- Returns:
- range size
-
shift
- Parameters:
offset
- offset to shift- Returns:
- shift start and end by the same positive or negative value
-
end
T end()- Returns:
- end
-
start
T start()- Returns:
- start
-
minus
filter range: exclude a range from current range Note: does not support excluding a range that would result in more than one range.- Parameters:
right
- excluded range- Returns:
- part of this range that does not include
right
-
getRanges
Collection<? extends Ranges<T>> getRanges()- Returns:
- a collection of range objects [ only subclasses of Ranges ]
-
isEmpty
boolean isEmpty()- Returns:
- whether this object is an empty range
-
contains
Whether an instant is within the range boundaries (lower bound is inclusive, upper bound is exclusive)- Parameters:
value
- instant- Returns:
- true if instant time is within range, false otherwise
-
equals
-
hashCode
int hashCode() -
toRangesString
String toRangesString()- Returns:
- string representation of the ranges
-