Top Description Inners Fields Constructors Methods
org.apache.commons.collections4.bidimap

public Class DualTreeBidiMap<K, V>

extends AbstractDualBidiMap<K, V>
implements SortedBidiMap<K, V>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.apache.commons.collections4.SortedBidiMap, java.util.SortedMap, java.util.SequencedMap, java.util.Map, org.apache.commons.collections4.OrderedBidiMap, org.apache.commons.collections4.OrderedMap, org.apache.commons.collections4.IterableMap, org.apache.commons.collections4.IterableGet, org.apache.commons.collections4.Get, org.apache.commons.collections4.Put, org.apache.commons.collections4.BidiMap
Type Parameters
<K>
the type of the keys in this map
<V>
the type of the values in this map
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serializable, java.util.ArrayList, .Comparator, .Iterator, .ListIterator, .Map, .SortedMap, .TreeMap, org.apache.commons.collections4.BidiMap, .OrderedBidiMap, .OrderedMap, .OrderedMapIterator, .ResettableIterator, .SortedBidiMap, org.apache.commons.collections4.map.AbstractSortedMapDecorator

Implementation of BidiMap that uses two TreeMap instances.

The setValue() method on iterators will succeed only if the new value being set is not already in the bidimap.

When considering whether to use this class, the TreeBidiMap class should also be considered. It implements the interface using a dedicated design, and does not store each object twice, which can save on memory use.

Note

From Commons Collections 3.1, all subclasses will use TreeMap and the flawed createMap method is ignored.

Since
3.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
DualTreeBidiMap.BidiOrderedMapIterator<K, V>

Inner class MapIterator.

protected static class
DualTreeBidiMap.ViewMap<K, V>

Internal sorted map view.

Field Summary

Modifier and TypeField and Description
private final Comparator<? super K>
comparator

The key comparator to use

private static final long
serialVersionUID

Ensure serialization compatibility

private final Comparator<? super V>
valueComparator

The value comparator to use

Inherited from org.apache.commons.collections4.bidimap.AbstractDualBidiMap:
entrySetinverseBidiMapkeySetnormalMapreverseMapvalues

Constructor Summary

AccessConstructor and Description
public
DualTreeBidiMap()

Creates an empty DualTreeBidiMap

public
DualTreeBidiMap(final Map<? extends K, ? extends V>
the map whose mappings are to be placed in this map
map
)

Constructs a DualTreeBidiMap and copies the mappings from specified Map.

public
DualTreeBidiMap(final Comparator<? super K>
the comparator
keyComparator
,
final Comparator<? super V>
the values comparator to use
valueComparator
)

Constructs a DualTreeBidiMap using the specified Comparator.

protected
DualTreeBidiMap(final Map<K, V>
the normal direction map
normalMap
,
final Map<V, K>
the reverse direction map
reverseMap
,
final BidiMap<V, K>
the inverse BidiMap
inverseBidiMap
)

Constructs a DualTreeBidiMap that decorates the specified maps.

Method Summary

Modifier and TypeMethod and Description
public Comparator<? super K>
comparator()

Implements java.util.SortedMap.comparator.

Returns the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys.
protected DualTreeBidiMap<V, K>

Returns:

new bidi map
createBidiMap
(final Map<V, K>
the normal direction map
normalMap
,
final Map<K, V>
the reverse direction map
reverseMap
,
final BidiMap<K, V>
the inverse BidiMap
inverseMap
)

Implements abstract org.apache.commons.collections4.bidimap.AbstractDualBidiMap.createBidiMap.

Creates a new instance of this object.
public K
firstKey()

Implements org.apache.commons.collections4.OrderedMap.firstKey, java.util.SortedMap.firstKey.

Returns the first (lowest) key currently in this map.
public SortedMap<K, V>
headMap(final K
high endpoint (exclusive) of the keys in the returned map
toKey
)

Implements java.util.SortedMap.headMap.

Returns a view of the portion of this map whose keys are strictly less than toKey.
public SortedBidiMap<V, K>
public OrderedBidiMap<V, K>
public SortedBidiMap<V, K>
public K
lastKey()

Implements org.apache.commons.collections4.OrderedMap.lastKey, java.util.SortedMap.lastKey.

