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
ConstructorsConstructorDescriptionDefaultSpanSet(Span.Domain<N, S> domain) Create a span set on the given domain -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a span to the setvoidaddAll(Span.SpanSet<N, S> set) Add all spans from the given set into this onebound()Get a span which encloses all spans in the setvoidclear()Remove all spans from the setbooleanCheck if the set contains the given valuebooleanintersecting(S s) Iterate over all spans in the set that intersect the given spanbooleanintersects(S s) Check if any span in the set intersects the given spanbooleanisEmpty()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 setvoidRemove a span from the setspanContaining(N n) Get the span containing the given valuespans()Iterate the spans in this settoString()Render this set as a string, using the given endpoint-to-string functionMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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.DefaultULongSpanSetfor an example.- Parameters:
domain- the domain
-
-
Method Details
-
equals
-
toString
Description copied from interface:Span.SpanSetRender this set as a string, using the given endpoint-to-string function -
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.SpanSetCheck if this set has any spans -
spans
Description copied from interface:Span.SpanSetIterate the spans in this set -
bound
Description copied from interface:Span.SpanSetGet a span which encloses all spans in the set -
contains
Description copied from interface:Span.SpanSetCheck if the set contains the given value -
spanContaining
Description copied from interface:Span.SpanSetGet the span containing the given value- Specified by:
spanContainingin interfaceSpan.SpanSet<N,S extends Span<N, S>> - Parameters:
n- the value- Returns:
- the span or null
-
intersecting
Description copied from interface:Span.SpanSetIterate over all spans in the set that intersect the given span- Specified by:
intersectingin interfaceSpan.SpanSet<N,S extends Span<N, S>> - Parameters:
s- the span- Returns:
- the iterable of spans
-
intersects
Description copied from interface:Span.SpanSetCheck if any span in the set intersects the given span- Specified by:
intersectsin 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.MutableSpanSetAdd a span to the setAny connected spans will be coalesced.
-
addAll
Description copied from interface:Span.MutableSpanSetAdd 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.MutableSpanSetRemove 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.MutableSpanSetRemove all spans from the set
-