Package generic
Class RangeMapSetter<E,D,R,V>
java.lang.Object
generic.RangeMapSetter<E,D,R,V>
- Type Parameters:
E- the type of entriesD- the type of range boundsR- the type of rangesV- the type of values
- Direct Known Subclasses:
Span.SpanMapSetter
A method outline for setting an entry in a range map where coalescing is desired
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract intCompare two values as inComparator.compare(Object, Object)protected booleanCheck if the two ranges are connectedgetIntersecting(D lower, D upper) Get all entries intersecting the closed range formed by the given boundsprotected abstract DGet the lower bound of the rangeprotected abstract DGet the number immediately following the given boundprotected DgetNextOrSame(D d) Get the next bound or this same bound, if the next doesn't existprotected abstract DgetPrevious(D d) Get the number immediately preceding the given boundprotected DGet the previous bound or this same bound, if the previous doesn't existprotected abstract RGet the range of the given entryprotected abstract DGet the upper bound of the rangeprotected abstract VGet the value of the given entryprotected abstract EPlace an entry into the mapprotected abstract voidRemove an entry from the mapEntry point: Set the given range to the given value, coalescing where possibleEntry point: Set the given range to the given value, coalescing where possibleprotected abstract RCreate a closed range with the given boundsprotected booleanvaluesEqual(V v1, V v2) Check if two values are equal
-
Constructor Details
-
RangeMapSetter
public RangeMapSetter()
-
-
Method Details
-
compare
Compare two values as inComparator.compare(Object, Object)- Parameters:
d1- the first valued2- the second value- Returns:
- the result
-
getRange
Get the range of the given entry- Parameters:
entry- the entry- Returns:
- the range
-
getValue
Get the value of the given entry- Parameters:
entry- the entry- Returns:
- the value
-
valuesEqual
Check if two values are equal- Parameters:
v1- the first valuev2- the second value- Returns:
- true if equal, false if not
-
remove
Remove an entry from the map- Parameters:
entry- the entry
-
getLower
Get the lower bound of the range- Parameters:
range- the range- Returns:
- the lower bound
-
getUpper
Get the upper bound of the range- Parameters:
range- the range- Returns:
- the upper bound
-
toSpan
Create a closed range with the given bounds- Parameters:
lower- the lower boundupper- the upper bound- Returns:
- the range
-
getPrevious
Get the number immediately preceding the given bound- Parameters:
d- the bound- Returns:
- the previous bound, or null if it doesn't exist
-
getNext
Get the number immediately following the given bound- Parameters:
d- the bound- Returns:
- the next bound, or null if it doesn't exist
-
getIntersecting
Get all entries intersecting the closed range formed by the given bounds- Parameters:
lower- the lower boundupper- the upper bound- Returns:
- the intersecting entries
-
put
Place an entry into the map- Parameters:
range- the range of the entryvalue- the value of the entry- Returns:
- the new entry (or an existing entry)
-
getPreviousOrSame
Get the previous bound or this same bound, if the previous doesn't exist- Parameters:
d- the bound- Returns:
- the previous or same bound
-
getNextOrSame
Get the next bound or this same bound, if the next doesn't exist- Parameters:
d- the bound- Returns:
- the next or same bound
-
connects
Check if the two ranges are connectedThe ranges are connected if they intersect, or if their bounds abut.
- Parameters:
r1- the first ranger2- the second range- Returns:
- true if connected
-
set
Entry point: Set the given range to the given value, coalescing where possible- Parameters:
range- the rangevalue- the value- Returns:
- the entry containing the value
-
set
Entry point: Set the given range to the given value, coalescing where possible- Parameters:
lower- the lower boundupper- the upper boundvalue- the value- Returns:
- the entry containing the value
-