Class NotesManager


  • public class NotesManager
    extends Object
    Global notes manager.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • NotesManager

        protected NotesManager()
        Initializes the notes manager.
    • 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