org.vostok.lang
Class Entry

java.lang.Object
  extended by org.vostok.lang.Entry
All Implemented Interfaces:
java.io.Serializable

public final class Entry
extends java.lang.Object
implements java.io.Serializable

holder class for a key data's value couple. It's used by PriorityList

Author:
levreau.jerome@vostoksystem.eu
See Also:
PriorityList, Serialized Form

Constructor Summary
Entry(java.lang.String key)
          constructor allowing null object value.
Entry(java.lang.String key, T obj)
          Create a new entry to add into a PriorityList.
 
Method Summary
 boolean equals(java.lang.Object obj)
          equals method. 2 entries are set to be equal if both are Entry classes and key matches.
 java.lang.String getKey()
          reutrn the key for the entry
<T> T
getObj()
          return the object for this entry
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Entry

public Entry(java.lang.String key,
             T obj)
Create a new entry to add into a PriorityList. note the key cannot be null an must be unique in a PriorityList

Type Parameters:
T -
Parameters:
key -
obj -
Throws:
java.lang.NullPointerException - : if key is null
See Also:
PriorityList

Entry

public Entry(java.lang.String key)
constructor allowing null object value. convenience method, same as Entry(key,null)

Parameters:
key -
Method Detail

getKey

public java.lang.String getKey()
reutrn the key for the entry

Returns:

getObj

public <T> T getObj()
return the object for this entry

Type Parameters:
T -
Returns:

equals

public boolean equals(java.lang.Object obj)
equals method. 2 entries are set to be equal if both are Entry classes and key matches. Obj values is NOT relevant

Overrides:
equals in class java.lang.Object
Parameters:
obj -
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object