de.lmu.ifi.dbs.elki.utilities.designpattern
Class Observers<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<Observer<? super T>>
              extended by de.lmu.ifi.dbs.elki.utilities.designpattern.Observers<T>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Observer<? super T>>, Collection<Observer<? super T>>, List<Observer<? super T>>, RandomAccess

public class Observers<T>
extends Vector<Observer<? super T>>

Class to manage the observers of an instance. Design note: to avoid reference cycles, this object does not keep track of its owner.

See Also:
Serialized Form

Field Summary
private static long serialVersionUID
          Serial version
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Observers()
          Constructor.
 
Method Summary
 void addObserver(Observer<? super T> o)
          Add an observer to the object.
 void notifyObservers(T owner)
          Notify the observers of the changed object.
 void removeObserver(Observer<? super T> o)
          Remove an observer from the object.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial version

See Also:
Constant Field Values
Constructor Detail

Observers

public Observers()
Constructor.

Method Detail

addObserver

public void addObserver(Observer<? super T> o)
Add an observer to the object.

Parameters:
o - Observer to add

removeObserver

public void removeObserver(Observer<? super T> o)
Remove an observer from the object.

Parameters:
o - Observer to remove

notifyObservers

public void notifyObservers(T owner)
Notify the observers of the changed object.

Parameters:
owner - Owner of the Observers list - changed instance

Release 0.4.0 (2011-09-20_1324)