Returns the last (highest) key currently in this map.
public OrderedMapIterator<K, V>
public K
nextKey(final K
the key to search for next from
key
)

Implements org.apache.commons.collections4.OrderedMap.nextKey.

Gets the next key after the one specified.
public K
previousKey(final K
the key to search for previous from
key
)

Implements org.apache.commons.collections4.OrderedMap.previousKey.

Gets the previous key before the one specified.
private void
public SortedMap<K, V>
subMap(final K
low endpoint (inclusive) of the keys in the returned map
fromKey
,
final K
high endpoint (exclusive) of the keys in the returned map
toKey
)

Implements java.util.SortedMap.subMap.

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive.
public SortedMap<K, V>
tailMap(final K
low endpoint (inclusive) of the keys in the returned map
fromKey
)

Implements java.util.SortedMap.tailMap.

Returns a view of the portion of this map whose keys are greater than or equal to fromKey.
public Comparator<? super V>
valueComparator()

Implements org.apache.commons.collections4.SortedBidiMap.valueComparator.

Get the comparator used for the values in the value-to-key map aspect.
private void
Inherited from org.apache.commons.collections4.bidimap.AbstractDualBidiMap:
clearcontainsKeycontainsValuecreateEntrySetIteratorcreateKeySetIteratorcreateValuesIteratorentrySetequalsgetgetKeyhashCodeisEmptykeySetputputAllremoveremoveValuesizetoStringvalues

Field Detail

comparatorback to summary
private final Comparator<? super K> comparator

The key comparator to use

serialVersionUIDback to summary
private static final long serialVersionUID

Ensure serialization compatibility

valueComparatorback to summary
private final Comparator<? super V> valueComparator

The value comparator to use

Constructor Detail

DualTreeBidiMapback to summary
public DualTreeBidiMap()

Creates an empty DualTreeBidiMap

DualTreeBidiMapback to summary
public DualTreeBidiMap(final Map<? extends K, ? extends V> map)

Constructs a DualTreeBidiMap and copies the mappings from specified Map.

Parameters
map:Map<? extends K, ? extends V>

the map whose mappings are to be placed in this map

DualTreeBidiMapback to summary
public DualTreeBidiMap(final Comparator<? super K> keyComparator, final Comparator<? super V> valueComparator)

Constructs a DualTreeBidiMap using the specified Comparator.

Parameters
keyComparator:Comparator<? super K>

the comparator

valueComparator:Comparator<? super V>

the values comparator to use

DualTreeBidiMapback to summary
protected DualTreeBidiMap(final Map<K, V> normalMap, final Map<V, K> reverseMap, final BidiMap<V, K> inverseBidiMap)

Constructs a DualTreeBidiMap that decorates the specified maps.

Parameters
normalMap:Map<K, V>

the normal direction map

reverseMap:Map<V, K>

the reverse direction map

inverseBidiMap:BidiMap<V, K>

the inverse BidiMap

Method Detail

comparatorback to summary
public Comparator<? super K> comparator()

Implements java.util.SortedMap.comparator.

Doc from java.util.SortedMap.comparator.

Returns the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys.

Returns:Comparator<? super K>

the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys

Annotations
@Override
createBidiMapback to summary
protected DualTreeBidiMap<V, K> createBidiMap(final Map<V, K> normalMap, final Map<K, V> reverseMap, final BidiMap<K, V> inverseMap)

Implements abstract org.apache.commons.collections4.bidimap.AbstractDualBidiMap.createBidiMap.

Creates a new instance of this object.

Parameters
normalMap:Map<V, K>

the normal direction map

reverseMap:Map<K, V>

the reverse direction map

inverseMap:BidiMap<K, V>

the inverse BidiMap

Returns:DualTreeBidiMap<V, K>

new bidi map

Annotations
@Override
firstKeyback to summary
public K firstKey()

Implements org.apache.commons.collections4.OrderedMap.firstKey, java.util.SortedMap.firstKey.

Doc from java.util.SortedMap.firstKey.

Returns the first (lowest) key currently in this map.

Returns:K

the first (lowest) key currently in this map

