Interface KeySpan
- All Superinterfaces:
Comparable<KeySpan>,Span<Long,KeySpan>
- All Known Implementing Classes:
KeySpan.Empty,KeySpan.Impl
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThe domain of keysstatic final classThe singleton empty span of keysstatic final recordA non-empty span of keysNested classes/interfaces inherited from interface generic.Span
Span.DefaultSpanMap<N,S extends Span<N, S>, V>, Span.DefaultSpanSet<N, S extends Span<N, S>>, Span.MutableSpanMap<N, S extends Span<N, S>, V>, Span.MutableSpanSet<N, S extends Span<N, S>>, Span.SpanMap<N, S extends Span<N, S>, V>, Span.SpanMapSetter<E, N, S extends Span<N, S>, V>, Span.SpanSet<N, S extends Span<N, S>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final KeySpan.Implstatic final KeySpan.Domainstatic final KeySpan.Empty -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic KeySpanclosed(long from, long to) Get the span for a closed intervalstatic KeySpanhead(long to, boolean toInclusive, DirectedIterator.Direction direction) Get the span for the head of a collectionstatic KeySpansub(long from, boolean fromInclusive, long to, boolean toInclusive, DirectedIterator.Direction direction) Get the span for a sub collectionstatic KeySpantail(long from, boolean fromInclusive, DirectedIterator.Direction direction) Get the span for the tail of a collectionMethods inherited from interface generic.Span
bound, compareTo, contains, domain, encloses, intersect, intersects, isEmpty, max, maxIsFinite, min, minIsFinite, subtract, toString
-
Field Details
-
DOMAIN
-
EMPTY
-
ALL
-
-
Method Details
-
sub
static KeySpan sub(long from, boolean fromInclusive, long to, boolean toInclusive, DirectedIterator.Direction direction) Get the span for a sub collectionfrommust precedeto, unless direction isDirectedIterator.Direction.BACKWARD, in which case the opposite is required. The endpoints may be equal but unless both are inclusive, the result isEMPTY. The two endpoints are not automatically inverted to correct ordering. More often than not, accidental mis-ordering indicates an implementation flaw.- Parameters:
from- the lower boundfromInclusive- true if the bound includesfromto- the upper boundtoInclusive- true if the bound includestodirection- the direction, true to swapfromandto- Returns:
- the span
-
head
Get the span for the head of a collectionWhen
directionisDirectedIterator.Direction.BACKWARDthis behaves as if a tail collection; however, the implication is that iteration will start from the maximum and proceed toward the given bound.- Parameters:
to- the upper boundtoInclusive- true if the bound includestodirection- the direction, true to create a tail instead- Returns:
- the span
-
tail
Get the span for the tail of a collectionWhen
directionisDirectedIterator.Direction.BACKWARDthis behaves as if a head collection; however, the implication is that iteration will start from the bound and proceed toward the minimum.- Parameters:
from- the lower boundfromInclusive- true if the bound includestodirection- the direction, true to create a head instead- Returns:
- the span
-
closed
Get the span for a closed interval- Parameters:
from- the lower endpointto- the upper endpoint- Returns:
- the interval
- Implementation Notes:
- this is used primarily in testing
-