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>
Abstract Name Pair class
- Version:
- $Id: NamePair.java,v 1.3 2006/07/30 00:52:23 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Compare o1 and o2 (based on toString value)int
Compare o1 and o2 (based on toString value) using Collatorint
Comparable Interface (based on toString value)int
Comparable Interface (based on toString value) using Collatorabstract String
getID()
Returns Key or Value as StringgetName()
Returns display valuetoString()
To String - returns nameTo String - detailMethods 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 Details
-
NamePair
Protected Constructor- Parameters:
name
- (Display) Name of the Pair
-
-
Method Details
-
getName
Returns display value- Returns:
- name
-
getID
Returns Key or Value as String- Returns:
- String or null
-
compare
Compare o1 and o2 (based on toString value)- Specified by:
compare
in interfaceComparator<Object>
- Parameters:
o1
- Object 1o2
- Object 2- Returns:
- compareTo value
-
compare
Compare o1 and o2 (based on toString value) using Collator- Parameters:
o1
- Object 1o2
- Object 2- Returns:
- compareTo value
-
compareTo
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
Comparable Interface (based on toString value) using Collator- 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
To String - returns name -
toStringX
To String - detail- Returns:
- String in format ID=Name
-