|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.echo2.ListItem
public class ListItem
A simple bean that represents an item that can be added to a
ListModel.
Copyright 2006 Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
protected boolean |
selected
A flag indicating whether the value is selected or not. |
protected java.lang.String |
value
The item or value stored in the list. |
| Constructor Summary | |
|---|---|
protected |
ListItem()
Default constructor. |
|
ListItem(java.lang.String value)
Create a new instance of the bean using the specified object. |
|
ListItem(java.lang.String value,
boolean selected)
Designated constructor. |
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Creates and returns a copy of this object. |
int |
compareTo(ListItem item)
Implementation of the Comparable interface. |
boolean |
equals(java.lang.Object object)
Check the specified object with this object for equality. |
boolean |
getSelected()
Returns selected. |
java.lang.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(java.lang.String value)
Set value. |
java.lang.String |
toString()
Return a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String value
protected boolean selected
value is selected or not.
| Constructor Detail |
|---|
protected ListItem()
public ListItem(java.lang.String value)
selected to false for the
specified object.
value - The value to set.
public ListItem(java.lang.String value,
boolean selected)
value - The value to set.selected - The selected value to set.| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectobject - The object that is to be checked for equality with.
true if the object is of the
same type as this object and has the same field values.public int hashCode()
hashCode in class java.lang.Objectpublic 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 java.lang.Comparable<ListItem>item - - The object with which this class is to
be compared.
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
Cloneable interface. No special actions are
performed. This method simply allows public access to the
Object.clone method.
clone in class java.lang.Objectjava.lang.CloneNotSupportedException - If the super-class
implementation throws an error.public final java.lang.String getValue()
value.
public void setValue(java.lang.String value)
value.
value - The value to set.public final boolean getSelected()
selected.
public final boolean isSelected()
selected.
public void setSelected(boolean selected)
selected.
selected - The value to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||