Package org.compiere.util
Class NamePair
- java.lang.Object
-
- org.compiere.util.NamePair
-
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,Comparator<Object>
- Direct Known Subclasses:
KeyNamePair
,ValueNamePair
,WGadgets.ListElement
,WRC2FieldOrderPanel.ListElement
,WRC3SortCriteriaPanel.ListElement
public abstract class NamePair extends Object implements Comparator<Object>, Serializable, Comparable<Object>
Name Pair Interface- Version:
- $Id: NamePair.java,v 1.3 2006/07/30 00:52:23 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compare(Object o1, Object o2)
Comparator Interface (based on toString value)int
compare(NamePair o1, NamePair o2)
Comparator Interface (based on toString value)int
compareTo(Object o)
Comparable Interface (based on toString value)int
compareTo(NamePair o)
Comparable Interface (based on toString value)abstract String
getID()
Returns Key or Value as StringString
getName()
Returns display valueString
toString()
To String - returns nameString
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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
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 interfaceComparator<Object>
- Parameters:
o1
- Object 1o2
- Object 2- Returns:
- compareTo value
-
compare
public int compare(NamePair o1, NamePair o2)
Comparator Interface (based on toString value)- Parameters:
o1
- Object 1o2
- Object 2- Returns:
- compareTo value
-
compareTo
public int compareTo(Object o)
Comparable Interface (based on toString value)- Specified by:
compareTo
in interfaceComparable<Object>
- 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.
-
compareTo
public int compareTo(NamePair o)
Comparable Interface (based on toString value)- 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
-
toStringX
public String toStringX()
To String - detail- Returns:
- String in format ID=Name
-
-