Package org.apache.uima.tools.cvd
Class RecentFilesList
java.lang.Object
org.apache.uima.tools.cvd.RecentFilesList
List of recently used files.
Provides functionality to keep a list of a certain max size. New files are added to the top. When a file is added that is already in the list, it is shuffled to the top. When the maximum list size has been reached, files start dropping off the end.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a file at the beginning.void
appendFile
(File file) Append a file at the end of the list (useful for initialization).Get the internal list of files, in the proper order (most recent first).Return the file list as a list of strings for persistence.
-
Constructor Details
-
RecentFilesList
public RecentFilesList(int maxSize) Constructor.- Parameters:
maxSize
- The maximum size to which the list can grow.
-
-
Method Details
-
getFileList
Get the internal list of files, in the proper order (most recent first).- Returns:
- A recency-sorted list of files.
-
appendFile
Append a file at the end of the list (useful for initialization).- Parameters:
file
- The file to be added.
-
addFile
Add a file at the beginning. If maximum capacity is exceeded, drop last file. Iffile
is already in the list, move it to the front.- Parameters:
file
- The file to be added.
-
toStringList
Return the file list as a list of strings for persistence.- Returns:
- The file list as a list of absolute file names.
-