nl.tudelft.simulation.event.util
Class EventProducingSet

java.lang.Object
  extended bynl.tudelft.simulation.event.EventProducer
      extended bynl.tudelft.simulation.event.util.EventProducingSet
All Implemented Interfaces:
java.util.Collection, EventProducerInterface, java.io.Serializable, java.util.Set

public class EventProducingSet
extends EventProducer
implements java.util.Set

The Event producing set provides a set to which one can subscribe interest in entry changes. This class does not keep track of changes which take place indirectly. One is for example not notified on map.iterator.remove(). A listener must subscribe to the iterator individually.

(c) copyright 2003-2004 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public License (GPL) , no warranty

Since:
1.2
Version:
1.1, 2004-03-18
Author:
Peter Jacobs
See Also:
Serialized Form

Field Summary
static EventType OBJECT_ADDED_EVENT
          OBJECT_ADDED_EVENT is fired on new entries
static EventType OBJECT_REMOVED_EVENT
          OBJECT_REMOVED_EVENT is fired on removel of entries
 
Fields inherited from class nl.tudelft.simulation.event.EventProducer
listeners
 
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
 
Constructor Summary
EventProducingSet(java.util.Set parent)
          constructs a new EventProducingList.
 
Method Summary
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection c)
           
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection c)
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection c)
           
 boolean retainAll(java.util.Collection c)
           
 int size()
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] a)
           
 
Methods inherited from class nl.tudelft.simulation.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Set
equals, hashCode
 

Field Detail

OBJECT_ADDED_EVENT

public static final EventType OBJECT_ADDED_EVENT
OBJECT_ADDED_EVENT is fired on new entries


OBJECT_REMOVED_EVENT

public static final EventType OBJECT_REMOVED_EVENT
OBJECT_REMOVED_EVENT is fired on removel of entries

Constructor Detail

EventProducingSet

public EventProducingSet(java.util.Set parent)
constructs a new EventProducingList.

Parameters:
parent - the parent set.
Method Detail

size

public int size()
Specified by:
size in interface java.util.Set
See Also:
Set.size()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Set
See Also:
Set.isEmpty()

clear

public void clear()
Specified by:
clear in interface java.util.Set
See Also:
Set.clear()

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.Set
See Also:
Collection.add(java.lang.Object)

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.Set
See Also:
Collection.addAll(java.util.Collection)

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Set
See Also:
Collection.contains(java.lang.Object)

containsAll

public boolean containsAll(java.util.Collection c)
Specified by:
containsAll in interface java.util.Set
See Also:
Collection.containsAll(java.util.Collection)

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.util.Set
See Also:
Collection.iterator()

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Set
See Also:
Collection.remove(java.lang.Object)

removeAll

public boolean removeAll(java.util.Collection c)
Specified by:
removeAll in interface java.util.Set
See Also:
Collection.removeAll(java.util.Collection)

retainAll

public boolean retainAll(java.util.Collection c)
Specified by:
retainAll in interface java.util.Set
See Also:
Collection.retainAll(java.util.Collection)

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Set
See Also:
Collection.toArray()

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Specified by:
toArray in interface java.util.Set
See Also:
Collection.toArray(java.lang.Object[])


Copyright © 2002-2004 Delft University of Technology, the Netherlands. All Rights Reserved.