K
- the type of the keys in this mapV
- the type of the values in this mappublic class TreeBidiMap<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>> extends java.lang.Object implements OrderedBidiMap<K,V>, java.io.Serializable
Comparable
interface.
This class guarantees that the map will be in both ascending key order and ascending value order, sorted according to the natural order for the key's and value's classes.
This Map is intended for applications that need to be able to look up a key-value pairing by either key or value, and need to do so with equal efficiency.
While that goal could be accomplished by taking a pair of TreeMaps
and redirecting requests to the appropriate TreeMap (e.g.,
containsKey would be directed to the TreeMap that maps values to
keys, containsValue would be directed to the TreeMap that maps keys
to values), there are problems with that implementation.
If the data contained in the TreeMaps is large, the cost of redundant
storage becomes significant. The DualTreeBidiMap
and
DualHashBidiMap
implementations use this approach.
This solution keeps minimizes the data storage by holding data only once.
The red-black algorithm is based on TreeMap
, but has been modified
to simultaneously map a tree node by key and by value. This doubles the
cost of put operations (but so does using two TreeMaps), and nearly doubles
the cost of remove operations (there is a savings in that the lookup of the
node to be removed only has to be performed once). And since only one node
contains the key and value, storage is significantly less than that
required by two TreeMaps.
The Map.Entry instances returned by the appropriate methods will not allow setValue() and will throw an UnsupportedOperationException on attempts to call that method.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
TreeBidiMap.DataElement |
(package private) class |
TreeBidiMap.EntryView
A view of this map.
|
(package private) class |
TreeBidiMap.Inverse
The inverse map implementation.
|
(package private) class |
TreeBidiMap.InverseEntryView
A view of this map.
|
(package private) class |
TreeBidiMap.InverseViewMapEntryIterator
An iterator over the inverse map entries.
|
(package private) class |
TreeBidiMap.InverseViewMapIterator
An iterator over the map.
|
(package private) class |
TreeBidiMap.KeyView |
(package private) static class |
TreeBidiMap.Node<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
A node used to store the data.
|
(package private) class |
TreeBidiMap.ValueView |
(package private) class |
TreeBidiMap.View<E>
A view of this map.
|
(package private) class |
TreeBidiMap.ViewIterator
An iterator over the map.
|
(package private) class |
TreeBidiMap.ViewMapEntryIterator
An iterator over the map entries.
|
(package private) class |
TreeBidiMap.ViewMapIterator
An iterator over the map.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Set<java.util.Map.Entry<K,V>> |
entrySet |
private TreeBidiMap.Inverse |
inverse |
private java.util.Set<K> |
keySet |
private int |
modifications |
private int |
nodeCount |
private TreeBidiMap.Node<K,V>[] |
rootNode |
private static long |
serialVersionUID |
private java.util.Set<V> |
valuesSet |
Constructor and Description |
---|
TreeBidiMap()
Constructs a new empty TreeBidiMap.
|
TreeBidiMap(java.util.Map<? extends K,? extends V> map)
Constructs a new TreeBidiMap by copying an existing Map.
|
Modifier and Type | Method and Description |
---|---|
private static void |
checkKey(java.lang.Object key)
check a key for validity (non-null and implements Comparable)
|
private static void |
checkKeyAndValue(java.lang.Object key,
java.lang.Object value)
check a key and a value for validity (non-null and implements
Comparable)
|
private static void |
checkNonNullComparable(java.lang.Object o,
TreeBidiMap.DataElement dataElement)
check if an object is fit to be proper input ...
|
private static void |
checkValue(java.lang.Object value)
check a value for validity (non-null and implements Comparable)
|
void |
clear()
Removes all mappings from this map.
|
private static <T extends java.lang.Comparable<T>> |
compare(T o1,
T o2)
Compare two objects
|
boolean |
containsKey(java.lang.Object key)
Checks whether this map contains the a mapping for the specified key.
|
boolean |
containsValue(java.lang.Object value)
Checks whether this map contains the a mapping for the specified value.
|
private void |
copyColor(TreeBidiMap.Node<K,V> from,
TreeBidiMap.Node<K,V> to,
TreeBidiMap.DataElement dataElement)
copy the color from one node to another, dealing with the fact
that one or both nodes may, in fact, be null
|
private boolean |
doEquals(java.lang.Object obj,
TreeBidiMap.DataElement dataElement)
Compares for equals as per the API.
|
private int |
doHashCode(TreeBidiMap.DataElement dataElement)
Gets the hash code value for this map as per the API.
|
private void |
doPut(K key,
V value)
Put logic.
|
private void |
doRedBlackDelete(TreeBidiMap.Node<K,V> deletedNode)
complicated red-black delete stuff.
|
private void |
doRedBlackDeleteFixup(TreeBidiMap.Node<K,V> replacementNode,
TreeBidiMap.DataElement dataElement)
complicated red-black delete stuff.
|
private void |
doRedBlackInsert(TreeBidiMap.Node<K,V> insertedNode,
TreeBidiMap.DataElement dataElement)
complicated red-black insert stuff.
|
private V |
doRemoveKey(java.lang.Object key) |
private K |
doRemoveValue(java.lang.Object value) |
private java.lang.String |
doToString(TreeBidiMap.DataElement dataElement)
Gets the string form of this map as per AbstractMap.
|
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
Returns a set view of the entries contained in this map in key order.
|
boolean |
equals(java.lang.Object obj)
Compares for equals as per the API.
|
K |
firstKey()
Gets the first (lowest) key currently in this map.
|
V |
get(java.lang.Object key)
Gets the value to which this map maps the specified key.
|
private TreeBidiMap.Node<K,V> |
getGrandParent(TreeBidiMap.Node<K,V> node,
TreeBidiMap.DataElement dataElement)
get a node's grandparent.
|
K |
getKey(java.lang.Object value)
Returns the key to which this map maps the specified value.
|
private TreeBidiMap.Node<K,V> |
getLeftChild(TreeBidiMap.Node<K,V> node,
TreeBidiMap.DataElement dataElement)
get a node's left child.
|
private MapIterator<?,?> |
getMapIterator(TreeBidiMap.DataElement dataElement) |
private TreeBidiMap.Node<K,V> |
getParent(TreeBidiMap.Node<K,V> node,
TreeBidiMap.DataElement dataElement)
get a node's parent.
|
private TreeBidiMap.Node<K,V> |
getRightChild(TreeBidiMap.Node<K,V> node,
TreeBidiMap.DataElement dataElement)
get a node's right child.
|
private TreeBidiMap.Node<K,V> |
greatestNode(TreeBidiMap.Node<K,V> node,
TreeBidiMap.DataElement dataElement)
Find the greatest node from a given node.
|
private void |
grow()
bump up the size and note that the map has changed
|
int |
hashCode()
Gets the hash code value for this map as per the API.
|
private void |
insertValue(TreeBidiMap.Node<K,V> newNode)
insert a node by its value
|
OrderedBidiMap<V,K> |
inverseBidiMap()
Gets the inverse map for comparison.
|
private static boolean |
isBlack(TreeBidiMap.Node<?,?> node,
TreeBidiMap.DataElement dataElement)
is the specified black red? if the node does not exist, sure,
it's black, thank you
|
boolean |
isEmpty()
Checks whether the map is empty or not.
|
private static boolean |
isRed(TreeBidiMap.Node<?,?> node,
TreeBidiMap.DataElement dataElement)
is the specified node red? if the node does not exist, no, it's
black, thank you
|
java.util.Set<K> |
keySet()
Returns a set view of the keys contained in this map in key order.
|
K |
lastKey()
Gets the last (highest) key currently in this map.
|
private TreeBidiMap.Node<K,V> |
leastNode(TreeBidiMap.Node<K,V> node,
TreeBidiMap.DataElement dataElement)
Find the least node from a given node.
|
private <T extends java.lang.Comparable<T>> |
lookup(java.lang.Object data,
TreeBidiMap.DataElement dataElement)
do the actual lookup of a piece of data
|
private TreeBidiMap.Node<K,V> |
lookupKey(java.lang.Object key) |
private TreeBidiMap.Node<K,V> |
lookupValue(java.lang.Object value) |
private static void |
makeBlack(TreeBidiMap.Node<?,?> node,
TreeBidiMap.DataElement dataElement)
force a node (if it exists) black
|
private static void |
makeRed(TreeBidiMap.Node<?,?> node,
TreeBidiMap.DataElement dataElement)
force a node (if it exists) red
|
OrderedMapIterator<K,V> |
mapIterator()
Obtains a
MapIterator over the map. |
private void |
modify()
increment the modification count -- used to check for
concurrent modification of the map through the map and through
an Iterator from one of its Set or Collection views
|
private TreeBidiMap.Node<K,V> |
nextGreater(TreeBidiMap.Node<K,V> node,
TreeBidiMap.DataElement dataElement)
get the next larger node from the specified node
|
K |
nextKey(K key)
Gets the next key after the one specified.
|
private TreeBidiMap.Node<K,V> |
nextSmaller(TreeBidiMap.Node<K,V> node,
TreeBidiMap.DataElement dataElement)
get the next larger node from the specified node
|
K |
previousKey(K key)
Gets the previous key before the one specified.
|
V |
put(K key,
V value)
Puts the key-value pair into the map, replacing any previous pair.
|
void |
putAll(java.util.Map<? extends K,? extends V> map)
Puts all the mappings from the specified map into this map.
|
private void |
readObject(java.io.ObjectInputStream stream)
Reads the content of the stream.
|
V |
remove(java.lang.Object key)
Removes the mapping for this key from this map if present.
|
K |
removeValue(java.lang.Object value)
Removes the mapping for this value from this map if present.
|
private void |
rotateLeft(TreeBidiMap.Node<K,V> node,
TreeBidiMap.DataElement dataElement)
do a rotate left.
|
private void |
rotateRight(TreeBidiMap.Node<K,V> node,
TreeBidiMap.DataElement dataElement)
do a rotate right.
|
private void |
shrink()
decrement the size and note that the map has changed
|
int |
size()
Returns the number of key-value mappings in this map.
|
private void |
swapPosition(TreeBidiMap.Node<K,V> x,
TreeBidiMap.Node<K,V> y,
TreeBidiMap.DataElement dataElement)
swap two nodes (except for their content), taking care of
special cases where one is the other's parent ...
|
java.lang.String |
toString()
Returns a string version of this Map in standard format.
|
java.util.Set<V> |
values()
Returns a set view of the values contained in this map in key order.
|
private void |
writeObject(java.io.ObjectOutputStream stream)
Writes the content to the stream for serialization.
|
private static final long serialVersionUID
private transient TreeBidiMap.Node<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>[] rootNode
private transient int nodeCount
private transient int modifications
private transient java.util.Set<java.util.Map.Entry<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>> entrySet
private transient TreeBidiMap.Inverse inverse
public TreeBidiMap()
public TreeBidiMap(java.util.Map<? extends K,? extends V> map)
map
- the map to copyjava.lang.ClassCastException
- if the keys/values in the map are
not Comparable or are not mutually comparablejava.lang.NullPointerException
- if any key or value in the map is nullpublic int size()
public boolean isEmpty()
public boolean containsKey(java.lang.Object key)
The key must implement Comparable
.
containsKey
in interface java.util.Map<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
containsKey
in interface Get<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
key
- key whose presence in this map is to be testedjava.lang.ClassCastException
- if the key is of an inappropriate typejava.lang.NullPointerException
- if the key is nullMap.containsKey(Object)
public boolean containsValue(java.lang.Object value)
The value must implement Comparable
.
containsValue
in interface java.util.Map<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
containsValue
in interface Get<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
value
- value whose presence in this map is to be testedjava.lang.ClassCastException
- if the value is of an inappropriate typejava.lang.NullPointerException
- if the value is nullMap.containsValue(Object)
public V get(java.lang.Object key)
The key must implement Comparable
.
get
in interface java.util.Map<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
get
in interface Get<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
key
- key whose associated value is to be returnedjava.lang.ClassCastException
- if the key is of an inappropriate typejava.lang.NullPointerException
- if the key is nullMap.get(Object)
public V put(K key, V value)
When adding a key-value pair, the value may already exist in the map against a different key. That mapping is removed, to ensure that the value only occurs once in the inverse map.
BidiMap map1 = new TreeBidiMap(); map.put("A","B"); // contains A mapped to B, as per Map map.put("A","C"); // contains A mapped to C, as per Map BidiMap map2 = new TreeBidiMap(); map.put("A","B"); // contains A mapped to B, as per Map map.put("C","B"); // contains C mapped to B, key A is removed
Both key and value must implement Comparable
.
put
in interface java.util.Map<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
put
in interface BidiMap<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
put
in interface Put<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyjava.lang.ClassCastException
- if the key is of an inappropriate typejava.lang.NullPointerException
- if the key is nullMap.put(Object, Object)
public void putAll(java.util.Map<? extends K,? extends V> map)
All keys and values must implement Comparable
.
public V remove(java.lang.Object key)
The key must implement Comparable
.
remove
in interface java.util.Map<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
remove
in interface Get<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
key
- key whose mapping is to be removed from the map.java.lang.ClassCastException
- if the key is of an inappropriate typejava.lang.NullPointerException
- if the key is nullMap.remove(Object)
public void clear()
public K getKey(java.lang.Object value)
The value must implement Comparable
.
getKey
in interface BidiMap<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
value
- value whose associated key is to be returned.java.lang.ClassCastException
- if the value is of an inappropriate typejava.lang.NullPointerException
- if the value is nullpublic K removeValue(java.lang.Object value)
The value must implement Comparable
.
removeValue
in interface BidiMap<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
value
- value whose mapping is to be removed from the mapjava.lang.ClassCastException
- if the value is of an inappropriate typejava.lang.NullPointerException
- if the value is nullpublic K firstKey()
public K lastKey()
public K nextKey(K key)
The key must implement Comparable
.
public K previousKey(K key)
The key must implement Comparable
.
previousKey
in interface OrderedMap<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
key
- the key to search for previous frompublic java.util.Set<K> keySet()
The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined.
The set supports element removal, which removes the corresponding mapping from the map. It does not support the add or addAll operations.
keySet
in interface java.util.Map<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
keySet
in interface Get<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
Map.keySet()
public java.util.Set<V> values()
The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined.
The set supports element removal, which removes the corresponding mapping from the map. It does not support the add or addAll operations.
values
in interface java.util.Map<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
values
in interface BidiMap<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
values
in interface Get<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
Map.values()
public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined.
The set supports element removal, which removes the corresponding mapping from the map. It does not support the add or addAll operations. The returned MapEntry objects do not support setValue.
entrySet
in interface java.util.Map<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
entrySet
in interface Get<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
Map.entrySet()
public OrderedMapIterator<K,V> mapIterator()
IterableGet
MapIterator
over the map.
A map iterator is an efficient way of iterating over maps. There is no need to access the entry set or use Map Entry objects.
IterableMap<String,Integer> map = new HashedMap<String,Integer>(); MapIterator<String,Integer> it = map.mapIterator(); while (it.hasNext()) { String key = it.next(); Integer value = it.getValue(); it.setValue(value + 1); }
mapIterator
in interface IterableGet<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
mapIterator
in interface OrderedMap<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
public OrderedBidiMap<V,K> inverseBidiMap()
inverseBidiMap
in interface BidiMap<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
inverseBidiMap
in interface OrderedBidiMap<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>>
public boolean equals(java.lang.Object obj)
public int hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
private void doPut(K key, V value)
key
- the key, always the main map keyvalue
- the value, always the main map valueprivate V doRemoveKey(java.lang.Object key)
private K doRemoveValue(java.lang.Object value)
private <T extends java.lang.Comparable<T>> TreeBidiMap.Node<K,V> lookup(java.lang.Object data, TreeBidiMap.DataElement dataElement)
data
- the key or value to be looked updataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private TreeBidiMap.Node<K,V> lookupKey(java.lang.Object key)
private TreeBidiMap.Node<K,V> lookupValue(java.lang.Object value)
private TreeBidiMap.Node<K,V> nextGreater(TreeBidiMap.Node<K,V> node, TreeBidiMap.DataElement dataElement)
node
- the node to be searched fromdataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private TreeBidiMap.Node<K,V> nextSmaller(TreeBidiMap.Node<K,V> node, TreeBidiMap.DataElement dataElement)
node
- the node to be searched fromdataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private static <T extends java.lang.Comparable<T>> int compare(T o1, T o2)
o1
- the first objecto2
- the second objectprivate TreeBidiMap.Node<K,V> leastNode(TreeBidiMap.Node<K,V> node, TreeBidiMap.DataElement dataElement)
node
- the node from which we will start searchingdataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private TreeBidiMap.Node<K,V> greatestNode(TreeBidiMap.Node<K,V> node, TreeBidiMap.DataElement dataElement)
node
- the node from which we will start searchingdataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private void copyColor(TreeBidiMap.Node<K,V> from, TreeBidiMap.Node<K,V> to, TreeBidiMap.DataElement dataElement)
from
- the node whose color we're copying; may be nullto
- the node whose color we're changing; may be nulldataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private static boolean isRed(TreeBidiMap.Node<?,?> node, TreeBidiMap.DataElement dataElement)
node
- the node (may be null) in questiondataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private static boolean isBlack(TreeBidiMap.Node<?,?> node, TreeBidiMap.DataElement dataElement)
node
- the node (may be null) in questiondataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private static void makeRed(TreeBidiMap.Node<?,?> node, TreeBidiMap.DataElement dataElement)
node
- the node (may be null) in questiondataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private static void makeBlack(TreeBidiMap.Node<?,?> node, TreeBidiMap.DataElement dataElement)
node
- the node (may be null) in questiondataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private TreeBidiMap.Node<K,V> getGrandParent(TreeBidiMap.Node<K,V> node, TreeBidiMap.DataElement dataElement)
node
- the node (may be null) in questiondataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private TreeBidiMap.Node<K,V> getParent(TreeBidiMap.Node<K,V> node, TreeBidiMap.DataElement dataElement)
node
- the node (may be null) in questiondataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private TreeBidiMap.Node<K,V> getRightChild(TreeBidiMap.Node<K,V> node, TreeBidiMap.DataElement dataElement)
node
- the node (may be null) in questiondataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private TreeBidiMap.Node<K,V> getLeftChild(TreeBidiMap.Node<K,V> node, TreeBidiMap.DataElement dataElement)
node
- the node (may be null) in questiondataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private void rotateLeft(TreeBidiMap.Node<K,V> node, TreeBidiMap.DataElement dataElement)
node
- the node to be rotateddataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private void rotateRight(TreeBidiMap.Node<K,V> node, TreeBidiMap.DataElement dataElement)
node
- the node to be rotateddataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private void doRedBlackInsert(TreeBidiMap.Node<K,V> insertedNode, TreeBidiMap.DataElement dataElement)
insertedNode
- the node to be inserteddataElement
- the KEY or VALUE intprivate void doRedBlackDelete(TreeBidiMap.Node<K,V> deletedNode)
deletedNode
- the node to be deletedprivate void doRedBlackDeleteFixup(TreeBidiMap.Node<K,V> replacementNode, TreeBidiMap.DataElement dataElement)
replacementNode
- the node being replaceddataElement
- the KEY or VALUE intprivate void swapPosition(TreeBidiMap.Node<K,V> x, TreeBidiMap.Node<K,V> y, TreeBidiMap.DataElement dataElement)
x
- one nodey
- another nodedataElement
- the KEY or VALUE intprivate static void checkNonNullComparable(java.lang.Object o, TreeBidiMap.DataElement dataElement)
o
- the object being checkeddataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.java.lang.NullPointerException
- if o is nulljava.lang.ClassCastException
- if o is not Comparableprivate static void checkKey(java.lang.Object key)
key
- the key to be checkedjava.lang.NullPointerException
- if key is nulljava.lang.ClassCastException
- if key is not Comparableprivate static void checkValue(java.lang.Object value)
value
- the value to be checkedjava.lang.NullPointerException
- if value is nulljava.lang.ClassCastException
- if value is not Comparableprivate static void checkKeyAndValue(java.lang.Object key, java.lang.Object value)
key
- the key to be checkedvalue
- the value to be checkedjava.lang.NullPointerException
- if key or value is nulljava.lang.ClassCastException
- if key or value is not Comparableprivate void modify()
private void grow()
private void shrink()
private void insertValue(TreeBidiMap.Node<K,V> newNode) throws java.lang.IllegalArgumentException
newNode
- the node to be insertedjava.lang.IllegalArgumentException
- if the node already exists
in the value mappingprivate boolean doEquals(java.lang.Object obj, TreeBidiMap.DataElement dataElement)
obj
- the object to compare todataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private int doHashCode(TreeBidiMap.DataElement dataElement)
dataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private java.lang.String doToString(TreeBidiMap.DataElement dataElement)
dataElement
- either TreeBidiMap.DataElement.KEY
key}
or the value
.private MapIterator<?,?> getMapIterator(TreeBidiMap.DataElement dataElement)
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException
stream
- the input streamjava.io.IOException
- if an error occurs while reading from the streamjava.lang.ClassNotFoundException
- if an object read from the stream can not be loadedprivate void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOException
stream
- the output streamjava.io.IOException
- if an error occurs while writing to the stream