public class

BiMap

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.collect.BiMap<K, V>

Class Overview

A bidirectional map of key-values. This class is serialializable. The null key and null value are forbidden. The key-value mapping is one-to-one: a key can only map to one value, and one value can only map to one key. (One consequence is that putting a key-value pair may either increment, keep the same, or even decrement the map size.

Thread-safety: none.

Note: this class does not implement the Map interface, but attempts to follow its guidelines and contracts the best it can. One notable exception is that this class does not override hashCode/equals.

Summary

Public Constructors
BiMap()
Create a new bi-map.
BiMap(CollectionOrder keyOrder)
Create a new bi-map.
Public Methods
Map<K, V> asMap()
Map<V, K> asReverseMap()
void clear()
boolean containsKey(K key)
boolean containsValue(V value)
V get(K key)
K getKeyForValue(V value)
boolean isEmpty()
Set<K> keySet()
V put(K key, V value)
void putAll(Map<? extends K, ? extends V> m)
V remove(K key)
K removeValue(V value)
int size()
String toString()
Set<V> values()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public BiMap ()

Create a new bi-map.

public BiMap (CollectionOrder keyOrder)

Create a new bi-map.

Public Methods

public Map<K, V> asMap ()

public Map<V, K> asReverseMap ()

public void clear ()

public boolean containsKey (K key)

public boolean containsValue (V value)

public V get (K key)

public K getKeyForValue (V value)

public boolean isEmpty ()

public Set<K> keySet ()

public V put (K key, V value)

public void putAll (Map<? extends K, ? extends V> m)

public V remove (K key)

public K removeValue (V value)

public int size ()

public String toString ()

public Set<V> values ()