home *** CD-ROM | disk | FTP | other *** search
- package netscape.palomar.util;
-
- import java.util.Enumeration;
- import java.util.Vector;
-
- public class WarningList {
- private Vector _warningList = new Vector();
- public int _warningListSize;
-
- public WarningList(int newSize) {
- this._warningListSize = newSize;
- }
-
- public void addWarning(Warning newWarning) {
- this._warningList.addElement(newWarning);
-
- while(this._warningList.size() > this._warningListSize) {
- this._warningList.removeElementAt(0);
- }
-
- System.out.println("------------------");
- System.out.println(newWarning.toString());
- System.out.println("------------------");
- }
-
- public void addNewWarning(int id, Exception e) {
- while(this._warningList.size() > this._warningListSize) {
- this._warningList.removeElementAt(0);
- }
-
- this._warningList.addElement(new Warning(id, e));
- }
-
- public void removeWarning(Warning newWarning) {
- this._warningList.removeElement(newWarning);
- }
-
- public void removeAllWarnings() {
- this._warningList.removeAllElements();
- }
-
- public Enumeration getWarnings() {
- return this._warningList.elements();
- }
- }
-