de.mguennewig.pobjects.metadata
Class MapItem

java.lang.Object
  extended by de.mguennewig.pobjects.metadata.MapItem
All Implemented Interfaces:
java.lang.Comparable<MapItem>

public class MapItem
extends java.lang.Object
implements java.lang.Comparable<MapItem>

Maps a value actually stored in the database to a user representation.

Author:
Michael Günnewig

Constructor Summary
MapItem(java.lang.Object value, java.lang.String label)
          Creates a new MapItem.
 
Method Summary
 int compareTo(MapItem item)
          Compares two map items by its label.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 java.lang.String getLabel()
          Returns the value actually stored in the database.
 java.lang.Object getValue()
          Returns the string displayed to the user to represent value.
 int hashCode()
          
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapItem

public MapItem(java.lang.Object value,
               java.lang.String label)
Creates a new MapItem.

Parameters:
value - The value actually stored in the database.
label - The string displayed to the user to represent value.
Method Detail

getLabel

public final java.lang.String getLabel()
Returns the value actually stored in the database.


getValue

public final java.lang.Object getValue()
Returns the string displayed to the user to represent value.


equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(Object)

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(MapItem item)
Compares two map items by its label.

Specified by:
compareTo in interface java.lang.Comparable<MapItem>