Annotations
@Override
headMapback to summary
public SortedMap<K, V> headMap(final K toKey)

Implements java.util.SortedMap.headMap.

Doc from java.util.SortedMap.headMap.

Returns a view of the portion of this map whose keys are strictly less than toKey. The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

Parameters
toKey:K

high endpoint (exclusive) of the keys in the returned map

Returns:SortedMap<K, V>

a view of the portion of this map whose keys are strictly less than toKey

Annotations
@Override
inverseBidiMapback to summary
public SortedBidiMap<V, K> inverseBidiMap()

Overrides org.apache.commons.collections4.bidimap.AbstractDualBidiMap.inverseBidiMap.

Implements org.apache.commons.collections4.SortedBidiMap.inverseBidiMap, org.apache.commons.collections4.BidiMap.inverseBidiMap.

Doc from org.apache.commons.collections4.SortedBidiMap.inverseBidiMap.

Gets a view of this map where the keys and values are reversed.

Changes to one map will be visible in the other and vice versa. This enables both directions of the map to be accessed equally.

Implementations should seek to avoid creating a new object every time this method is called. See AbstractMap.values() etc. Calling this method on the inverse map should return the original.

Implementations must return a SortedBidiMap instance, usually by forwarding to inverseSortedBidiMap().

Returns:SortedBidiMap<V, K>

an inverted bidirectional map

Annotations
@Override
inverseOrderedBidiMapback to summary
public OrderedBidiMap<V, K> inverseOrderedBidiMap()
inverseSortedBidiMapback to summary
public SortedBidiMap<V, K> inverseSortedBidiMap()
lastKeyback to summary
public K lastKey()

Implements org.apache.commons.collections4.OrderedMap.lastKey, java.util.SortedMap.lastKey.

Doc from java.util.SortedMap.lastKey.

Returns the last (highest) key currently in this map.

Returns:K

the last (highest) key currently in this map

Annotations
@Override
mapIteratorback to summary
public OrderedMapIterator<K, V> mapIterator()

Overrides org.apache.commons.collections4.bidimap.AbstractDualBidiMap.mapIterator.

Implements org.apache.commons.collections4.IterableGet.mapIterator, org.apache.commons.collections4.OrderedMap.mapIterator.

Obtains an ordered map iterator.

This implementation copies the elements to an ArrayList in order to provide the forward/backward behaviour.

Returns:OrderedMapIterator<K, V>

a new ordered map iterator

Annotations
@Override
nextKeyback to summary
public K nextKey(final K key)

Implements org.apache.commons.collections4.OrderedMap.nextKey.

Doc from org.apache.commons.collections4.OrderedMap.nextKey.

Gets the next key after the one specified.

Parameters
key:K

the key to search for next from

Returns:K

the next key, null if no match or at end

Annotations
@Override
previousKeyback to summary
public K previousKey(final K key)

Implements org.apache.commons.collections4.OrderedMap.previousKey.

Doc from org.apache.commons.collections4.OrderedMap.previousKey.

Gets the previous key before the one specified.

Parameters
key:K

the key to search for previous from

Returns:K

the previous key, null if no match or at start

Annotations
@Override
readObjectback to summary
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException
subMapback to summary
public SortedMap<K, V> subMap(final K fromKey, final K toKey)

Implements java.util.SortedMap.subMap.

Doc from java.util.SortedMap.subMap.

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive. (If fromKey and toKey are equal, the returned map is empty.) The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

Parameters
fromKey:K

low endpoint (inclusive) of the keys in the returned map

toKey:K

high endpoint (exclusive) of the keys in the returned map

Returns:SortedMap<K, V>

a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive

Annotations
@Override
tailMapback to summary
public SortedMap<K, V> tailMap(final K fromKey)

Implements java.util.SortedMap.tailMap.

Doc from java.util.SortedMap.tailMap.

Returns a view of the portion of this map whose keys are greater than or equal to fromKey. The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

Parameters
fromKey:K

low endpoint (inclusive) of the keys in the returned map

Returns:SortedMap<K, V>

a view of the portion of this map whose keys are greater than or equal to fromKey

Annotations
@Override
valueComparatorback to summary
public Comparator<? super V> valueComparator()

