|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractListModel
ilog.cpl.list.IlpDefaultListModel
public class IlpDefaultListModel
ILOG CPL list model.
This list extends the Swing DefaultListModel. It recognizes
the representation objects that are inserted and listens to their
notifications, changing the AttributeValueEvents into regular
ListDataEvents.
IlpRepresentationObject,
AttributeValueEvent,
Serialized Form| Field Summary |
|---|
| Fields inherited from class javax.swing.AbstractListModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
IlpDefaultListModel()
Default constructor |
|
IlpDefaultListModel(boolean listeningToAttributeValueChange)
Creates a new model instance. |
|
| Method Summary | |
|---|---|
void |
add(int index,
Object o)
Inserts the specified element at the specified position in this list. |
boolean |
add(Object o)
Appends the specified element to this list (optional operation). |
void |
addAll(Collection collection)
Adds the specified collection of elements at the end of this list. |
void |
attributeValueChange(AttributeValueEvent ev)
This method is called when an attribute value is changed. |
void |
clear()
Removes all of the elements from this list. |
Object |
get(int index)
Returns the value at the specified index. |
Object |
getElementAt(int index)
Returns the value at the specified index. |
int |
getSize()
Returns the length of the list. |
int |
indexOf(Object o)
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element. |
int |
lastIndexOf(Object o)
Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element. |
Object |
remove(int index)
Removes the element at the specified position in this list. |
boolean |
remove(Object o)
Removes the first occurrence in this list of the specified element (optional operation). |
void |
removeRange(int fromIndex,
int toIndex)
Deletes the components at the specified range of indexes. |
Object |
set(int index,
Object o)
Replaces the element at the specified position in this list with the specified element. |
int |
size()
Returns the length of the list. |
| Methods inherited from class javax.swing.AbstractListModel |
|---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.swing.ListModel |
|---|
addListDataListener, removeListDataListener |
| Constructor Detail |
|---|
public IlpDefaultListModel()
public IlpDefaultListModel(boolean listeningToAttributeValueChange)
listeningToAttributeValueChange - Indicates that this model will
listen to attribute value change
events on its contained objects.| Method Detail |
|---|
public int getSize()
getSize in interface ListModelpublic int size()
public Object getElementAt(int index)
getElementAt in interface ListModelpublic Object get(int index)
public void attributeValueChange(AttributeValueEvent ev)
attributeValueChange in interface AttributeValueListener
public Object set(int index,
Object o)
index - Index of element to replace.o - Object to be stored at the specified position.
IndexOutOfBoundsException - if the index is out of range
(index < 0 || index >= size()).public boolean add(Object o)
o - Element to be appended to this list.
true (according to the general contract of the
Collection.add method).
public void add(int index,
Object o)
index - index at which the specified element is to be inserted.o - object to be inserted.
IndexOutOfBoundsException - if the index is out of range
(index < 0 || index >= size()).public Object remove(int index)
Throws an IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size()).
index - the index of the element to removed.public boolean remove(Object o)
(o==null ? get(i)==null : o.equals(get(i))) (if
such an element exists).
o - Element to be removed from this list, if present.
true if this list contained the specified element.
UnsupportedOperationException - if the remove method is
not supported by this list.public void clear()
public void removeRange(int fromIndex,
int toIndex)
fromIndex - The index of the lower end of the range.toIndex - The index of the upper end of the range.
IndexOutOfBoundsException - if the index was invalid.
IllegalArgumentException - if fromIndex
> toIndex.remove(int)public void addAll(Collection collection)
public int indexOf(Object o)
-1 if this list does not contain this element.
More formally, returns the lowest index i such that
(o==null ? get(i)==null : o.equals(get(i))),
or -1 if there is no such index.
o - Element to search for.
-1 if this list does not contain this element.public int lastIndexOf(Object o)
-1 if this list does not contain this element.
More formally, returns the highest index i such that
(o==null ? get(i)==null : o.equals(get(i))),
or -1 if there is no such index.
o - Element to search for.
-1 if this list does not contain this element.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||