|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.emf.ecore.util.Switch<T>
org.eclipse.emf.ecore.util.ComposedSwitch<T>
public class ComposedSwitch<T>
Composes multiple switches in order to handle instances of classes defined in multiple packages.
| Constructor Summary | |
|---|---|
ComposedSwitch()
Creates a new ComposedSwitch. |
|
ComposedSwitch(java.util.Collection<? extends Switch<T>> switches)
Creates a new ComposedSwitch. |
|
| Method Summary | |
|---|---|
void |
addSwitch(Switch<T> sw)
|
protected T |
delegatedDoSwitch(Switch<T> delegate,
EClass theEClass,
EObject theEObject)
Call delegate. |
protected T |
doSwitch(EClass theEClass,
EObject theEObject)
Calls caseXXX for each (super-)class of the model until one returns a non-null result;
it yields that result. |
protected Switch<T> |
findDelegate(EPackage ePackage)
Finds a suitable delegate for the given package. |
boolean |
isSwitchFor(EPackage ePackage)
Indicates whether the receiver is a switch for the specified package. |
void |
removeSwitch(Switch<T> sw)
|
| Methods inherited from class org.eclipse.emf.ecore.util.Switch |
|---|
defaultCase, doSwitch, doSwitch |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ComposedSwitch()
public ComposedSwitch(java.util.Collection<? extends Switch<T>> switches)
switches - The switches to which the composed switch will delegate. The list should generally include switches for all the
packages the composed switch will be expected to handle.| Method Detail |
|---|
public void addSwitch(Switch<T> sw)
public void removeSwitch(Switch<T> sw)
protected T doSwitch(EClass theEClass,
EObject theEObject)
SwitchcaseXXX for each (super-)class of the model until one returns a non-null result;
it yields that result.
doSwitch in class Switch<T>theEClass - the class or superclass of eObject to consider.
The class's containing EPackage determines whether the receiving switch object can handle the request.theEObject - the model object to pass to the appropriate caseXXX.
caseXXX call.
protected T delegatedDoSwitch(Switch<T> delegate,
EClass theEClass,
EObject theEObject)
doSwitch(theEClass, theEObject).
protected Switch<T> findDelegate(EPackage ePackage)
public boolean isSwitchFor(EPackage ePackage)
Switch
isSwitchFor in class Switch<T>ePackage - the package of interest.
true if the receiver is a switch for package.
|
Copyright 2001-2012 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||