Implements org.apache.commons.collections4.SortedBidiMap.valueComparator.

Doc from org.apache.commons.collections4.SortedBidiMap.valueComparator.

Get the comparator used for the values in the value-to-key map aspect.

Returns:Comparator<? super V>

Comparator<? super V>

Annotations
@Override
writeObjectback to summary
private void writeObject(final ObjectOutputStream out) throws IOException
org.apache.commons.collections4.bidimap back to summary

protected Class DualTreeBidiMap.BidiOrderedMapIterator<K, V>

extends Object
implements OrderedMapIterator<K, V>, ResettableIterator<K>
Class Inheritance
  • java.lang.Object
  • org.apache.commons.collections4.bidimap.DualTreeBidiMap.BidiOrderedMapIterator
All Implemented Interfaces
org.apache.commons.collections4.ResettableIterator, java.util.Iterator, org.apache.commons.collections4.OrderedMapIterator, org.apache.commons.collections4.OrderedIterator, org.apache.commons.collections4.MapIterator

Inner class MapIterator.

Field Summary

Modifier and TypeField and Description
private ListIterator<Map.Entry<K, V>>
iterator

The iterator being decorated

private Map.Entry<K, V>
last

The last returned entry

private final AbstractDualBidiMap<K, V>
parent

The parent map

Constructor Summary

