org.omnaest.utils.structure.map
Class SimpleEntry<K,V>

java.lang.Object
  extended by org.omnaest.utils.structure.map.SimpleEntry<K,V>
Type Parameters:
K -
V -
All Implemented Interfaces:
Map.Entry<K,V>

public class SimpleEntry<K,V>
extends Object
implements Map.Entry<K,V>

Simple entity implementation for an Map.Entry

Author:
Omnaest

Field Summary
protected  K key
           
protected  V value
           
 
Constructor Summary
SimpleEntry(K key, V value)
           
SimpleEntry(Map.Entry<K,V> entry)
           
 
Method Summary
 K getKey()
           
 V getValue()
           
 Map.Entry<V,K> inverted()
          Returns an inverted Map.Entry view of the current Map.Entry.
 V setValue(V value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map.Entry
equals, hashCode
 

Field Detail

key

protected K key

value

protected V value
Constructor Detail

SimpleEntry

public SimpleEntry(K key,
                   V value)
Parameters:
key -
value -

SimpleEntry

public SimpleEntry(Map.Entry<K,V> entry)
Parameters:
entry -
See Also:
SimpleEntry
Method Detail

inverted

public Map.Entry<V,K> inverted()
Returns an inverted Map.Entry view of the current Map.Entry. Changes to each instance will affect the others.

Returns:

getKey

public K getKey()
Specified by:
getKey in interface Map.Entry<K,V>

getValue

public V getValue()
Specified by:
getValue in interface Map.Entry<K,V>

setValue

public V setValue(V value)
Specified by:
setValue in interface Map.Entry<K,V>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.