MOEA Framework 2.1
API Specification

org.moeaframework.analysis.diagnostics
Class SortedListModel<T extends Comparable<T>>

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by org.moeaframework.analysis.diagnostics.SortedListModel<T>
Type Parameters:
T - the type of entry stored in this list model
All Implemented Interfaces:
Serializable, ListModel

public class SortedListModel<T extends Comparable<T>>
extends AbstractListModel

A sorted ListModel which stores only unique entries.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
SortedListModel()
          Constructs a new sorted list model.
 
Method Summary
 void add(T item)
          Adds the specified item to this list model.
 void addAll(Collection<? extends T> collection)
          Adds all items contained in this collection to this list model.
 void clear()
          Clears this list model.
 T getElementAt(int index)
          Returns the value at the specified index.
 int getIndexOf(T item)
          Returns the index of the specified item in this list model.
 int getSize()
          Returns the length of the list.
 void remove(T item)
          Removes the specified item from this list model.
 
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
 

Constructor Detail

SortedListModel

public SortedListModel()
Constructs a new sorted list model.

Method Detail

remove

public void remove(T item)
Removes the specified item from this list model.

Parameters:
item - the item to remove from this list model

clear

public void clear()
Clears this list model.


add

public void add(T item)
Adds the specified item to this list model. If the item already exists, the list model is unchanged.

Parameters:
item - the item to add to this list model

addAll

public void addAll(Collection<? extends T> collection)
Adds all items contained in this collection to this list model. This method is implemented by invoking add(Comparable).

Parameters:
collection - the collection of items to add to this list model

getIndexOf

public int getIndexOf(T item)
Returns the index of the specified item in this list model.

Parameters:
item - the item whose index is returned
Returns:
the index of the specified item in this list model

getSize

public int getSize()
Description copied from interface: javax.swing.ListModel
Returns the length of the list.

Returns:
the length of the list

getElementAt

public T getElementAt(int index)
Description copied from interface: javax.swing.ListModel
Returns the value at the specified index.

Parameters:
index - the requested index
Returns:
the value at index

MOEA Framework 2.1
API Specification

Copyright 2009-2014 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Hosted by Get MOEA Framework at SourceForge.net. Fast, secure and Free Open Source software downloads