java.lang.Object
generic.Span.DefaultSpanSet<N,S>
- Type Parameters:
N
- the type of endpointsS
- the type of values
- All Implemented Interfaces:
Span.MutableSpanSet<N,
,S> Span.SpanSet<N,
S>
- Direct Known Subclasses:
ULongSpan.DefaultULongSpanSet
public static class Span.DefaultSpanSet<N,S extends Span<N,S>>
extends Object
implements Span.MutableSpanSet<N,S>
The default implementation of
Span.SpanSet
and Span.MutableSpanSet
using an interval
tree-
Constructor Summary
ConstructorDescriptionDefaultSpanSet
(Span.Domain<N, S> domain) Create a span set on the given domain -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a span to the setvoid
addAll
(Span.SpanSet<N, S> set) Add all spans from the given set into this onebound()
Get a span which encloses all spans in the setvoid
clear()
Remove all spans from the setboolean
Check if the set contains the given valueboolean
intersecting
(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 spansprotected Span.MutableSpanMap
<N, S, Boolean> newSpanMap
(Span.Domain<N, S> domain) Factory method for the span map backing this span setvoid
Remove a span from the setspanContaining
(N n) Get the span containing the given valuespans()
Iterate the spans in this settoString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface generic.Span.SpanSet
complement, encloses
-
Constructor Details
-
DefaultSpanSet
Create a span set on the given domainExtensions should invoke this as a super constructor with a fixed domain. See
ULongSpan.DefaultULongSpanSet
for an example.- Parameters:
domain
- the domain
-
-
Method Details
-
equals
-
toString
-
newSpanMap
Factory method for the span map backing this span set- Parameters:
domain
- the domain- Returns:
- the map
-
isEmpty
public boolean isEmpty()Description copied from interface:Span.SpanSet
Check if this set has any spans -
spans
Description copied from interface:Span.SpanSet
Iterate the spans in this set -
bound
Description copied from interface:Span.SpanSet
Get a span which encloses all spans in the set -
contains
Description copied from interface:Span.SpanSet
Check if the set contains the given value -
spanContaining
Description copied from interface:Span.SpanSet
Get the span containing the given value- Specified by:
spanContaining
in interfaceSpan.SpanSet<N,
S extends Span<N, S>> - Parameters:
n
- the value- Returns:
- the span or null
-
intersecting
Description copied from interface:Span.SpanSet
Iterate over all spans in the set that intersect the given span- Specified by:
intersecting
in interfaceSpan.SpanSet<N,
S extends Span<N, S>> - Parameters:
s
- the span- Returns:
- the iterable of spans
-
intersects
Description copied from interface:Span.SpanSet
Check if any span in the set intersects the given span- Specified by:
intersects
in interfaceSpan.SpanSet<N,
S extends Span<N, S>> - Parameters:
s
- the span- Returns:
- true if any span in the set intersects it
-
add
Description copied from interface:Span.MutableSpanSet
Add a span to the setAny connected spans will be coalesced.
-
addAll
Description copied from interface:Span.MutableSpanSet
Add all spans from the given set into this oneThe spans from both maps amy be coalesced when entered into this one. (The given map remains unmodified.)
-
remove
Description copied from interface:Span.MutableSpanSet
Remove a span from the setSpans which intersect the given span are truncated. Spans which are enclosed are deleted, such that no value in the given span remains in the set.
-
clear
public void clear()Description copied from interface:Span.MutableSpanSet
Remove all spans from the set
-