|
||||||||||
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 |
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. |
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)
Switch
caseXXX
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.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-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |