Package warnings
Class WarningSystem
java.lang.Object
warnings.WarningSystem
System for handling and displaying warnings and errors from various parts of PAMguard.
- Author:
- Douglas Gillespie
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDisplay
(WarningDisplay display) Add a warning displayvoid
addWarning
(PamWarning warning) Add a warning, will remove first if the same one is already in there.Get the last listed warningGet an iterator over the warnings list.int
Get the current number of warnigns in the list.getWarning
(int warningIndex) Get a specified warningstatic WarningSystem
Get reference to singleton WarningSystemboolean
removeDisplay
(WarningDisplay display) Remove a warning displayboolean
removeWarning
(PamWarning warning) Remove a warningvoid
updateWarning
(PamWarning warning) Update an existing warning
-
Method Details
-
getLastWarning
Get the last listed warning- Returns:
- last warning of null
-
getWarningSystem
Get reference to singleton WarningSystem- Returns:
- Wanring System.
-
addWarning
Add a warning, will remove first if the same one is already in there.- Parameters:
warning
- Warning to add.
-
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
Remove a warning- Parameters:
warning
- warning to remove- Returns:
- true if the warnign existed in the warnings list
-
updateWarning
Update an existing warning- Parameters:
warning
- warning to update
-
addDisplay
Add a warning display- Parameters:
display
- warning display
-
removeDisplay
Remove a warning display- Parameters:
display
- display to remove- Returns:
- true if the display existed and was removed from the display list
-
getWarning
Get a specified warning- Parameters:
warningIndex
- index of warning in list.- Returns:
- warning or null
-