Package adams.data

Class Notes

    • Constructor Detail

      • Notes

        public Notes()
        Initializes the notes.
    • Method Detail

      • clear

        public void clear()
        Removes all notes.
      • addNote

        public void addNote​(Class cls,
                            String note)
        Adds the given note under the specified classname. Skips duplicates.
        Parameters:
        cls - the class the note is for
        note - the note to add
      • addNote

        public void addNote​(String classname,
                            String note)
        Adds the given note under the specified classname. Skips duplicates.
        Parameters:
        classname - the class the note is for
        note - the note to add
      • addWarning

        public void addWarning​(Class cls,
                               String note)
        Adds the given warning under the specified classname. Skips duplicates.
        Parameters:
        cls - the class the note is for
        note - the warning to add
      • addWarning

        public void addWarning​(String classname,
                               String note)
        Adds the given warning under the specified classname. Skips duplicates.
        Parameters:
        classname - the class the note is for
        note - the warning to add
      • addError

        public void addError​(Class cls,
                             String note)
        Adds the given error under the specified classname. Skips duplicates.
        Parameters:
        cls - the class the note is for
        note - the error to add
      • addError

        public void addError​(String classname,
                             String note)
        Adds the given error under the specified classname. Skips duplicates.
        Parameters:
        classname - the class the note is for
        note - the error to add
      • addProcessInformation

        public void addProcessInformation​(Object obj)
        Adds the commandline from the given object as process information.
        Parameters:
        obj - the object to add its commandline to the process information
      • hasNotes

        public boolean hasNotes​(Class cls)
        Checks whether there are any notes for the given class available.
        Parameters:
        cls - the class to look for notes for
        Returns:
        true if notes are available
      • hasNotes

        public boolean hasNotes​(String classname)
        Checks whether there are any notes for the given class available.
        Parameters:
        classname - the class to look for notes for
        Returns:
        true if notes are available
      • hasWarning

        public boolean hasWarning()
        Checks whether at least one warning is among the notes.
        Returns:
        true if notes contain at least one warning
      • hasError

        public boolean hasError()
        Checks whether at least one error is among the notes.
        Returns:
        true if notes contain at least one error
      • hasProcessInformation

        public boolean hasProcessInformation()
        Checks whether at least one process information is among the notes.
        Returns:
        true if notes contain at least one process information
      • hasOthers

        public boolean hasOthers()
        Checks whether at least one other (not warning/error/proc.info) is among the notes.
        Returns:
        true if notes contain at least one other note
      • getNotes

        public List<String> getNotes​(Class cls)
        Returns the notes for the given class.
        Parameters:
        cls - the class to look for notes for
        Returns:
        the notes or null if not available
      • getNotes

        public List<String> getNotes​(String classname)
        Returns the notes for the given class.
        Parameters:
        classname - the class to look for notes for
        Returns:
        the notes or null if not available
      • getSubset

        public Notes getSubset​(String regex)
        Returns the subset for the given prefix.
        Parameters:
        regex - the regular expression that notes must match
        Returns:
        the subset
      • getWarnings

        public Notes getWarnings()
        Returns the warning subset.
        Returns:
        the warnings (if any)
      • getErrors

        public Notes getErrors()
        Returns the error subset.
        Returns:
        the errors (if any)
      • getPrefixSubset

        public Notes getPrefixSubset​(String prefix)
        Returns the subset for the given prefix, e.g., PROCESS_INFORMATION.
        Parameters:
        prefix - the prefix to return the subset for
        Returns:
        the subset (if any)
      • getProcessInformation

        public Notes getProcessInformation()
        Returns the process information subset.
        Returns:
        the process informations (if any)
      • getOthers

        public Notes getOthers()
        Returns the other notes, not warning/error/process information.
        Returns:
        the other notes (if any)
      • removeNotes

        public void removeNotes​(Class cls)
        Removes all notes for the given class.
        Parameters:
        cls - the class to remove the notes for
      • removeNotes

        public void removeNotes​(String classname)
        Removes all notes for the given class.
        Parameters:
        classname - the class to remove the notes for
      • notes

        public Iterator<String> notes()
        Returns an enumeration over all classes that have notes stored for at the moment.
        Returns:
        the enumeration
      • getClone

        public Notes getClone()
        Returns a deep copy of this object.
        Specified by:
        getClone in interface CloneHandler<Notes>
        Returns:
        the cloned object
      • mergeWith

        public void mergeWith​(Notes other)
        Merges the currently stored notes with the specified ones.
        Specified by:
        mergeWith in interface Mergeable<Notes>
        Parameters:
        other - the notes to merge with
      • union

        public Notes union​(Notes other)
        Merges the currently stored notes with the specified ones and returns the new notes (the current ones aren't changed).
        Parameters:
        other - the notes to merge with
        Returns:
        the union
      • minus

        public Notes minus​(Notes exclude)
        Returns all the notes after removing the provided ones.
        Parameters:
        exclude - the notes to exclude
        Returns:
        the remaining notes
      • size

        public int size()
        Returns the number of classes that have notes stored.
        Returns:
        the number of classes
      • equals

        public boolean equals​(Object o)
        Returns whether the notes are equal.
        Overrides:
        equals in class Object
        Parameters:
        o - the object to compare with
        Returns:
        true if the objects contain the same notes (in the same order)
      • hashCode

        public int hashCode()
        Returns the hashtable's hash code.
        Overrides:
        hashCode in class Object
        Returns:
        the hash code
      • toString

        public String toString()
        Returns a string representation of the notes.
        Overrides:
        toString in class Object
        Returns:
        the notes as string
      • main

        public static void main​(String[] args)
        For testing only.
        Parameters:
        args - ignored