public class ListItem extends Object implements Serializable, Comparable<ListItem>, Cloneable
ListModel.
Copyright 2006 Sans Pareil Technologies, Inc.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
selected
A flag indicating whether the
value is selected or not. |
protected String |
value
The item or value stored in the list.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ListItem()
Default constructor.
|
|
ListItem(String value)
Create a new instance of the bean using the specified object.
|
|
ListItem(String value,
boolean selected)
Designated constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Creates and returns a copy of this object.
|
int |
compareTo(ListItem item)
Implementation of the
Comparable interface. |
boolean |
equals(Object object)
Check the specified object with this object for equality.
|
boolean |
getSelected()
Returns
selected. |
String |
getValue()
Returns
value. |
int |
hashCode()
Return a hash code value for this object.
|
boolean |
isSelected()
Returns the status of
selected. |
void |
setSelected(boolean selected)
Set
selected. |
void |
setValue(String value)
Set
value. |
String |
toString()
Return a string representation of this object.
|
protected String value
protected boolean selected
value is selected or not.protected ListItem()
public ListItem(String value)
selected to false for the
specified object.value - The value to set.public String toString()
public boolean equals(Object object)
public int hashCode()
public int compareTo(ListItem item)
Comparable interface.
Compares this object with the specified object for order. Returns
a negative integer, zero, or a positive integer as this object is
less than, equal to, or greater than the specified object.
The comparison is done by comparing the hashCode() values
of the objects.compareTo in interface Comparable<ListItem>item - - The object with which this class is to
be compared.public Object clone() throws CloneNotSupportedException
Cloneable interface. No special actions are
performed. This method simply allows public access to the
Object.clone method.clone in class ObjectCloneNotSupportedException - If the super-class
implementation throws an error.public final String getValue()
value.public final boolean getSelected()
selected.public final boolean isSelected()
selected.public void setSelected(boolean selected)
selected.selected - The value to set.