Package gaiasky.util

Class TwoWayHashmap<K,​V>

java.lang.Object
gaiasky.util.TwoWayHashmap<K,​V>
Type Parameters:
K - Key type in forward map, value in backward map
V - Value type in forward map, key in backward map

public class TwoWayHashmap<K,​V>
extends java.lang.Object
Simple two-way hashmap implemented with two maps.
  • Constructor Summary

    Constructors
    Constructor Description
    TwoWayHashmap()  
  • Method Summary

    Modifier and Type Method Description
    void add​(K key, V value)  
    boolean containsKey​(K key)  
    boolean containsValue​(V value)  
    K getBackward​(V key)  
    V getForward​(K key)  
    boolean removeKey​(K key)  
    boolean removeValue​(V value)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TwoWayHashmap

      public TwoWayHashmap()
  • Method Details

    • add

      public void add​(K key, V value)
    • getForward

      public V getForward​(K key)
    • getBackward

      public K getBackward​(V key)
    • containsKey

      public boolean containsKey​(K key)
    • containsValue

      public boolean containsValue​(V value)
    • removeKey

      public boolean removeKey​(K key)
    • removeValue

      public boolean removeValue​(V value)