AccessConstructor and Description
protected
BidiOrderedMapIterator(final AbstractDualBidiMap<K, V>
the parent map
parent
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public K
getKey()

Implements org.apache.commons.collections4.MapIterator.getKey.

Gets the current key, which is the key returned by the last call to next().
public V
getValue()

Implements org.apache.commons.collections4.MapIterator.getValue.

Gets the current value, which is the value associated with the last key returned by next().
public boolean
hasNext()

Implements org.apache.commons.collections4.MapIterator.hasNext, java.util.Iterator.hasNext.

Checks to see if there are more entries still to be iterated.
public boolean
hasPrevious()

Implements org.apache.commons.collections4.OrderedMapIterator.hasPrevious.

Checks to see if there is a previous entry that can be iterated to.
public K
public K
previous()

Implements org.apache.commons.collections4.OrderedMapIterator.previous.

Gets the previous key from the Map.
public void
remove()

Overrides default java.util.Iterator.remove.

Implements org.apache.commons.collections4.MapIterator.remove.

Removes the last returned key from the underlying Map (optional operation).
public void
reset()

Implements org.apache.commons.collections4.ResettableIterator.reset.

Resets the iterator back to the position at which the iterator was created.
public V
setValue(final V
the new value
value
)

Implements org.apache.commons.collections4.MapIterator.setValue.

Sets the value associated with the current key (optional operation).
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

iteratorback to summary
private ListIterator<Map.Entry<K, V>> iterator

The iterator being decorated

lastback to summary
private Map.Entry<K, V> last

The last returned entry

parentback to summary
private final AbstractDualBidiMap<K, V> parent

The parent map

Constructor Detail

BidiOrderedMapIteratorback to summary
protected BidiOrderedMapIterator(final AbstractDualBidiMap<K, V> parent)

Constructor.

Parameters
parent:AbstractDualBidiMap<K, V>

the parent map

Method Detail

getKeyback to summary
public K getKey()

Implements org.apache.commons.collections4.MapIterator.getKey.

Doc from org.apache.commons.collections4.MapIterator.getKey.

Gets the current key, which is the key returned by the last call to next().

Returns:K

the current key

Annotations
@Override
getValueback to summary
public V getValue()

Implements org.apache.commons.collections4.MapIterator.getValue.

Doc from org.apache.commons.collections4.MapIterator.getValue.

Gets the current value, which is the value associated with the last key returned by next().

Returns:V

the current value

Annotations
@Override
hasNextback to summary
public boolean hasNext()

Implements org.apache.commons.collections4.MapIterator.hasNext, java.util.Iterator.hasNext.

Doc from org.apache.commons.collections4.MapIterator.hasNext.

Checks to see if there are more entries still to be iterated.

Returns:boolean

true if the iterator has more elements

Annotations
@Override
hasPreviousback to summary
public boolean hasPrevious()

Implements org.apache.commons.collections4.OrderedMapIterator.hasPrevious.

Doc from org.apache.commons.collections4.OrderedMapIterator.hasPrevious.

Checks to see if there is a previous entry that can be iterated to.

Returns:boolean

true if the iterator has a previous element

Annotations
@Override
nextback to summary
public K next()

Implements org.apache.commons.collections4.MapIterator.next, java.util.Iterator.next.

Doc from org.apache.commons.collections4.MapIterator.next.

Gets the next key from the Map.

Returns:K

the next key in the iteration

Annotations
@Override
previousback to summary
public K previous()

Implements org.apache.commons.collections4.OrderedMapIterator.previous.

Doc from org.apache.commons.collections4.OrderedMapIterator.previous.

Gets the previous key from the Map.

Returns:K

the previous key in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Implements org.apache.commons.collections4.MapIterator.remove.

Doc from org.apache.commons.collections4.MapIterator.remove.

Removes the last returned key from the underlying Map (optional operation).

This method can be called once per call to next().

Annotations
@Override
resetback to summary
public void reset()

Implements org.apache.commons.collections4.ResettableIterator.reset.

Doc from org.apache.commons.collections4.ResettableIterator.reset.

Resets the iterator back to the position at which the iterator was created.

Annotations
@Override
setValueback to summary
public V setValue(final V value)

Implements org.apache.commons.collections4.MapIterator.setValue.

Doc from org.apache.commons.collections4.MapIterator.setValue.

Sets the value associated with the current key (optional operation).

Parameters
value:V

the new value

Returns:V

the previous value

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.apache.commons.collections4.bidimap back to summary

protected Class DualTreeBidiMap.ViewMap<K, V>

extends AbstractSortedMapDecorator<K, V>
Class Inheritance

Internal sorted map view.

Constructor Summary

AccessConstructor and Description
protected
ViewMap(final DualTreeBidiMap<K, V>
the parent bidi map
bidi
,
final SortedMap<K, V>
the subMap sorted map
sm
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Overrides org.apache.commons.collections4.map.AbstractMapDecorator.clear.

Implements java.util.Map.clear, org.apache.commons.collections4.Put.clear.

Removes all of the mappings from this map (optional operation).
public boolean
containsValue(final Object
value whose presence in this map is to be tested
value
)

Overrides org.apache.commons.collections4.map.AbstractMapDecorator.containsValue.

Implements java.util.Map.containsValue, org.apache.commons.collections4.Get.containsValue.

Returns true if this map maps one or more keys to the specified value.
protected DualTreeBidiMap<K, V>
public SortedMap<K, V>
headMap(final K
high endpoint (exclusive) of the keys in the returned map
toKey
)

Overrides org.apache.commons.collections4.map.AbstractSortedMapDecorator.headMap.

Implements java.util.SortedMap.headMap.

Returns a view of the portion of this map whose keys are strictly less than toKey.
public K
nextKey(final K
the key to search for next from
key
)

Overrides org.apache.commons.collections4.map.AbstractSortedMapDecorator.nextKey.

Implements org.apache.commons.collections4.OrderedMap.nextKey.

Gets the next key after the one specified.
public K
previousKey(final K
the key to search for previous from
key
)

Overrides org.apache.commons.collections4.map.AbstractSortedMapDecorator.previousKey.

Implements org.apache.commons.collections4.OrderedMap.previousKey.

Gets the previous key before the one specified.
public SortedMap<K, V>
subMap(final K
low endpoint (inclusive) of the keys in the returned map
fromKey
,
final K
high endpoint (exclusive) of the keys in the returned map
toKey
)

Overrides org.apache.commons.collections4.map.AbstractSortedMapDecorator.subMap.

Implements java.util.SortedMap.subMap.

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive.
public SortedMap<K, V>
tailMap(final K
low endpoint (inclusive) of the keys in the returned map
fromKey
)

Overrides org.apache.commons.collections4.map.AbstractSortedMapDecorator.tailMap.

Implements java.util.SortedMap.tailMap.

Returns a view of the portion of this map whose keys are greater than or equal to fromKey.
Inherited from org.apache.commons.collections4.map.AbstractSortedMapDecorator:
comparatorfirstKeylastKeymapIterator

Constructor Detail

ViewMapback to summary
protected ViewMap(final DualTreeBidiMap<K, V> bidi, final SortedMap<K, V> sm)

Constructor.

Parameters
bidi:DualTreeBidiMap<K, V>

the parent bidi map

sm:SortedMap<K, V>

the subMap sorted map

Method Detail

clearback to summary
public void clear()

Overrides org.apache.commons.collections4.map.AbstractMapDecorator.clear.

Implements java.util.Map.clear, org.apache.commons.collections4.Put.clear.

Doc from java.util.Map.clear.

Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.

Annotations
@Override
containsValueback to summary
public boolean containsValue(final Object value)

Overrides org.apache.commons.collections4.map.AbstractMapDecorator.containsValue.

Implements java.util.Map.containsValue, org.apache.commons.collections4.Get.containsValue.

Doc from java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value. More formally, returns true if and only if this map contains at least one mapping to a value v such that Objects.equals(value, v). This operation will probably require time linear in the map size for most implementations of the Map interface.

Parameters
value:Object

value whose presence in this map is to be tested

Returns:boolean

true if this map maps one or more keys to the specified value

Annotations
@Override
decoratedback to summary
protected DualTreeBidiMap<K, V> decorated()

Overrides org.apache.commons.collections4.map.AbstractSortedMapDecorator.decorated.

Doc from org.apache.commons.collections4.map.AbstractSortedMapDecorator.decorated.

Gets the map being decorated.

Returns:DualTreeBidiMap<K, V>

the decorated map

Annotations
@Override
headMapback to summary
public SortedMap<K, V> headMap(final K toKey)

Overrides org.apache.commons.collections4.map.AbstractSortedMapDecorator.headMap.

Implements java.util.SortedMap.headMap.

Doc from java.util.SortedMap.headMap.

Returns a view of the portion of this map whose keys are strictly less than toKey. The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

Parameters
toKey:K

high endpoint (exclusive) of the keys in the returned map

Returns:SortedMap<K, V>

a view of the portion of this map whose keys are strictly less than toKey

Annotations
@Override
nextKeyback to summary
public K nextKey(final K key)

Overrides org.apache.commons.collections4.map.AbstractSortedMapDecorator.nextKey.

Implements org.apache.commons.collections4.OrderedMap.nextKey.

Doc from org.apache.commons.collections4.OrderedMap.nextKey.

Gets the next key after the one specified.

Parameters
key:K

the key to search for next from

Returns:K

the next key, null if no match or at end

Annotations
@Override
previousKeyback to summary
public K previousKey(final K key)

Overrides org.apache.commons.collections4.map.AbstractSortedMapDecorator.previousKey.

Implements org.apache.commons.collections4.OrderedMap.previousKey.

Doc from org.apache.commons.collections4.OrderedMap.previousKey.

Gets the previous key before the one specified.

Parameters
key:K

the key to search for previous from

Returns:K

the previous key, null if no match or at start

Annotations
@Override
subMapback to summary
public SortedMap<K, V> subMap(final K fromKey, final K toKey)

Overrides org.apache.commons.collections4.map.AbstractSortedMapDecorator.subMap.

Implements java.util.SortedMap.subMap.

Doc from java.util.SortedMap.subMap.

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive. (If fromKey and toKey are equal, the returned map is empty.) The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

Parameters
fromKey:K

low endpoint (inclusive) of the keys in the returned map

toKey:K

high endpoint (exclusive) of the keys in the returned map

Returns:SortedMap<K, V>

a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive

Annotations
@Override
tailMapback to summary
public SortedMap<K, V> tailMap(final K fromKey)

Overrides org.apache.commons.collections4.map.AbstractSortedMapDecorator.tailMap.

Implements java.util.SortedMap.tailMap.

Doc from java.util.SortedMap.tailMap.

Returns a view of the portion of this map whose keys are greater than or equal to fromKey. The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

Parameters
fromKey:K

low endpoint (inclusive) of the keys in the returned map

Returns:SortedMap<K, V>

a view of the portion of this map whose keys are greater than or equal to fromKey

Annotations
@Override