org.brains2b.collection
Class EntryImpl

java.lang.Object
  extended byorg.brains2b.collection.EntryImpl
All Implemented Interfaces:
java.io.Serializable

public class EntryImpl
extends java.lang.Object
implements java.io.Serializable

A Map.Entry written to rely on Strings instead of objects

Used primarely for Reference tables, JCombobox and the like. For that reason the toString() returns only the value.

Note: This is not an implementation of MapEntry

Version:
0.20.1 [28-11-2006]
Author:
dennis@brains2b.nl
See Also:
Map.Entry, Serialized Form

Constructor Summary
EntryImpl()
          Default Constructor for EntryImpl
EntryImpl(java.lang.String key, java.lang.String value)
          Constructor for EntryImpl, initializes the values
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this EntryImpl to another object to see if they are equal The following rules apply: If comparing a EntryImpl equals returns true if they have the same key If comparing a String equals returns true if the String equals the key In all other cases false is returned.
 java.lang.String getKey()
          Returns the key.
 java.lang.String getValue()
          Returns the value.
 java.lang.String paramString()
          Method paramString is used for testing purposes.
 void setKey(java.lang.String key)
          sets the Key
 void setValue(java.lang.String value)
          sets the Value
 java.lang.String toString()
          The toString is equivalent to getValue() to make it possible to use it in a Combobox.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntryImpl

public EntryImpl()
Default Constructor for EntryImpl


EntryImpl

public EntryImpl(java.lang.String key,
                 java.lang.String value)
Constructor for EntryImpl, initializes the values

Parameters:
key - String
value - String
Method Detail

getKey

public java.lang.String getKey()
Returns the key.

Returns:
String

getValue

public java.lang.String getValue()
Returns the value.

Returns:
String

toString

public java.lang.String toString()
The toString is equivalent to getValue() to make it possible to use it in a Combobox.

See Also:
Object.toString()

equals

public boolean equals(java.lang.Object obj)
Compares this EntryImpl to another object to see if they are equal

setKey

public void setKey(java.lang.String key)
sets the Key

Prefered method is using the Constructor to initialize the object, instead of setting or updating the key here.

Parameters:
key - String

setValue

public void setValue(java.lang.String value)
sets the Value

Prefered method is using the Constructor to initialize the object, instead of setting or updating the value here.

Parameters:
value - String

paramString

public java.lang.String paramString()
Method paramString is used for testing purposes.

Do not use this in runtime code for implementation may change, without notice

Returns:
String, returns the key and value seperated by a colon.