Compiere Looks 1.2.1

org.compiere.util
Class KeyNamePair

java.lang.Object
  |
  +--org.compiere.util.NamePair
        |
        +--org.compiere.util.KeyNamePair
All Implemented Interfaces:
Comparable, Comparator, Serializable

public final class KeyNamePair
extends NamePair

(Numeric) Key Name Pair

Version:
$Id: KeyNamePair.java,v 1.3 2002/06/24 05:02:27 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, 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
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

Compiere Looks 1.2.1

Copyright (c) 1999-2003 ComPiere, Inc. - Author: Jorg Janke