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:
java.util.Map.Entry<K,V>

public class MapEntry<K,V>
extends java.lang.Object
implements java.util.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(java.lang.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)
          
 java.lang.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 java.util.Map.Entry<K,V>

getValue

public V getValue()

Specified by:
getValue in interface java.util.Map.Entry<K,V>

setValue

public V setValue(V _value)

Specified by:
setValue in interface java.util.Map.Entry<K,V>

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

setKey

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


equals

public boolean equals(java.lang.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 java.util.Map.Entry<K,V>
Overrides:
equals in class java.lang.Object

hashCode

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

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


Terrier 3.5. Copyright © 2004-2011 University of Glasgow