- Type Parameters:
N
- the type of endpointsS
- the type of spans
- All Known Subinterfaces:
Span.MutableSpanSet<N,
,S> ULongSpan.MutableULongSpanSet
,ULongSpan.ULongSpanSet
- All Known Implementing Classes:
Span.DefaultSpanSet
,ULongSpan.DefaultULongSpanSet
public static interface Span.SpanSet<N,S extends Span<N,S>>
An abstract interface for a set of spans
Connected spans in the set are automatically coalesced. For example, the set
[[0..5],[6..10]]
becomes [[0..10]]
.
-
Method Summary
Modifier and TypeMethodDescriptionbound()
Get a span which encloses all spans in the setcomplement
(S s) Iterate over the spans which are absent from the set but enclosed by the given spanboolean
Check if the set contains the given valuedefault boolean
Check if any span in the set encloses the given spanintersecting
(S s) Iterate over all spans in the set that intersect the given spanboolean
intersects
(S s) Check if any span in the set intersects the given spanboolean
isEmpty()
Check if this set has any spansspanContaining
(N n) Get the span containing the given valuespans()
Iterate the spans in this set
-
Method Details
-
isEmpty
boolean isEmpty()Check if this set has any spans- Returns:
- true if empty
-
spans
Iterate the spans in this set- Returns:
- the iterable
-
bound
S bound()Get a span which encloses all spans in the set- Returns:
- the bounding span
-
contains
Check if the set contains the given value- Parameters:
n
- the value- Returns:
- true if contained by any span in the set
-
spanContaining
Get the span containing the given value- Parameters:
n
- the value- Returns:
- the span or null
-
intersecting
Iterate over all spans in the set that intersect the given span- Parameters:
s
- the span- Returns:
- the iterable of spans
-
complement
Iterate over the spans which are absent from the set but enclosed by the given span- Parameters:
s
- the span- Returns:
- the iterable of spans
-
intersects
Check if any span in the set intersects the given span- Parameters:
s
- the span- Returns:
- true if any span in the set intersects it
-
encloses
Check if any span in the set encloses the given span- Parameters:
s
- the span- Returns:
- true if any span in the set encloses it
-