org.terrier.structures.collections
Class MapEntry<K,V>

java.lang.Object
  extended by org.terrier.structures.collections.MapEntry<K,V>
Type Parameters:
K - type of the Key
V - type of the Value
All Implemented Interfaces:
Map.Entry<K,V>

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

Implementation of java.util.Map.Entry.

Since:
3.0

Field Summary
protected  K key
           
protected  V value
           
 
Constructor Summary
MapEntry(K _key, V _value)
          Construct a new Entry
 
Method Summary
 boolean equals(Object o)
          Checks if another object is equal to this one, i.e.
 K getKey()
          
 V getValue()
          
 int hashCode()
          Creates a hashcode combining both keys and values.
 K setKey(K _key)
          Allow the key to be changed
 V setValue(V _value)
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

key

protected K key

value

protected V value
Constructor Detail

MapEntry

public MapEntry(K _key,
                V _value)
Construct a new Entry

Method Detail

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

setKey

public K setKey(K _key)
Allow the key to be changed


equals

public boolean equals(Object o)
Checks if another object is equal to this one, i.e. all keys are equal and all values are equal

Specified by:
equals in interface Map.Entry<K,V>
Overrides:
equals in class Object

hashCode

public int hashCode()
Creates a hashcode combining both keys and values.

Specified by:
hashCode in interface Map.Entry<K,V>
Overrides:
hashCode in class Object


Terrier 3.6. Copyright © 2004-2011 University of Glasgow