i3.dragos.gm.core.event
Class GraphEntityClassHierachyEvent

java.lang.Object
  extended by java.util.EventObject
      extended by i3.dragos.core.services.events.DragosEvent
          extended by i3.dragos.gm.core.event.DataEvent
              extended by i3.dragos.gm.core.event.GraphEntityClassEvent
                  extended by i3.dragos.gm.core.event.GraphEntityClassHierachyEvent
All Implemented Interfaces:
java.io.Serializable

public class GraphEntityClassHierachyEvent
extends GraphEntityClassEvent

A GraphEntityClassHierachyEvent is triggered when a super/sub relationship is declared or undeclared in the Schema. The source of this event will always be the super class.

Author:
Thorsten Hermes <thermes@i3.informatik.rwth-aachen.de>
See Also:
Serialized Form

Field Summary
static int CREATE
          Event type constant: Identifies the creation of a super/sub relationship.
static int DELETE
          Event type constant: Identifies the deletion of a super/sub relationship.
 
Fields inherited from class i3.dragos.gm.core.event.GraphEntityClassEvent
DECLARE, UNDECLARE
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
GraphEntityClassHierachyEvent(GraphEntityClass superClass, GraphEntityClass subClass, int eventType)
          Constructs a new event.
 
Method Summary
 DataChangeSet getAffectedElements()
          Returns a DataChangeSet of elements affected by this event.
 GraphEntityClass getSubClass()
          Returns the sub graph entity class which caused the event.
 GraphEntityClass getSuperClass()
          Returns the super graph entity class which caused the event.
 
Methods inherited from class i3.dragos.gm.core.event.GraphEntityClassEvent
getGraphEntityClass
 
Methods inherited from class i3.dragos.gm.core.event.DataEvent
getDataSourceURL
 
Methods inherited from class i3.dragos.core.services.events.DragosEvent
getEventClass, getEventType, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATE

public static final int CREATE
Event type constant: Identifies the creation of a super/sub relationship.

See Also:
Constant Field Values

DELETE

public static final int DELETE
Event type constant: Identifies the deletion of a super/sub relationship.

See Also:
Constant Field Values
Constructor Detail

GraphEntityClassHierachyEvent

public GraphEntityClassHierachyEvent(GraphEntityClass superClass,
                                     GraphEntityClass subClass,
                                     int eventType)
Constructs a new event.

Parameters:
superClass - The super graph entity class.
subClass - The sub graph entity class.
eventType - The type of event.
Method Detail

getSuperClass

public final GraphEntityClass getSuperClass()
Returns the super graph entity class which caused the event. This is just a convenience to avoid casting the result of getSource().

Returns:
the super graph entity class which caused the event.

getSubClass

public final GraphEntityClass getSubClass()
Returns the sub graph entity class which caused the event.

Returns:
the sub graph entity class which caused the event.

getAffectedElements

public DataChangeSet getAffectedElements()
Returns a DataChangeSet of elements affected by this event.

This method is mainly used by the EventManager to determine which graph entities / graph entity classes need to be marked "dirty".

This list should only contain elements directly affected by the event. Any indirectly affected elements (subclasses, instances...) can be determined later automatically.

The default implementation in DataEvent returns a DataChangeSet that just contains the source of the event.

This implementation returns both the super and the sub class in the DataChangeSet.

Overrides:
getAffectedElements in class DataEvent
Returns:
a DataChangeSet of elements affected by this event (may be empty, but never null).


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.