org.dmtf.schemas.wscim.cim.common.util
Class CommonSwitch<T>

java.lang.Object
  extended by org.dmtf.schemas.wscim.cim.common.util.CommonSwitch<T>

public class CommonSwitch<T>
extends java.lang.Object

The Switch for the model's inheritance hierarchy. It supports the call doSwitch(object) to invoke the caseXXX method for each class of the model, starting with the actual class of the object and proceeding up the inheritance hierarchy until a non-null result is returned, which is the result of the switch.

See Also:
CommonPackage

Field Summary
protected static CommonPackage modelPackage
          The cached model package
 
Constructor Summary
CommonSwitch()
          Creates an instance of the switch.
 
Method Summary
 T caseCimAnySimpleType(CimAnySimpleType object)
          Returns the result of interpreting the object as an instance of 'Cim Any Simple Type'.
 T caseCimBase64Binary(CimBase64Binary object)
          Returns the result of interpreting the object as an instance of 'Cim Base64 Binary'.
 T caseCimBoolean(CimBoolean object)
          Returns the result of interpreting the object as an instance of 'Cim Boolean'.
 T caseCimByte(CimByte object)
          Returns the result of interpreting the object as an instance of 'Cim Byte'.
 T caseCimChar16(CimChar16 object)
          Returns the result of interpreting the object as an instance of 'Cim Char16'.
 T caseCimDateTime(CimDateTime object)
          Returns the result of interpreting the object as an instance of 'Cim Date Time'.
 T caseCimDouble(CimDouble object)
          Returns the result of interpreting the object as an instance of 'Cim Double'.
 T caseCimFloat(CimFloat object)
          Returns the result of interpreting the object as an instance of 'Cim Float'.
 T caseCimHexBinary(CimHexBinary object)
          Returns the result of interpreting the object as an instance of 'Cim Hex Binary'.
 T caseCimInt(CimInt object)
          Returns the result of interpreting the object as an instance of 'Cim Int'.
 T caseCimLong(CimLong object)
          Returns the result of interpreting the object as an instance of 'Cim Long'.
 T caseCimReference(CimReference object)
          Returns the result of interpreting the object as an instance of 'Cim Reference'.
 T caseCimShort(CimShort object)
          Returns the result of interpreting the object as an instance of 'Cim Short'.
 T caseCimString(CimString object)
          Returns the result of interpreting the object as an instance of 'Cim String'.
 T caseCimUnsignedByte(CimUnsignedByte object)
          Returns the result of interpreting the object as an instance of 'Cim Unsigned Byte'.
 T caseCimUnsignedInt(CimUnsignedInt object)
          Returns the result of interpreting the object as an instance of 'Cim Unsigned Int'.
 T caseCimUnsignedLong(CimUnsignedLong object)
          Returns the result of interpreting the object as an instance of 'Cim Unsigned Long'.
 T caseCimUnsignedShort(CimUnsignedShort object)
          Returns the result of interpreting the object as an instance of 'Cim Unsigned Short'.
 T caseDocumentRoot(DocumentRoot object)
          Returns the result of interpreting the object as an instance of 'Document Root'.
 T caseQualifierBoolean(QualifierBoolean object)
          Returns the result of interpreting the object as an instance of 'Qualifier Boolean'.
 T caseQualifierSArray(QualifierSArray object)
          Returns the result of interpreting the object as an instance of 'Qualifier SArray'.
 T caseQualifierSInt64(QualifierSInt64 object)
          Returns the result of interpreting the object as an instance of 'Qualifier SInt64'.
 T caseQualifierString(QualifierString object)
          Returns the result of interpreting the object as an instance of 'Qualifier String'.
 T caseQualifierUInt32(QualifierUInt32 object)
          Returns the result of interpreting the object as an instance of 'Qualifier UInt32'.
 T defaultCase(EObject object)
          Returns the result of interpreting the object as an instance of 'EObject'.
protected  T doSwitch(EClass theEClass, EObject theEObject)
          Calls caseXXX for each class of the model until one returns a non null result; it yields that result.
 T doSwitch(EObject theEObject)
          Calls caseXXX for each class of the model until one returns a non null result; it yields that result.
protected  T doSwitch(int classifierID, EObject theEObject)
          Calls caseXXX for each class of the model until one returns a non null result; it yields that result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelPackage

protected static CommonPackage modelPackage
The cached model package

Constructor Detail

CommonSwitch

public CommonSwitch()
Creates an instance of the switch.

Method Detail

doSwitch

public T doSwitch(EObject theEObject)
Calls caseXXX for each class of the model until one returns a non null result; it yields that result.

Returns:
the first non-null result returned by a caseXXX call.

doSwitch

protected T doSwitch(EClass theEClass,
                     EObject theEObject)
Calls caseXXX for each class of the model until one returns a non null result; it yields that result.

Returns:
the first non-null result returned by a caseXXX call.

doSwitch

protected T doSwitch(int classifierID,
                     EObject theEObject)
Calls caseXXX for each class of the model until one returns a non null result; it yields that result.

Returns:
the first non-null result returned by a caseXXX call.

caseCimAnySimpleType

public T caseCimAnySimpleType(CimAnySimpleType object)
Returns the result of interpreting the object as an instance of 'Cim Any Simple Type'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Any Simple Type'.
See Also:
doSwitch(EObject)

