| Modifier and Type | Field and Description |
|---|---|
| private Queue | |
| private static final String | |
| private static final String | |
| private final int | |
| private static final String | |
| private static final String | |
| private final Preferences |
| Access | Constructor and Description |
|---|---|
| public | RecentFiles(Class<?>
the class for which this Recentfiles object is created and it will be used
to create preference instance. className, int the number of recent files to remember. maximumFile)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private String[] | |
| public void | |
| public List | Returns: return the file paths in a List.This gives the file in descending order where order is according to the time it is added. |
| public boolean | Returns: if history is empty return true otherwise return false.Check if file history is empty. |
| private Queue | |
| public void | |
| public void | removeFile(String
path string to the file. this path means File#getPath() method returned String. path)Remove a file from recent file history. |
| private void |
| filePaths | back to summary |
|---|---|
| private Queue<String> filePaths | |
| HISTORY_LENGTH | back to summary |
|---|---|
| private static final String HISTORY_LENGTH | |
| KEY | back to summary |
|---|---|
| private static final String KEY | |
| maximum | back to summary |
|---|---|
| private final int maximum | |
| PATH_KEY | back to summary |
|---|---|
| private static final String PATH_KEY | |
| PIECES_LENGTH_KEY | back to summary |
|---|---|
| private static final String PIECES_LENGTH_KEY | |
| pref | back to summary |
|---|---|
| private final Preferences pref | |
| RecentFiles | back to summary |
|---|---|
| public RecentFiles(Class<?> className, int maximumFile) Constructor.
| |
| addFile | back to summary |
|---|---|
| public void addFile(String path) Add a new file in recent file history.
| |
| breakString | back to summary |
|---|---|
| private String[] breakString(String fullPath) | |
| close | back to summary |
|---|---|
| public void close() throws IOException This method save the present recent file history in the preference. To get the recent file history in next session this method must be called.
| |
| getFiles | back to summary |
|---|---|
| public List This gives the file in descending order where order is according to the time it is added. This checks for file's existence in file history. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Check if file history is empty.
| |
| readHistoryFromPref | back to summary |
|---|---|
| private Queue | |
| removeAll | back to summary |
|---|---|
| public void removeAll() Clear the previous recent file history. | |
| removeFile | back to summary |
|---|---|
| public void removeFile(String path) Remove a file from recent file history.
| |
| writeHistoryToPref | back to summary |
|---|---|
| private void writeHistoryToPref(Queue<String> filePaths) | |