nl.tudelft.simulation.event.util
Class EventProducingCollection

java.lang.Object
  extended by nl.tudelft.simulation.event.EventProducer
      extended by nl.tudelft.simulation.event.util.EventProducingCollection
All Implemented Interfaces:
Serializable, Iterable, Collection, EventProducerInterface

public class EventProducingCollection
extends EventProducer
implements Collection

The Event producing collection 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 2002-2005 Delft University of Technology , the Netherlands.

See for project information www.simulation.tudelft.nl/event
License of use: Lesser General Public License (LGPL) , no warranty

Since:
1.2
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:24:36 $
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
EventProducingCollection(Collection parent)
          constructs a new EventProducingList.
 
Method Summary
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection c)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(Collection c)
           
 int size()
           
 Object[] toArray()
           
 Object[] toArray(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.Collection
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

EventProducingCollection

public EventProducingCollection(Collection parent)
constructs a new EventProducingList.

Parameters:
parent - the parent collection.
Method Detail

size

public int size()
Specified by:
size in interface Collection
See Also:
Collection.size()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
See Also:
Collection.isEmpty()

clear

public void clear()
Specified by:
clear in interface Collection
See Also:
Collection.clear()

add

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

addAll

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

contains

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

containsAll

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

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
See Also:
Collection.iterator()

remove

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

removeAll

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

retainAll

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

toArray

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

toArray

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


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