caseCimBase64Binary

public T caseCimBase64Binary(CimBase64Binary object)
Returns the result of interpreting the object as an instance of 'Cim Base64 Binary'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Base64 Binary'.
See Also:
doSwitch(EObject)

caseCimBoolean

public T caseCimBoolean(CimBoolean object)
Returns the result of interpreting the object as an instance of 'Cim Boolean'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Boolean'.
See Also:
doSwitch(EObject)

caseCimByte

public T caseCimByte(CimByte object)
Returns the result of interpreting the object as an instance of 'Cim Byte'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Byte'.
See Also:
doSwitch(EObject)

caseCimChar16

public T caseCimChar16(CimChar16 object)
Returns the result of interpreting the object as an instance of 'Cim Char16'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Char16'.
See Also:
doSwitch(EObject)

caseCimDateTime

public T caseCimDateTime(CimDateTime object)
Returns the result of interpreting the object as an instance of 'Cim Date Time'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Date Time'.
See Also:
doSwitch(EObject)

caseCimDouble

public T caseCimDouble(CimDouble object)
Returns the result of interpreting the object as an instance of 'Cim Double'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Double'.
See Also:
doSwitch(EObject)

caseCimFloat

public T caseCimFloat(CimFloat object)
Returns the result of interpreting the object as an instance of 'Cim Float'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Float'.
See Also:
doSwitch(EObject)

caseCimHexBinary

public T caseCimHexBinary(CimHexBinary object)
Returns the result of interpreting the object as an instance of 'Cim Hex Binary'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Hex Binary'.
See Also:
doSwitch(EObject)

caseCimInt

public T caseCimInt(CimInt object)
Returns the result of interpreting the object as an instance of 'Cim Int'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Int'.
See Also:
doSwitch(EObject)

caseCimLong

public T caseCimLong(CimLong object)
Returns the result of interpreting the object as an instance of 'Cim Long'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Long'.
See Also:
doSwitch(EObject)

caseCimReference

public T caseCimReference(CimReference object)
Returns the result of interpreting the object as an instance of 'Cim Reference'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Reference'.
See Also:
doSwitch(EObject)

caseCimShort

public T caseCimShort(CimShort object)
Returns the result of interpreting the object as an instance of 'Cim Short'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Short'.
See Also:
doSwitch(EObject)

caseCimString

public T caseCimString(CimString object)
Returns the result of interpreting the object as an instance of 'Cim String'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim String'.
See Also:
doSwitch(EObject)

caseCimUnsignedByte

public T caseCimUnsignedByte(CimUnsignedByte object)
Returns the result of interpreting the object as an instance of 'Cim Unsigned Byte'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Unsigned Byte'.
See Also:
doSwitch(EObject)

caseCimUnsignedInt

public T caseCimUnsignedInt(CimUnsignedInt object)
Returns the result of interpreting the object as an instance of 'Cim Unsigned Int'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Unsigned Int'.
See Also:
doSwitch(EObject)

caseCimUnsignedLong

public T caseCimUnsignedLong(CimUnsignedLong object)
Returns the result of interpreting the object as an instance of 'Cim Unsigned Long'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Unsigned Long'.
See Also:
doSwitch(EObject)

caseCimUnsignedShort

public T caseCimUnsignedShort(CimUnsignedShort object)
Returns the result of interpreting the object as an instance of 'Cim Unsigned Short'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Cim Unsigned Short'.
See Also:
doSwitch(EObject)

caseDocumentRoot

public T caseDocumentRoot(DocumentRoot object)
Returns the result of interpreting the object as an instance of 'Document Root'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Document Root'.
See Also:
doSwitch(EObject)

caseQualifierBoolean

public T caseQualifierBoolean(QualifierBoolean object)
Returns the result of interpreting the object as an instance of 'Qualifier Boolean'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Qualifier Boolean'.
See Also:
doSwitch(EObject)

caseQualifierSArray

public T caseQualifierSArray(QualifierSArray object)
Returns the result of interpreting the object as an instance of 'Qualifier SArray'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Qualifier SArray'.
See Also:
doSwitch(EObject)

caseQualifierSInt64

public T caseQualifierSInt64(QualifierSInt64 object)
Returns the result of interpreting the object as an instance of 'Qualifier SInt64'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Qualifier SInt64'.
See Also:
doSwitch(EObject)

caseQualifierString

public T caseQualifierString(QualifierString object)
Returns the result of interpreting the object as an instance of 'Qualifier String'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Qualifier String'.
See Also:
doSwitch(EObject)

caseQualifierUInt32

public T caseQualifierUInt32(QualifierUInt32 object)
Returns the result of interpreting the object as an instance of 'Qualifier UInt32'. This implementation returns null; returning a non-null result will terminate the switch.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'Qualifier UInt32'.
See Also:
doSwitch(EObject)

defaultCase

public T defaultCase(EObject object)
Returns the result of interpreting the object as an instance of 'EObject'. This implementation returns null; returning a non-null result will terminate the switch, but this is the last case anyway.

Parameters:
object - the target of the switch.
Returns:
the result of interpreting the object as an instance of 'EObject'.
See Also:
doSwitch(org.eclipse.emf.ecore.EObject)


© Copyright 2008 IBM Corp. 2008 All Rights Reserved