ListItem Class

ListItem Class

This Package | All Packages

public class ListItem

Manages items in a listview.

Methods
Name Description
equals(Object obj) Returns whether two list items are equal.
getData() Returns data handle associated with this list item.
getImageIndex() Returns the ListItem's currently set image index.
getIndex() Returns ListItem's current index in the listview.
getListView() Returns the ListView associated with this ListItem.
getRect() Returns the ListItems bounding rectangle.
getSubItem(int index) Returns a specific subitem for this ListItem.
getSubItemCount() Returns the number of subitems in this ListItem.
getSubItems() Returns SubItem array.
getText() Returns text associated with this ListItem.
hashCode() Topic under construction.
setData(int data) Sets a new data handle for this ListItem.
setImageIndex(int image) Sets the image index for this item.
setSubItem(int index, String text) Sets SubItem text string to this ListItem at the given index.
setSubItems(String[] subItems) Sets the internal SubItems array to the new array and sets the ListView to match accordingly.
setText(String text) Sets the text for this ListItem.
toString() Topic under construction.

Methods

ListItem.equals

Syntax
public boolean equals( Object obj );
Parameters
li
ListItem to test against.
Description

Returns whether two list items are equal.

ListItem.getData

Syntax
public int getData();
Return Value

Returns a previously set data handle.

Description

Returns data handle associated with this list item.

ListItem.getImageIndex

Syntax
public int getImageIndex();
Return Value

Returns an image index.

Description

Returns the ListItem's currently set image index.

ListItem.getIndex

Syntax
public int getIndex();
Return Value

Returns the ListItem's index in ListView.

Description

Returns ListItem's current index in the listview.

ListItem.getListView

Syntax
public ListView getListView();
Return Value

Returns ListView associated with this item.

Description

Returns the ListView associated with this ListItem.

ListItem.getRect

Syntax
public Rectangle getRect();
Return Value

Returns the rectangle associated with the ListItem.

Description

Returns the ListItems bounding rectangle.

ListItem.getSubItem

Syntax
public String getSubItem( int index );
Return Value

Returns the text of selected subitem

Description

Returns a specific subitem for this ListItem.

Exceptions

IllegalArgumentException hrown if SubItem index is out of bounds.

ListItem.getSubItemCount

Syntax
public int getSubItemCount();
Return Value

Returns the count of SubItems.

Description

Returns the number of subitems in this ListItem.

ListItem.getSubItems

Syntax
public String[] getSubItems();
Return Value

Returns SubItem array.

Description

Returns SubItem array.

ListItem.getText

Syntax
public String getText();
Return Value

Returns ListItem's text.

Description

Returns text associated with this ListItem.

ListItem.hashCode

Syntax
public int hashCode();
Description

Topic under construction.

ListItem.setData

Syntax
public void setData( int data );
Parameters
data
handle for the data to be saved with this ListItem.
Description

Sets a new data handle for this ListItem.

ListItem.setImageIndex

Syntax
public void setImageIndex( int image );
Parameters
image
Index in the ListView's imagelist.
Description

Sets the image index for this item.

ListItem.setSubItem

Syntax
public void setSubItem( int index, String text );
Parameters
index
Index to set SubItem at.
text
Text of the subitem to set.
Description

Sets SubItem text string to this ListItem at the given index. If index greater than or equal to SubItemCount, then the SubItem array is grown to match the index. Anything in between the old array bounds and the new is declared as null.

Exceptions

IllegalArgumentException thrown if Index is less than 0 or if Index is greater than the number of current columns in the ListView.

ListItem.setSubItems

Syntax
public void setSubItems( String[] subItems );
Parameters
subItems
Array of strings representing the text for the new subitems.
Description

Sets the internal SubItems array to the new array and sets the ListView to match accordingly.

Exceptions

IllegalArgumentException thrown if the number of subitems in new array greater than the number of current columns in the ListView.

ListItem.setText

Syntax
public void setText( String text );
Parameters
txt
Text to set to this ListItem.
Description

Sets the text for this ListItem.

ListItem.toString

Syntax
public String toString();
Description

Topic under construction.