- Type Parameters:
N
- the type of endpointsS
- the type of spansV
- the type of values
- All Known Subinterfaces:
Span.MutableSpanMap<N,
,S, V> ULongSpan.MutableULongSpanMap<V>
,ULongSpan.ULongSpanMap<V>
- All Known Implementing Classes:
Span.DefaultSpanMap
,ULongSpan.DefaultULongSpanMap
Spans are not allowed to overlap, and connected spans are automatically coalesced when mapped
to the same value. For example, the entries [1..5]='A'
and [6..10]='A'
become
one entry [1..10]='A'
. When an entry is added that overlaps other entries, the
existing entries are truncated or deleted (or coalesced if they share the same value as the
new entry) so that the new entry can fit.
-
Method Summary
Modifier and TypeMethodDescriptionbound()
Get a span which encloses all spans in the mapentries()
Get the entries in this mapGet the value of the given keyGet the entry whose span contains the given keyIterate over all entries whose spans intersect the given spanIterate over all spans in the map that intersect the given spanboolean
intersects
(S s) Check if any span in the map intersects the given spanboolean
isEmpty()
Check if this map has any entriesspans()
Get the spans in this mapvalues()
Get the values in this map
-
Method Details
-
isEmpty
boolean isEmpty()Check if this map has any entries- Returns:
- true if empty
-
spans
Get the spans in this mapNote that the behavior regarding a copy versus a view is not specified. Clients should not rely on one or the other.
- Returns:
- the set of spans
-
values
Collection<V> values()Get the values in this mapNote that the behavior regarding a copy versus a view is not specified. Clients should not rely on one of the other.
- Returns:
- the collection of values
-
bound
S bound()Get a span which encloses all spans in the map- Returns:
- the bounding span
-
entries
Get the entries in this mapNote that the behavior regarding a copy versus a view is not specified. Clients should not rely on one or the other.
- Returns:
- the set of entries
-
getEntry
Get the entry whose span contains the given key- Parameters:
n
- the key- Returns:
- the entry, or null
-
get
Get the value of the given keyNote that a null return could indicate either that no entry has a span containing the given key, or that the entry whose span contains it has the null value. To distinguish the two, consider using
getEntry(Object)
.- Parameters:
n
- the key- Returns:
- the value, or null
-
intersectingEntries
Iterate over all entries whose spans intersect the given span- Parameters:
s
- the span- Returns:
- an iterable of entries
-
intersectingSpans
Iterate over all spans in the map that intersect the given span- Parameters:
s
- the span- Returns:
- an iterable of spans
-
intersects
Check if any span in the map intersects the given span- Parameters:
s
- the span- Returns:
- true if any span in the map intersects it
-