com.xpn.xwiki.objects.classes
Class ListItem

java.lang.Object
  extended by com.xpn.xwiki.objects.classes.ListItem

public class ListItem
extends Object

An entry in a List or in a Tree.

Version:
$Id: ce435b5d16c826c36c6086b2779e14fe218bdc55 $

Field Summary
protected static Comparator<ListItem> ID_COMPARATOR
          Comparator that orders list items on their identifiers, keeping null items at the end.
protected static Comparator<ListItem> VALUE_COMPARATOR
          Comparator that orders list items on their values, keeping null items at the end.
 
Constructor Summary
ListItem(String id)
          Constructor that initializes both the internal ID and the displayed value with the same value, leaving the parent field empty.
ListItem(String id, String value)
          Constructor that initializes the internal ID and the displayed value, leaving the parent field empty.
ListItem(String id, String value, String parent)
          Constructor that initializes all of the internal ID, the displayed value, and the parent fields.
 
Method Summary
 String getId()
           
 String getParent()
           
 String getValue()
           
 void setId(String id)
           
 void setParent(String parent)
           
 void setValue(String value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID_COMPARATOR

protected static final Comparator<ListItem> ID_COMPARATOR
Comparator that orders list items on their identifiers, keeping null items at the end.


VALUE_COMPARATOR

protected static final Comparator<ListItem> VALUE_COMPARATOR
Comparator that orders list items on their values, keeping null items at the end.

Constructor Detail

ListItem

public ListItem(String id)
Constructor that initializes both the internal ID and the displayed value with the same value, leaving the parent field empty.

Parameters:
id - the value to use for the id and the displayed value

ListItem

public ListItem(String id,
                String value)
Constructor that initializes the internal ID and the displayed value, leaving the parent field empty.

Parameters:
id - the value to use for the internal id
value - the value to use for the displayed value

ListItem

public ListItem(String id,
                String value,
                String parent)
Constructor that initializes all of the internal ID, the displayed value, and the parent fields.

Parameters:
id - the value to use for the internal id
value - the value to use for the displayed value
parent - the value to use for the item's parent
Method Detail

getId

public String getId()

setId

public void setId(String id)

getValue

public String getValue()

setValue

public void setValue(String value)

getParent

public String getParent()

setParent

public void setParent(String parent)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2013 XWiki. All Rights Reserved.