org.eclipse.emf.examples.extlibrary.util
Class EXTLibrarySwitch<T>

java.lang.Object
  extended by org.eclipse.emf.examples.extlibrary.util.EXTLibrarySwitch<T>

public class EXTLibrarySwitch<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:
EXTLibraryPackage

Field Summary
protected static EXTLibraryPackage modelPackage
          The cached model package
 
Constructor Summary
EXTLibrarySwitch()
          Creates an instance of the switch
 
Method Summary
 T caseAddressable(Addressable object)
          Returns the result of interpreting the object as an instance of 'Addressable'
 T caseAudioVisualItem(AudioVisualItem object)
          Returns the result of interpreting the object as an instance of 'Audio Visual Item'
 T caseBook(Book object)
          Returns the result of interpreting the object as an instance of 'Book'
 T caseBookOnTape(BookOnTape object)
          Returns the result of interpreting the object as an instance of 'Book On Tape'
 T caseBorrower(Borrower object)
          Returns the result of interpreting the object as an instance of 'Borrower'
 T caseCirculatingItem(CirculatingItem object)
          Returns the result of interpreting the object as an instance of 'Circulating Item'
 T caseEmployee(Employee object)
          Returns the result of interpreting the object as an instance of 'Employee'
 T caseItem(Item object)
          Returns the result of interpreting the object as an instance of 'Item'
 T caseLendable(Lendable object)
          Returns the result of interpreting the object as an instance of 'Lendable'
 T caseLibrary(Library object)
          Returns the result of interpreting the object as an instance of 'Library'
 T casePeriodical(Periodical object)
          Returns the result of interpreting the object as an instance of 'Periodical'
 T casePerson(Person object)
          Returns the result of interpreting the object as an instance of 'Person'
 T caseVideoCassette(VideoCassette object)
          Returns the result of interpreting the object as an instance of 'Video Cassette'
 T caseWriter(Writer object)
          Returns the result of interpreting the object as an instance of 'Writer'
 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 EXTLibraryPackage modelPackage
The cached model package

Constructor Detail

EXTLibrarySwitch

public EXTLibrarySwitch()
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.

caseBook

public T caseBook(Book object)
Returns the result of interpreting the object as an instance of 'Book'. 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 'Book'.
See Also:
doSwitch(EObject)

caseLibrary

public T caseLibrary(Library object)
Returns the result of interpreting the object as an instance of 'Library'. 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 'Library'.
See Also:
doSwitch(EObject)

caseWriter

public T caseWriter(Writer object)
Returns the result of interpreting the object as an instance of 'Writer'. 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 'Writer'.
See Also:
doSwitch(EObject)

caseItem

public T caseItem(Item object)
Returns the result of interpreting the object as an instance of 'Item'. 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 'Item'.
See Also:
doSwitch(EObject)

caseLendable

public T caseLendable(Lendable object)
Returns the result of interpreting the object as an instance of 'Lendable'. 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 'Lendable'.
See Also:
doSwitch(EObject)

caseCirculatingItem

public T caseCirculatingItem(CirculatingItem object)
Returns the result of interpreting the object as an instance of 'Circulating Item'. 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 'Circulating Item'.
See Also:
doSwitch(EObject)

casePeriodical

public T casePeriodical(Periodical object)
Returns the result of interpreting the object as an instance of 'Periodical'. 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 'Periodical'.
See Also:
doSwitch(EObject)

caseAudioVisualItem

public T caseAudioVisualItem(AudioVisualItem object)
Returns the result of interpreting the object as an instance of 'Audio Visual Item'. 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 'Audio Visual Item'.
See Also:
doSwitch(EObject)

caseBookOnTape

public T caseBookOnTape(BookOnTape object)
Returns the result of interpreting the object as an instance of 'Book On Tape'. 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 'Book On Tape'.
See Also:
doSwitch(EObject)

caseVideoCassette

public T caseVideoCassette(VideoCassette object)
Returns the result of interpreting the object as an instance of 'Video Cassette'. 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 'Video Cassette'.
See Also:
doSwitch(EObject)

caseBorrower

public T caseBorrower(Borrower object)
Returns the result of interpreting the object as an instance of 'Borrower'. 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 'Borrower'.
See Also:
doSwitch(EObject)

casePerson

public T casePerson(Person object)
Returns the result of interpreting the object as an instance of 'Person'. 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 'Person'.
See Also:
doSwitch(EObject)

caseEmployee

public T caseEmployee(Employee object)
Returns the result of interpreting the object as an instance of 'Employee'. 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 'Employee'.
See Also:
doSwitch(EObject)

caseAddressable

public T caseAddressable(Addressable object)
Returns the result of interpreting the object as an instance of 'Addressable'. 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 'Addressable'.
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 2001-2006 IBM Corporation and others.
All Rights Reserved.