net.sf.latexdraw.badaboom
Class BadaboomCollector

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<java.lang.Throwable>
              extended by net.sf.latexdraw.badaboom.BadaboomCollector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Throwable>, java.lang.Thread.UncaughtExceptionHandler, java.util.Collection<java.lang.Throwable>, java.util.List<java.lang.Throwable>, java.util.RandomAccess, ErrorNotifier

public final class BadaboomCollector
extends java.util.ArrayList<java.lang.Throwable>
implements java.lang.Thread.UncaughtExceptionHandler, ErrorNotifier

Defines an error collector.

This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN

LaTeXDraw is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

02/18/2008

Since:
3.0
Version:
3.0
Author:
Arnaud BLOUIN
See Also:
Serialized Form

Field Summary
private  java.util.List<BadaboomHandler> handlers
          Contains objects that want to be aware of the manager activities.
static BadaboomCollector INSTANCE
          The singleton.
private static long serialVersionUID
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
private BadaboomCollector()
          Creates an empty collector.
 
Method Summary
 void add(int index, java.lang.Throwable ex)
           
 boolean add(java.lang.Throwable ex)
           
 void addHandler(BadaboomHandler handler)
          Adds a handler to the manager.
protected  void notifyHandlers(java.lang.Throwable error)
          Notifies the handlers that an event occurred.
 void onMalaiException(java.lang.Exception exception)
          Notifies that an exception has been thrown in the Malai code.
 void removeHandler(BadaboomHandler handler)
          Removes the given handler of the manager.
 java.lang.Throwable set(int pos, java.lang.Throwable ex)
           
 void uncaughtException(java.lang.Thread t, java.lang.Throwable e)
           
 
Methods inherited from class java.util.ArrayList
addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

INSTANCE

public static final BadaboomCollector INSTANCE
The singleton.


handlers

private java.util.List<BadaboomHandler> handlers
Contains objects that want to be aware of the manager activities.

Constructor Detail

BadaboomCollector

private BadaboomCollector()
Creates an empty collector.

Method Detail

addHandler

public void addHandler(BadaboomHandler handler)
Adds a handler to the manager.

Parameters:
handler - The handler to add. Must not be null.
Since:
3.0

removeHandler

public void removeHandler(BadaboomHandler handler)
Removes the given handler of the manager.

Parameters:
handler - The handler to remove.
Since:
3.0

notifyHandlers

protected void notifyHandlers(java.lang.Throwable error)
Notifies the handlers that an event occurred.

Since:
3.0

add

public boolean add(java.lang.Throwable ex)
Specified by:
add in interface java.util.Collection<java.lang.Throwable>
Specified by:
add in interface java.util.List<java.lang.Throwable>
Overrides:
add in class java.util.ArrayList<java.lang.Throwable>

set

public java.lang.Throwable set(int pos,
                               java.lang.Throwable ex)
Specified by:
set in interface java.util.List<java.lang.Throwable>
Overrides:
set in class java.util.ArrayList<java.lang.Throwable>

add

public void add(int index,
                java.lang.Throwable ex)
Specified by:
add in interface java.util.List<java.lang.Throwable>
Overrides:
add in class java.util.ArrayList<java.lang.Throwable>

uncaughtException

public void uncaughtException(java.lang.Thread t,
                              java.lang.Throwable e)
Specified by:
uncaughtException in interface java.lang.Thread.UncaughtExceptionHandler

onMalaiException

public void onMalaiException(java.lang.Exception exception)
Description copied from interface: ErrorNotifier
Notifies that an exception has been thrown in the Malai code.

Specified by:
onMalaiException in interface ErrorNotifier
Parameters:
exception - The thrown exception.