public final class LabeledValue extends Object
toString()
returns of course the label.
For use in JComboBoxes and in JLists.Modifier and Type | Class and Description |
---|---|
static class |
LabeledValue.CompareByLabel |
Modifier and Type | Field and Description |
---|---|
static LabeledValue.CompareByLabel |
compareByLabel |
String |
label |
Object |
value |
Constructor and Description |
---|
LabeledValue(Object value)
Constructs a LabeledValue using
value.toString()
as a label for specified value object. |
LabeledValue(String label,
boolean b) |
LabeledValue(String label,
char c) |
LabeledValue(String label,
double d) |
LabeledValue(String label,
int i) |
LabeledValue(String label,
long l) |
LabeledValue(String label,
Object value) |
Modifier and Type | Method and Description |
---|---|
boolean |
booleanValue() |
char |
charValue() |
double |
doubleValue() |
boolean |
equals(Object other) |
int |
hashCode() |
static int |
indexOfValue(LabeledValue[] list,
boolean b) |
static int |
indexOfValue(LabeledValue[] list,
char c) |
static int |
indexOfValue(LabeledValue[] list,
double d) |
static int |
indexOfValue(LabeledValue[] list,
int i) |
static int |
indexOfValue(LabeledValue[] list,
long l) |
static int |
indexOfValue(LabeledValue[] list,
Object value) |
int |
intValue() |
long |
longValue() |
String |
stringValue() |
String |
toString() |
public static final LabeledValue.CompareByLabel compareByLabel
public final String label
public final Object value
public LabeledValue(String label, boolean b)
public LabeledValue(String label, char c)
public LabeledValue(String label, int i)
public LabeledValue(String label, long l)
public LabeledValue(String label, double d)
public LabeledValue(Object value)
value.toString()
as a label for specified value object.
This constructor is useful for an application wishing to use LabeledValue for all types of values.
public boolean booleanValue()
public char charValue()
public int intValue()
public long longValue()
public double doubleValue()
public String stringValue()
public static int indexOfValue(LabeledValue[] list, boolean b)
public static int indexOfValue(LabeledValue[] list, char c)
public static int indexOfValue(LabeledValue[] list, int i)
public static int indexOfValue(LabeledValue[] list, long l)
public static int indexOfValue(LabeledValue[] list, double d)
public static int indexOfValue(LabeledValue[] list, Object value)