PathwayLogic Assistant API

pla.list
Class PLAListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by pla.list.PLAListModel
All Implemented Interfaces:
Serializable, ListModel

public class PLAListModel
extends AbstractListModel

Custom implementation of list model that serves for accessing elements in their natural order.

Author:
linda
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
PLAListModel()
           
 
Method Summary
 Object getElementAt(int i)
           
 int getSize()
           
 int indexOfCompletion(String prefix, int start)
          Search for the first occurrence of an object, whose name has a partial name (partial names are tokens within the name separated by '(', ':', or ')' such as complexes) that begins with the given prefix (case insensitive).
 int indexOfName(String name, boolean caseSensitive, int start)
          Searches for the first occurrence of an object with the given name from the given starting index.
 void setData(List list)
          Update data from given 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
 

Constructor Detail

PLAListModel

public PLAListModel()
Method Detail

setData

public void setData(List list)
Update data from given list. This erases all previous entries and adds new entries in their natural order. If NULL is given, treats this as if the list is empty.

Parameters:
list - List of items in this model (can be NULL)

indexOfName

public int indexOfName(String name,
                       boolean caseSensitive,
                       int start)
Searches for the first occurrence of an object with the given name from the given starting index.

Parameters:
name - String to be used to find a NodeThing in data
caseSensitive - Match given name in case sensitive manner to data
start - Index to start looking from
Returns:
Index of the first occurrence of an object with given name or -1 if no such object is found or if start index lies outside of boundaries (< 0 or > length of list)

indexOfCompletion

public int indexOfCompletion(String prefix,
                             int start)
Search for the first occurrence of an object, whose name has a partial name (partial names are tokens within the name separated by '(', ':', or ')' such as complexes) that begins with the given prefix (case insensitive). For example, a name "(4Ebp1:Eif4e)-CLc" matches "4ebp" or "eif" (note: case insensitive). Returns -1 if no such object is found or if NULL or empty String is given. Searches from the given starting position skipping the first elements.

Parameters:
prefix - String that is beginning part of name
start - Index to start looking from (must not be < 0 or > length of list)
Returns:
index of the first occurrence of an object with given prefix being beginning of its name or -1 if no such object is found

getSize

public int getSize()

getElementAt

public Object getElementAt(int i)

PathwayLogic Assistant API