com.isima.zz3.advjava.tp1.observer
Class ASubject

java.lang.Object
  extended by com.isima.zz3.advjava.tp1.observer.ASubject
Direct Known Subclasses:
Subject

public abstract class ASubject
extends java.lang.Object

Author:
brunot

Constructor Summary
ASubject()
           
 
Method Summary
 void bind(AObserver observer)
          Attache un observateur au sujet.
 boolean containsAllObservers(java.util.Collection observers)
          Returns true if this collection contains all of the elements in the specified collection.
 boolean containsObservers(AObserver aObserver)
          Returns true if this collection contains the specified element.
 java.util.Collection<AObserver> getObservers()
          Getter of the property observers_
 boolean isObserversEmpty()
          Returns true if this collection contains no elements.
 void notifyObservers()
          Notification du sujet.
 java.util.Iterator<AObserver> observersIterator()
          Returns an iterator over the elements in this collection.
 int observersSize()
          Returns the number of elements in this collection.
 AObserver[] observersToArray()
          Returns all elements of this collection in an array.
 AObserver[] observersToArray(AObserver[] observers_)
          Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
 void unbind(AObserver observer)
          Détache un observateur du sujet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASubject

public ASubject()
Method Detail

getObservers

public java.util.Collection<AObserver> getObservers()
Getter of the property observers_

Returns:
Returns the observers_.

observersIterator

public java.util.Iterator<AObserver> observersIterator()
Returns an iterator over the elements in this collection.

Returns:
an Iterator over the elements in this collection
See Also:
Collection.iterator()

isObserversEmpty

public boolean isObserversEmpty()
Returns true if this collection contains no elements.

Returns:
true if this collection contains no elements
See Also:
Collection.isEmpty()

containsObservers

public boolean containsObservers(AObserver aObserver)
Returns true if this collection contains the specified element.

Parameters:
aObserver - whose presence in this collection is to be tested.
See Also:
Collection.contains(Object)

containsAllObservers

public boolean containsAllObservers(java.util.Collection observers)
Returns true if this collection contains all of the elements in the specified collection.

Parameters:
observers - collection to be checked for containment in this collection.
See Also:
Collection.containsAll(Collection)

observersSize

public int observersSize()
Returns the number of elements in this collection.

Returns:
the number of elements in this collection
See Also:
Collection.size()

observersToArray

public AObserver[] observersToArray()
Returns all elements of this collection in an array.

Returns:
an array containing all of the elements in this collection
See Also:
Collection.toArray()

observersToArray

public AObserver[] observersToArray(AObserver[] observers_)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.

Parameters:
observers_ - the array into which the elements of this collection are to be stored.
Returns:
an array containing all of the elements in this collection
See Also:
Collection.toArray(Object[])

bind

public void bind(AObserver observer)
Attache un observateur au sujet.


unbind

public void unbind(AObserver observer)
Détache un observateur du sujet.


notifyObservers

public void notifyObservers()
Notification du sujet.