Class NotesManager
- java.lang.Object
-
- adams.gui.tools.previewbrowser.notes.NotesManager
-
public class NotesManager extends Object
Global notes manager.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Map<String,String>>m_Notesthe notes per directory.protected static NotesManagerm_Singletonthe singleton.
-
Constructor Summary
Constructors Modifier Constructor Description protectedNotesManager()Initializes the notes manager.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNote(String dir, String file, String note)Sets the note for the file in the specified directory.voidclear()Clears all notes globally.voidclear(String dir)Removes the notes for the specified directory.StringgetNote(String dir, String file)Returns the note for the file.Map<String,String>getNotes(String dir)Returns the notes for the specified directory.static NotesManagergetSingleton()Returns the notes manager singleton.booleanhasNote(String dir, String file)Checks whether a note is available for the file.booleanhasNotes()Checks whether any notes are available at all.booleanhasNotes(String dir)Checks whether any notes are available for the specified directory.voidremoveNote(String dir, String file)Removes the note for the file in the specified directory.
-
-
-
Method Detail
-
clear
public void clear()
Clears all notes globally.
-
clear
public void clear(String dir)
Removes the notes for the specified directory.- Parameters:
dir- the directory to remove the notes for
-
addNote
public void addNote(String dir, String file, String note)
Sets the note for the file in the specified directory.- Parameters:
dir- the directory the file resides in (absolute path)file- the file to add the note for (no path)note- the note to add
-
removeNote
public void removeNote(String dir, String file)
Removes the note for the file in the specified directory.- Parameters:
dir- the directory the file resides in (absolute path)file- the file to add the note for (no path)
-
hasNote
public boolean hasNote(String dir, String file)
Checks whether a note is available for the file.- Parameters:
dir- the directory the file resides in (absolute path)file- the file to check for a note (no path)- Returns:
- true if note present
-
getNote
public String getNote(String dir, String file)
Returns the note for the file.- Parameters:
dir- the directory the file resides in (absolute path)file- the file to get the note for (no path)- Returns:
- the note, null if none available
-
hasNotes
public boolean hasNotes()
Checks whether any notes are available at all.- Returns:
- true if notes available
-
hasNotes
public boolean hasNotes(String dir)
Checks whether any notes are available for the specified directory.- Parameters:
dir- the directory to check- Returns:
- true if notes available
-
getNotes
public Map<String,String> getNotes(String dir)
Returns the notes for the specified directory.- Parameters:
dir- the directory to return the notes for- Returns:
- the notes, null if none available
-
getSingleton
public static NotesManager getSingleton()
Returns the notes manager singleton.- Returns:
- the singleton
-
-