edu.harvard.syrah.pyxida.nc.lib
Class ObserverList

java.lang.Object
  extended by edu.harvard.syrah.pyxida.nc.lib.ObserverList

public class ObserverList
extends java.lang.Object

A list of observers for the application-level coordinate.


Field Summary
protected  java.util.List<ApplicationObserver> obs_list
           
 
Constructor Summary
protected ObserverList()
           
 
Method Summary
 boolean add(ApplicationObserver obj)
          Adds the given observer to the list of observers.
 void clear()
          Removes all the observers from the list.
 boolean contains(ApplicationObserver obj)
          Returns whether the list contains the given observer.
 boolean isEmpty()
          Returns whether the observer list is empty, meaning its size equals 0.
 java.util.Iterator<ApplicationObserver> iterator()
          Returns an iterator over the list of observers.
 boolean remove(ApplicationObserver obj)
          Removes the given observer from the list of observers.
 int size()
          Returns the number of observers in the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

obs_list

protected final java.util.List<ApplicationObserver> obs_list
Constructor Detail

ObserverList

protected ObserverList()
Method Detail

size

public int size()
Returns the number of observers in the list.

Returns:
the size of the observer list

isEmpty

public boolean isEmpty()
Returns whether the observer list is empty, meaning its size equals 0.

Returns:
true if the observer list is empty, false otherwise

contains

public boolean contains(ApplicationObserver obj)
Returns whether the list contains the given observer. If the parameter obj is null, this method returns false.

Parameters:
obj - the observer to query for membership in the list
Returns:
true if the list contains the observer, false otherwise

iterator

public java.util.Iterator<ApplicationObserver> iterator()
Returns an iterator over the list of observers.

Returns:
an iterator over the observer list

add

public boolean add(ApplicationObserver obj)
Adds the given observer to the list of observers. If the parameter obj is null, this method returns false and the underlying list remains unchanged.

Parameters:
obj - the observer to add to the list
Returns:
true if the observer is added to the list, false otherwise

remove

public boolean remove(ApplicationObserver obj)
Removes the given observer from the list of observers. If the parameter obj is null or the list does not contain the observer, this method returns false and the underlying list remains unchanged.

Parameters:
obj - the observer to remove from the list
Returns:
true if the observer is removed from the list, false otherwise

clear

public void clear()
Removes all the observers from the list.