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_Notes
the notes per directory.protected static NotesManager
m_Singleton
the singleton.
-
Constructor Summary
Constructors Modifier Constructor Description protected
NotesManager()
Initializes the notes manager.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNote(String dir, String file, String note)
Sets the note for the file in the specified directory.void
clear()
Clears all notes globally.void
clear(String dir)
Removes the notes for the specified directory.String
getNote(String dir, String file)
Returns the note for the file.Map<String,String>
getNotes(String dir)
Returns the notes for the specified directory.static NotesManager
getSingleton()
Returns the notes manager singleton.boolean
hasNote(String dir, String file)
Checks whether a note is available for the file.boolean
hasNotes()
Checks whether any notes are available at all.boolean
hasNotes(String dir)
Checks whether any notes are available for the specified directory.void
removeNote(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
-
-