- Type Parameters:
N
- the type of endpointsS
- the type of spansV
- the type of values
- All Implemented Interfaces:
Span.MutableSpanMap<N,
,S, V> Span.SpanMap<N,
S, V>
- Direct Known Subclasses:
ULongSpan.DefaultULongSpanMap
Span.SpanMap
and Span.MutableSpanMap
using an interval
tree
The interfaces can prevent accidental mutation of a map where it shouldn't be allowed; however, nothing prevents a client from casting to the mutable interface. If proper immutability is required, this will need to be wrapped or extended to prevent mutation.
-
Constructor Summary
ConstructorDescriptionDefaultSpanMap
(Span.Domain<N, S> domain) Create a span map on the given domain -
Method Summary
Modifier and TypeMethodDescriptionbound()
Get a span which encloses all spans in the mapvoid
clear()
Remove all entries from the mapentries()
Get the entries in this mapboolean
Get 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 entriesvoid
Put an entry, mapping all keys contains in the span to the given valuevoid
putAll
(Span.SpanMap<N, S, V> map) Copy all entries from the given map into this onevoid
Delete all keys in the given spanspans()
Get the spans in this mapprotected NavigableMap
<N, Map.Entry<S, V>> Get the portion of the interval tree whose entries intersect the given spantoString()
values()
Get the values in this map
-
Constructor Details
-
DefaultSpanMap
Create a span map on the given domainExtensions should invoke this as a super constructor with a fixed domain. See
ULongSpan.DefaultULongSpanMap
for an example.- Parameters:
domain
- the domain
-
-
Method Details
-
equals
-
toString
-
isEmpty
public boolean isEmpty()Description copied from interface:Span.SpanMap
Check if this map has any entries -
spans
Description copied from interface:Span.SpanMap
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.
-
bound
Description copied from interface:Span.SpanMap
Get a span which encloses all spans in the map -
values
Description copied from interface:Span.SpanMap
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.
-
entries
Description copied from interface:Span.SpanMap
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.
-
getEntry
Description copied from interface:Span.SpanMap
Get the entry whose span contains the given key -
get
Description copied from interface:Span.SpanMap
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
Span.SpanMap.getEntry(Object)
. -
subMap
Get the portion of the interval tree whose entries intersect the given span- Parameters:
min
- the lower endpoint of the spanmax
- the upper endpoint of the span- Returns:
- the sub map
-
intersectingEntries
Description copied from interface:Span.SpanMap
Iterate over all entries whose spans intersect the given span- Specified by:
intersectingEntries
in interfaceSpan.SpanMap<N,
S extends Span<N, S>, V> - Parameters:
s
- the span- Returns:
- an iterable of entries
-
intersectingSpans
Description copied from interface:Span.SpanMap
Iterate over all spans in the map that intersect the given span- Specified by:
intersectingSpans
in interfaceSpan.SpanMap<N,
S extends Span<N, S>, V> - Parameters:
s
- the span- Returns:
- an iterable of spans
-
intersects
Description copied from interface:Span.SpanMap
Check if any span in the map intersects the given span- Specified by:
intersects
in interfaceSpan.SpanMap<N,
S extends Span<N, S>, V> - Parameters:
s
- the span- Returns:
- true if any span in the map intersects it
-
put
Description copied from interface:Span.MutableSpanMap
Put an entry, mapping all keys contains in the span to the given valueEach key can only be mapped to a single value. Thus existing entries having the same value may be coalesced to this new entry. Existing entries having a different value will be truncated or deleted to make room for this entry.
-
putAll
Description copied from interface:Span.MutableSpanMap
Copy all entries from the given map into this oneThe entries from both maps may be coalesced when entered into this one. (The given map remains unmodified.) The entries in this map may be truncated or deleted to make room for those in the given map.
-
remove
Description copied from interface:Span.MutableSpanMap
Delete all keys in the given spanEntries which intersect the given span are truncated. Entries which are enclosed are deleted, such that every key in the given span is no longer mapped to a value.
-
clear
public void clear()Description copied from interface:Span.MutableSpanMap
Remove all entries from the map
-