public class TwoFacedObject
extends java.lang.Object
implements java.lang.Comparable
| Modifier and Type | Field and Description |
|---|---|
static boolean |
debug
debug flag
|
| Constructor and Description |
|---|
TwoFacedObject()
Default constructor with null id and label
|
TwoFacedObject(java.lang.Object label)
Create a TwoFacedObject where both id and label are identical.
|
TwoFacedObject(java.lang.Object label,
int id)
Create a TwoFacedObject with label and integer id
|
TwoFacedObject(java.lang.Object label,
java.lang.Object id)
Create a TwoFacedObject.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(java.lang.Object o)
Compare this object to another.
|
static boolean |
contains(java.util.List objects,
java.lang.Object value) |
static java.util.List |
createList(int[] ids,
java.lang.String[] names)
Create a list of tfos from the given int ids and names
|
static java.util.List |
createList(java.lang.String[] ids,
java.lang.String[] names)
Create a list of tfos from the given int ids and names
|
boolean |
equals(java.lang.Object other)
See if this TwoFacedObject is equal to another object.
|
static TwoFacedObject |
findId(java.lang.Object id,
java.util.List l)
Finf the tfo with the given id in the list
|
static java.lang.String |
findLabel(java.lang.Object id,
java.util.List l)
Find the label for the object in the list
|
java.lang.Object |
getId()
Get the Id object.
|
static java.util.List |
getIdList(java.util.List objects)
Create a list of ids from the given list of objects.
|
static java.lang.Object |
getIdObject(java.lang.Object o)
Get the id object of this possible TwoFacedObject.
|
static java.lang.String |
getIdString(java.lang.Object o)
Get a String representation for the id of this TwoFacedObject.
|
static java.util.List |
getIdStrings(java.util.List objects)
Get a String representation for the objects in te lsit
|
java.lang.Object |
getLabel()
Get the Label object.
|
int |
hashCode()
Get the hashcode for this TwoFacedObject
|
void |
setId(java.lang.Object newId)
Sets the value of the Id object.
|
void |
setLabel(java.lang.Object newLabel)
Sets the value of the Label object.
|
static void |
sort(java.util.List list) |
java.lang.String |
toString()
String representation of this object.
|
public TwoFacedObject()
public TwoFacedObject(java.lang.Object label)
label - label and objectpublic TwoFacedObject(java.lang.Object label,
int id)
label - labelid - idpublic TwoFacedObject(java.lang.Object label,
java.lang.Object id)
label - object to use for labeling.id - other face of this objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Object getId()
public void setId(java.lang.Object newId)
newId - public java.lang.Object getLabel()
public void setLabel(java.lang.Object newLabel)
newLabel - public static java.lang.String getIdString(java.lang.Object o)
o - object in question.public static java.lang.Object getIdObject(java.lang.Object o)
o - object in question.public static java.util.List createList(int[] ids,
java.lang.String[] names)
ids - idsnames - namespublic static java.util.List createList(java.lang.String[] ids,
java.lang.String[] names)
ids - idsnames - namespublic static java.util.List getIdList(java.util.List objects)
objects - list of objectspublic static TwoFacedObject findId(java.lang.Object id, java.util.List l)
id - id to look forl - list of tfospublic static java.lang.String findLabel(java.lang.Object id,
java.util.List l)
id - object to search forl - list of TwoFacedObjects objectspublic static boolean contains(java.util.List objects,
java.lang.Object value)
public static java.util.List getIdStrings(java.util.List objects)
objects - objects in question.public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableo - object in question.public static void sort(java.util.List list)