Sweet Home 3D 3.4

com.eteks.sweethome3d.model
Class CollectionEvent<T>

java.lang.Object
  extended by java.util.EventObject
      extended by com.eteks.sweethome3d.model.CollectionEvent<T>
All Implemented Interfaces:
java.io.Serializable

public class CollectionEvent<T>
extends java.util.EventObject

Type of event notified when an item is added or deleted from a list. T is the type of item stored in the collection.

Author:
Emmanuel Puybaret
See Also:
Serialized Form

Nested Class Summary
static class CollectionEvent.Type
          The type of change in the collection.
 
Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CollectionEvent(java.lang.Object source, T item, CollectionEvent.Type type)
          Creates an event for an item that has no index.
CollectionEvent(java.lang.Object source, T item, int index, CollectionEvent.Type type)
          Creates an event for an item with its index.
 
Method Summary
 int getIndex()
          Returns the index of the item in collection or -1 if this index is unknown.
 T getItem()
          Returns the added or deleted item.
 CollectionEvent.Type getType()
          Returns the type of event.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollectionEvent

public CollectionEvent(java.lang.Object source,
                       T item,
                       CollectionEvent.Type type)
Creates an event for an item that has no index.


CollectionEvent

public CollectionEvent(java.lang.Object source,
                       T item,
                       int index,
                       CollectionEvent.Type type)
Creates an event for an item with its index.

Method Detail

getItem

public T getItem()
Returns the added or deleted item.


getIndex

public int getIndex()
Returns the index of the item in collection or -1 if this index is unknown.


getType

public CollectionEvent.Type getType()
Returns the type of event.


Sweet Home 3D 3.4

? Copyrights 2006-2011 eTeks - All rights reserved
Distributed under GNU General Public License