All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.javagimmicks.collections.bidimap.BidiMap Maven / Gradle / Ivy

There is a newer version: 0.99-alpha1
Show newest version
package net.sf.javagimmicks.collections.bidimap;

import java.util.Map;

/**
 * Defines a {@link Map} that is bi-directional which means that values are
 * unique and reverse lookup (value to key) is possible.
 */
public interface BidiMap extends Map
{
   /**
    * Returns an inverted view of this {@link BidiMap} (keys and values are
    * exchanged).
    * 
    * @return an inverted view of this {@link BidiMap}
    */
   public BidiMap inverseBidiMap();

   /**
    * Retrieves the key that belongs to the given value.
    * 
    * @param value
    *           the value whose key should be looked up
    * @return the key for the given value or {@code null} if there is no such
    *         value
    */
   public K getKey(V value);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy