|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.AbstractSequentialList<E> java.util.LinkedList<java.lang.String> mk.fsgrep.util.MRUList
public class MRUList
Most recently used list. A list ordered by recent use where the first element is the most recently used entry. It also trims itself to a maximum size.
Field Summary | |
---|---|
static int |
MAX_SIZE
The maximum number of recent items kept when saved. |
protected static java.lang.String |
UNDEFINED_PREFIX
Constant representing an undefined persistent map prefix (the default). |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
MRUList()
|
|
MRUList(int pSize,
java.lang.String pPrefix)
|
|
MRUList(java.lang.String pPrefix)
|
Method Summary | |
---|---|
boolean |
add(java.lang.String entry)
|
int |
getMaxSize()
|
protected java.lang.String |
getPrefix()
|
void |
keepFirst()
Remove all items except the first one. |
void |
readData()
Read the stored profiles from the persistent data. |
void |
readData(java.lang.String pPrefix)
Read the stored profiles from the persistent data using the given persistent map prefix. |
void |
saveData()
Saves the state of this object to the persistent store. |
void |
setMaxSize(int val)
|
protected void |
trim()
Trim the number of entries to the maximum size by removing the older elements. |
Methods inherited from class java.util.LinkedList |
---|
add, addAll, addAll, addFirst, addLast, clear, clone, contains, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, peek, poll, remove, remove, remove, removeFirst, removeLast, set, size, toArray, toArray |
Methods inherited from class java.util.AbstractSequentialList |
---|
iterator |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, listIterator, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, isEmpty, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
Field Detail |
---|
public static final int MAX_SIZE
protected static final java.lang.String UNDEFINED_PREFIX
Constructor Detail |
---|
public MRUList()
public MRUList(java.lang.String pPrefix)
public MRUList(int pSize, java.lang.String pPrefix)
Method Detail |
---|
public int getMaxSize()
protected java.lang.String getPrefix()
public void setMaxSize(int val)
protected void trim()
public void saveData()
public void readData(java.lang.String pPrefix)
pPrefix
- The string prefix of the desired entries.public void readData()
public void keepFirst()
public boolean add(java.lang.String entry)
add
in interface java.util.Collection<java.lang.String>
add
in interface java.util.List<java.lang.String>
add
in class java.util.LinkedList<java.lang.String>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |