charvax.swing

Class DefaultListModel

Implemented Interfaces:
ListModel

public class DefaultListModel
extends AbstractListModel
implements ListModel

This class implements the Vector API. It actually delegates to an ArrayList.

Field Summary

Fields inherited from class charvax.swing.AbstractListModel

_listeners

Constructor Summary

DefaultListModel()
Default constructor

Method Summary

void
add(int index_, Object elem_)
Inserts the specified object at the specified position in this list.
void
addElement(Object obj_)
Add the specified object to the end of the list.
void
clear()
Clear the contents of the list.
boolean
contains(Object elem_)
Returns true if the specified element is in the list.
Object
getElementAt(int index_)
Returns the value at the specified index.
int
getSize()
Returns the length of the list.
int
indexOf(Object elem_)
Returns the index of the first occurrence of the specified object.
void
removeAllElements()
Removes all elements from this list and sets its size to zero.
void
removeElementAt(int index_)
Deletes the component at the specified index.

Methods inherited from class charvax.swing.AbstractListModel

addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, removeListDataListener

Constructor Details

DefaultListModel

public DefaultListModel()
Default constructor

Method Details

add

public void add(int index_,
                Object elem_)
Inserts the specified object at the specified position in this list.

addElement

public void addElement(Object obj_)
Add the specified object to the end of the list.

clear

public void clear()
Clear the contents of the list.

contains

public boolean contains(Object elem_)
Returns true if the specified element is in the list.

getElementAt

public Object getElementAt(int index_)
Returns the value at the specified index.
Specified by:
getElementAt in interface ListModel

getSize

public int getSize()
Returns the length of the list.
Specified by:
getSize in interface ListModel

indexOf

public int indexOf(Object elem_)
Returns the index of the first occurrence of the specified object.

removeAllElements

public void removeAllElements()
Removes all elements from this list and sets its size to zero.

removeElementAt

public void removeElementAt(int index_)
Deletes the component at the specified index.