Compiere Looks 1.2.1

org.compiere.util
Class NamePair

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

public abstract class NamePair
extends Object
implements Comparator, Serializable, Comparable

Name Pair Interface

Version:
$Id: NamePair.java,v 1.4 2002/06/24 05:02:27 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Constructor Summary
protected NamePair(String name)
          Protected Constructor
 
Method Summary
 int compare(Object o1, Object o2)
          Comparator Interface (based on toString value)
 int compareTo(Object o)
          Comparable Interface (based on toString value)
abstract  String getID()
          Returns Key or Value as String
 String getName()
          Returns display value
 String toString()
          To String - returns name
 String toStringX()
          To String - detail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

NamePair

protected NamePair(String name)
Protected Constructor

Parameters:
name - (Display) Name of the Pair
Method Detail

getName

public String getName()
Returns display value

Returns:
name

getID

public abstract String getID()
Returns Key or Value as String

Returns:
String or null

compare

public int compare(Object o1,
                   Object o2)
Comparator Interface (based on toString value)

Specified by:
compare in interface Comparator
Parameters:
o1 - Object 1
o2 - Object 2
Returns:
compareTo value

compareTo

public int compareTo(Object o)
Comparable Interface (based on toString value)

Specified by:
compareTo in interface Comparable
Parameters:
o - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

toString

public String toString()
To String - returns name

Overrides:
toString in class Object
Returns:
Name

toStringX

public String toStringX()
To String - detail

Returns:
String in format ID=Name

Compiere Looks 1.2.1

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