Package ghidra.generic.util.datastruct
Class RestrictedValueSortedMap<K,V>
java.lang.Object
ghidra.generic.util.datastruct.RestrictedValueSortedMap<K,V>
- Type Parameters:
K- the type of keysV- the type of values
- All Implemented Interfaces:
ValueSortedMap<K,V>
A view of the value-sorted map for implementing
subMapByValue(Object, boolean, Object, boolean), etc.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA list iterator suitable forList.listIterator(), etc., on the entries of aRestrictedValueSortedMapclassA list iterator suitable forList.listIterator(), etc., on the keys of aRestrictedValueSortedMapclassA list view suitable forValueSortedMap.values()ofRestrictedValueSortedMapclassA list iterator suitable forList.listIterator(), etc., on the values of aRestrictedValueSortedMapclassA list view suitable forValueSortedMap.entrySet()ofRestrictedValueSortedMapclassA list view suitable forValueSortedMap.keySet()ofRestrictedValueSortedMapNested classes/interfaces inherited from interface ghidra.generic.util.datastruct.ValueSortedMap
ValueSortedMap.LesserList<E>, ValueSortedMap.ValueSortedMapEntryList<K,V>, ValueSortedMap.ValueSortedMapKeyList<K> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRestrictedValueSortedMap(ValueSortedMap<K, V> wrapped, Comparator<V> comparator, boolean hasFrom, V fromValue, boolean fromInclusive, boolean hasTo, V toValue, boolean toInclusive) Construct a restricted view of a value-sorted map -
Method Summary
Modifier and TypeMethodDescriptionceilingEntryByValue(V value) Returns a key-value mapping associated with the least value greater than or equal to the given value, ornullif there is no such value.voidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()floorEntryByValue(V value) Returns a key-value mapping associated with the greatest value less than or equal to the given value, ornullif there is no such value.protected intprotected intheadMapByValue(V toValue, boolean inclusive) Returns a view of the portion of this map whose values are less than (or equal to, ifinclusiveis true)toValue.higherEntryByValue(V value) Returns a key-value mapping associated with the least value strictly greater than the given value, ornullif there is no such value.protected booleanprotected intinBoundsOrNeg1(int index) inBoundsOrNull(Map.Entry<K, V> ent) protected VinBoundsOrNull(V val) booleanisEmpty()keySet()lowerEntryByValue(V value) Returns a key-value mapping associated with the greatest value strictly less than the given value, ornullif there is no such value.protected booleanprotected intintsize()subMapByValue(V fromValue, boolean fromInclusive, V toValue, boolean toInclusive) Returns a view of the portion of this map whose values range fromfromValuetotoValue.tailMapByValue(V fromValue, boolean inclusive) Returns a view of the portion of this map whose values are greater than (or equal to, ifinclusiveis true)toValue.booleanNotify the map of an external change to the cost of a key's associated valuevalues()
-
Constructor Details
-
RestrictedValueSortedMap
protected RestrictedValueSortedMap(ValueSortedMap<K, V> wrapped, Comparator<V> comparator, boolean hasFrom, V fromValue, boolean fromInclusive, boolean hasTo, V toValue, boolean toInclusive) Construct a restricted view of a value-sorted map- Parameters:
wrapped- the value-sorted map to restrictcomparator- the value comparatorhasFrom- true if there exists a lower boundfromValue- the lower bound, if presentfromInclusive- true to include the lower boundhasTo- true if there exists an upper boundtoValue- the upper bound, if presenttoInclusive- true to include the upper bound
-
-
Method Details
-
getLowestIndex
protected int getLowestIndex() -
getHighestIndexPlusOne
protected int getHighestIndexPlusOne() -
size
public int size()- Specified by:
sizein interfaceValueSortedMap<K,V>
-
inBoundsOrNeg1
protected int inBoundsOrNeg1(int index) -
restrictedSize
protected int restrictedSize() -
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceValueSortedMap<K,V>
-
restrictedIsEmpty
protected boolean restrictedIsEmpty() -
inBounds
-
inBoundsOrNull
-
inBoundsOrNull
-
containsKey
- Specified by:
containsKeyin interfaceValueSortedMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceValueSortedMap<K,V>
-
get
- Specified by:
getin interfaceValueSortedMap<K,V>
-
put
- Specified by:
putin interfaceValueSortedMap<K,V>
-
remove
- Specified by:
removein interfaceValueSortedMap<K,V>
-
clear
public void clear()- Specified by:
clearin interfaceValueSortedMap<K,V>
-
entrySet
- Specified by:
entrySetin interfaceValueSortedMap<K,V>
-
lowerEntryByValue
Description copied from interface:ValueSortedMapReturns a key-value mapping associated with the greatest value strictly less than the given value, ornullif there is no such value.- Specified by:
lowerEntryByValuein interfaceValueSortedMap<K,V> - Parameters:
value- the value- Returns:
- the found entry, or
null
-
floorEntryByValue
Description copied from interface:ValueSortedMapReturns a key-value mapping associated with the greatest value less than or equal to the given value, ornullif there is no such value.- Specified by:
floorEntryByValuein interfaceValueSortedMap<K,V> - Parameters:
value- the value- Returns:
- the found entry, or
null
-
ceilingEntryByValue
Description copied from interface:ValueSortedMapReturns a key-value mapping associated with the least value greater than or equal to the given value, ornullif there is no such value.- Specified by:
ceilingEntryByValuein interfaceValueSortedMap<K,V> - Parameters:
value- the value- Returns:
- the found entry, or
null
-
higherEntryByValue
Description copied from interface:ValueSortedMapReturns a key-value mapping associated with the least value strictly greater than the given value, ornullif there is no such value.- Specified by:
higherEntryByValuein interfaceValueSortedMap<K,V> - Parameters:
value- the value- Returns:
- the found entry, or
null
-
subMapByValue
public ValueSortedMap<K,V> subMapByValue(V fromValue, boolean fromInclusive, V toValue, boolean toInclusive) Description copied from interface:ValueSortedMapReturns a view of the portion of this map whose values range fromfromValuetotoValue. The returned map is an unmodifiable view.- Specified by:
subMapByValuein interfaceValueSortedMap<K,V> - Parameters:
fromValue- low endpoint of the values in the returned mapfromInclusive-trueif the low endpoint is to be included in the returned viewtoValue- high endpoint of the values in the returned maptoInclusive-trueif the high endpoint is to be included in the returned view- Returns:
- the view
-
headMapByValue
Description copied from interface:ValueSortedMapReturns a view of the portion of this map whose values are less than (or equal to, ifinclusiveis true)toValue. The returned map is an unmodifiable view.- Specified by:
headMapByValuein interfaceValueSortedMap<K,V> - Parameters:
toValue- high endpoint of the values in the returned mapinclusive-trueif the high endpoint is to be included in the returned view- Returns:
- the view
-
tailMapByValue
Description copied from interface:ValueSortedMapReturns a view of the portion of this map whose values are greater than (or equal to, ifinclusiveis true)toValue. The returned map is an unmodifiable view.- Specified by:
tailMapByValuein interfaceValueSortedMap<K,V> - Parameters:
fromValue- low endpoint of the values in the returned mapinclusive-trueif the low endpoint is to be included in the returned view- Returns:
- the view
-
keySet
- Specified by:
keySetin interfaceValueSortedMap<K,V>
-
update
Description copied from interface:ValueSortedMapNotify the map of an external change to the cost of a key's associated valueThis is meant to update the entry's position after a change in cost. The position may not necessarily change, however, if the cost did not change significantly.
- Specified by:
updatein interfaceValueSortedMap<K,V> - Parameters:
key- the key whose associated value has changed in cost- Returns:
- true if the entry's position changed
-
values
- Specified by:
valuesin interfaceValueSortedMap<K,V>
-