com.sap.tc.cmi.util

Class CMIRelationRoleEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.sap.tc.cmi.util.CMIRelationRoleEvent
All Implemented Interfaces:
Serializable

public final class CMIRelationRoleEvent
extends EventObject

Describes a change in a relation role of an observed model object.

 
                 0..1  1   0..n  1..n
 ELEMENT_ADDED    x    -     x     x
 ELEMENT_REMOVED  x    -     x     x
 ELEMENT_CHANGED  x    x     x     x
 ROLE_CLEARED     x    -     x     -
 COMPLEX_CHANGE   x    x     x     x
 
 0..1
   ADDED:   role was empty, single element added
   REMOVED: single element removed, role now empty
   CHANGED: role had an element and it has been changed (not for null)
   CLEARED: like REMOVED
 
 1
 
 0..n
   ADDED:
   REMOVED:
 
 

Since:
NW Paris, MS3
See Also:
Serialized Form

Type Classification Type Classification:

This class is part of the Common Model Interface, so applications may reference it or call any method of this type, but they must not subclass it.


Field Summary
static int CONTIGUOUS_ELEMENTS_ADDED
          Event type when multiple elements have been added en block.
static int CONTIGUOUS_ELEMENTS_REMOVED
          Event type used when multiple elements have been removed en block from a relation role.
static int ELEMENT_ADDED
           
static int ELEMENT_CHANGED
          Deprecated. use ELEMENT_REPLACED instead
static int ELEMENT_REMOVED
           
static int ELEMENT_REPLACED
           
static int ELEMENTS_REORDERED
          Event type when the order of the elements in the relation role changed, but the set of elements did not change (no adds, removes, replacements).
static int FIRST_MODEL_DEFINED_EVENT_TYPE
          Smallest integer that model implementations may use to define their own event types.
static int MULTIPLE_ELEMENTS_REMOVED
          Event type when multiple elements have been removed at not necessarily contiguous positions.
static int ROLE_CLEARED
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CMIRelationRoleEvent(ICMIObservableModelClass source, ICMIRelationRoleInfo role, int type, Object oldElement, Object newElement, int fromIndex, int toIndex)
           
 
Method Summary
 int getChangeType()
           
 Object getElement()
          Deprecated. Use getOldElement() for ELEMENT_REMOVED or ELEMENT_REPLACED and use getNewElement() for ELEMENT_ADDED instead. As this method was only visible internally, it will be removed before the end of NW Paris MIT.
 int getFromIndex()
           
 Object getNewElement()
           
 ICMIObservableModelClass getObservableModelClass()
           
 Object getOldElement()
           
 ICMIRelationRoleInfo getRelationRoleInfo()
           
 int getToIndex()
           
 
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
 

Field Detail

ROLE_CLEARED

public static final int ROLE_CLEARED
See Also:
Constant Field Values

ELEMENT_ADDED

public static final int ELEMENT_ADDED
See Also:
Constant Field Values

ELEMENT_REMOVED

public static final int ELEMENT_REMOVED
See Also:
Constant Field Values

ELEMENT_CHANGED

public static final int ELEMENT_CHANGED
Deprecated. use ELEMENT_REPLACED instead
See Also:
Constant Field Values

ELEMENT_REPLACED

public static final int ELEMENT_REPLACED
See Also:
Constant Field Values

CONTIGUOUS_ELEMENTS_ADDED

public static final int CONTIGUOUS_ELEMENTS_ADDED
Event type when multiple elements have been added en block. Event Object contains the index of the first and the last inserted element. Implies an index increment by toIndex-fromIndex+1 for any existing element after the insert position. Only to be fired for relation roles that have a list semantic.

See Also:
Constant Field Values

CONTIGUOUS_ELEMENTS_REMOVED

public static final int CONTIGUOUS_ELEMENTS_REMOVED
Event type used when multiple elements have been removed en block from a relation role. For relation roles with list semantics, the event object contains the index of the first and the last removed element.

Implies an index decrement by toIndex-fromIndex+1 for any existing element after the insert position. Only to be fired for relation roles that have a list semantic.

See Also:
Constant Field Values

MULTIPLE_ELEMENTS_REMOVED

public static final int MULTIPLE_ELEMENTS_REMOVED
Event type when multiple elements have been removed at not necessarily contiguous positions. Event Object contains no more information. Implies index changes for any existing element after the first remove position. Only to be fired for relation roles that have a list semantic.

See Also:
Constant Field Values

ELEMENTS_REORDERED

public static final int ELEMENTS_REORDERED
Event type when the order of the elements in the relation role changed, but the set of elements did not change (no adds, removes, replacements). Sorting is a typical example of an reordering operation.

See Also:
Constant Field Values

FIRST_MODEL_DEFINED_EVENT_TYPE

public static final int FIRST_MODEL_DEFINED_EVENT_TYPE
Smallest integer that model implementations may use to define their own event types. Whether or not the event object contains any additional information depends on the model implementation and must be documented there.

Events with a type >= FIRST_MODEL_DEFINED_EVENT_TYPE must be delivered to listeners through their ICMIRelationRoleChangeListener.complexRoleChange(CMIRelationRoleEvent) method.

See Also:
Constant Field Values
Constructor Detail

CMIRelationRoleEvent

public CMIRelationRoleEvent(ICMIObservableModelClass source,
                            ICMIRelationRoleInfo role,
                            int type,
                            Object oldElement,
                            Object newElement,
                            int fromIndex,
                            int toIndex)
Method Detail

getObservableModelClass

public final ICMIObservableModelClass getObservableModelClass()

getRelationRoleInfo

public final ICMIRelationRoleInfo getRelationRoleInfo()

getChangeType

public final int getChangeType()

getElement

public final Object getElement()
Deprecated. Use getOldElement() for ELEMENT_REMOVED or ELEMENT_REPLACED and use getNewElement() for ELEMENT_ADDED instead. As this method was only visible internally, it will be removed before the end of NW Paris MIT.


getOldElement

public final Object getOldElement()

getNewElement

public final Object getNewElement()

getFromIndex

public final int getFromIndex()

getToIndex

public final int getToIndex()
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] FRAMEWORK [sap.com] tc/cm/ejb/api api BC-JAS-EJB
[sap.com] FRAMEWORK [sap.com] tc/cmi default BC-WD-JAV-RUN


Copyright 2014 SAP AG Complete Copyright Notice