|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.util.TwoFacedObject
public class TwoFacedObject
A generic Object wrapper that holds two objects. The first is used as the label and for comparisons in lists.
| Field Summary | |
|---|---|
static boolean |
debug
debug flag |
| Constructor Summary | |
|---|---|
TwoFacedObject()
Default constructor with null id and label |
|
TwoFacedObject(Object label)
Create a TwoFacedObject where both id and label are identical. |
|
TwoFacedObject(Object label,
int id)
Create a TwoFacedObject with label and integer id |
|
TwoFacedObject(Object label,
Object id)
Create a TwoFacedObject. |
|
| Method Summary | |
|---|---|
int |
compareTo(Object o)
Compare this object to another. |
static boolean |
contains(List objects,
Object value)
|
static List |
createList(int[] ids,
String[] names)
Create a list of tfos from the given int ids and names |
static List |
createList(String[] ids,
String[] names)
Create a list of tfos from the given int ids and names |
boolean |
equals(Object other)
See if this TwoFacedObject is equal to another object. |
static TwoFacedObject |
findId(Object id,
List l)
Finf the tfo with the given id in the list |
static String |
findLabel(Object id,
List l)
Find the label for the object in the list |
Object |
getId()
Get the Id object. |
static List |
getIdList(List objects)
Create a list of ids from the given list of objects. |
static Object |
getIdObject(Object o)
Get the id object of this possible TwoFacedObject. |
static String |
getIdString(Object o)
Get a String representation for the id of this TwoFacedObject. |
static List |
getIdStrings(List objects)
Get a String representation for the objects in te lsit |
Object |
getLabel()
Get the Label object. |
int |
hashCode()
Get the hashcode for this TwoFacedObject |
void |
setId(Object newId)
Sets the value of the Id object. |
void |
setLabel(Object newLabel)
Sets the value of the Label object. |
static void |
sort(List list)
|
String |
toString()
String representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static boolean debug
| Constructor Detail |
|---|
public TwoFacedObject()
public TwoFacedObject(Object label)
label - label and object
public TwoFacedObject(Object label,
int id)
label - labelid - id
public TwoFacedObject(Object label,
Object id)
label - object to use for labeling.id - other face of this object| Method Detail |
|---|
public String toString()
toString in class Objectpublic boolean equals(Object other)
equals in class Objectother -
public int hashCode()
hashCode in class Objectpublic Object getId()
public void setId(Object newId)
newId - public Object getLabel()
public void setLabel(Object newLabel)
newLabel - public static String getIdString(Object o)
o - object in question.
public static Object getIdObject(Object o)
o - object in question.
public static List createList(int[] ids,
String[] names)
ids - idsnames - names
public static List createList(String[] ids,
String[] names)
ids - idsnames - names
public static List getIdList(List objects)
objects - list of objects
public static TwoFacedObject findId(Object id,
List l)
id - id to look forl - list of tfos
public static String findLabel(Object id,
List l)
id - object to search forl - list of TwoFacedObjects objects
public static boolean contains(List objects,
Object value)
public static List getIdStrings(List objects)
objects - objects in question.
public int compareTo(Object o)
compareTo in interface Comparableo - object in question.
public static void sort(List list)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||