de.matthiasmann.twl.model
Interface MRUListModel<T>

Type Parameters:
T - the data type stored in this MRU model
All Superinterfaces:
ListModel<T>
All Known Implementing Classes:
PersistentMRUListModel, SimpleMRUListModel

public interface MRUListModel<T>
extends ListModel<T>

A generic MRU (most recently used) list model.


Nested Class Summary
 
Nested classes/interfaces inherited from interface de.matthiasmann.twl.model.ListModel
ListModel.ChangeListener
 
Method Summary
 void addChangeListener(ListModel.ChangeListener listener)
           
 void addEntry(T entry)
          Adds an entry to this MRU model.
 T getEntry(int index)
           
 int getMaxEntries()
          Returns the maximum number of entries stored in this MRU list
 int getNumEntries()
           
 void removeChangeListener(ListModel.ChangeListener listener)
           
 void removeEntry(int index)
          Removes the entry at the given index
 
Methods inherited from interface de.matthiasmann.twl.model.ListModel
getEntryTooltip, matchPrefix
 

Method Detail

getMaxEntries

int getMaxEntries()
Returns the maximum number of entries stored in this MRU list

Returns:
the maximum number of entries stored in this MRU list

getNumEntries

int getNumEntries()
Specified by:
getNumEntries in interface ListModel<T>

getEntry

T getEntry(int index)
Specified by:
getEntry in interface ListModel<T>

addEntry

void addEntry(T entry)
Adds an entry to this MRU model. If the entry is already in the MRU list, then it is moved to the from.

Parameters:
entry - the entry
See Also:
Object.equals(java.lang.Object)

removeEntry

void removeEntry(int index)
Removes the entry at the given index

Parameters:
index -

addChangeListener

void addChangeListener(ListModel.ChangeListener listener)
Specified by:
addChangeListener in interface ListModel<T>

removeChangeListener

void removeChangeListener(ListModel.ChangeListener listener)
Specified by:
removeChangeListener in interface ListModel<T>