Adempiere 3.5.2a

org.compiere.util
Class KeyNamePair

java.lang.Object
  extended by org.compiere.util.NamePair
      extended by org.compiere.util.KeyNamePair
All Implemented Interfaces:
Serializable, Comparable, Comparator<Object>

public final class KeyNamePair
extends NamePair

(Numeric) Key Name Pair

Version:
$Id: KeyNamePair.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Constructor Summary
KeyNamePair(int key, String name)
          Constructor KeyValue Pair -
 
Method Summary
 boolean equals(Object obj)
          Equals
 String getID()
          Get ID (key as String)
 int getKey()
          Get Key
 int hashCode()
          Return Hashcode of key
 
Methods inherited from class org.compiere.util.NamePair
compare, compare, compareTo, compareTo, getName, toString, toStringX
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyNamePair

public KeyNamePair(int key,
                   String name)
Constructor KeyValue Pair -

Parameters:
key - Key (-1 is considered as null)
name - string representation
Method Detail

getKey

public int getKey()
Get Key

Returns:
key

getID

public String getID()
Get ID (key as String)

Specified by:
getID in class NamePair
Returns:
String value of key or null if -1

equals

public boolean equals(Object obj)
Equals

Specified by:
equals in interface Comparator<Object>
Overrides:
equals in class Object
Parameters:
obj - object
Returns:
true if equal

hashCode

public int hashCode()
Return Hashcode of key

Overrides:
hashCode in class Object
Returns:
hascode

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.