pla.list
Class PLAListModel
java.lang.Object
javax.swing.AbstractListModel
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
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PLAListModel
public PLAListModel()
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 datacaseSensitive - Match given name in case sensitive manner to datastart - 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 namestart - 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)