public class RecentFilesList extends Object
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 and Description |
---|
RecentFilesList(int maxSize)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addFile(File file)
Add a file at the beginning.
|
void |
appendFile(File file)
Append a file at the end of the list (useful for initialization).
|
List<File> |
getFileList()
Get the internal list of files, in the proper order (most recent first).
|
List<String> |
toStringList()
Return the file list as a list of strings for persistence.
|
public RecentFilesList(int maxSize)
maxSize
- The maximum size to which the list can grow.public List<File> getFileList()
public void appendFile(File file)
file
- The file to be added.public void addFile(File file)
file
is already in the list, move it to the front.file
- The file to be added.Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.