Package warnings

Class WarningSystem

java.lang.Object
warnings.WarningSystem

public class WarningSystem extends Object
System for handling and displaying warnings and errors from various parts of PAMguard.
Author:
Douglas Gillespie
  • Method Details

    • getLastWarning

      public PamWarning getLastWarning()
      Get the last listed warning
      Returns:
      last warning of null
    • getWarningSystem

      public static WarningSystem getWarningSystem()
      Get reference to singleton WarningSystem
      Returns:
      Wanring System.
    • addWarning

      public void addWarning(PamWarning warning)
      Add a warning, will remove first if the same one is already in there.
      Parameters:
      warning - Warning to add.
    • getListIterator

      public ListIterator<PamWarning> getListIterator()
      Get an iterator over the warnings list. Any display using this list should place code in a block Synchronized on the WarningSystem to avoid concurrent modification exceptions.
      Returns:
      list iterator.
    • getNumbWarnings

      public int getNumbWarnings()
      Get the current number of warnigns in the list.
      Returns:
      number of warnings.
    • removeWarning

      public boolean removeWarning(PamWarning warning)
      Remove a warning
      Parameters:
      warning - warning to remove
      Returns:
      true if the warnign existed in the warnings list
    • updateWarning

      public void updateWarning(PamWarning warning)
      Update an existing warning
      Parameters:
      warning - warning to update
    • addDisplay

      public void addDisplay(WarningDisplay display)
      Add a warning display
      Parameters:
      display - warning display
    • removeDisplay

      public boolean removeDisplay(WarningDisplay display)
      Remove a warning display
      Parameters:
      display - display to remove
      Returns:
      true if the display existed and was removed from the display list
    • getWarning

      public PamWarning getWarning(int warningIndex)
      Get a specified warning
      Parameters:
      warningIndex - index of warning in list.
      Returns:
      warning or null