From 78c806eebaf5b9d50b08768062755f0044cf107f Mon Sep 17 00:00:00 2001 From: OszkarSemerath Date: Sun, 20 Aug 2017 01:55:38 +0200 Subject: Alloy Examples --- .../domains/alloyexamples/Filesystem/Dir.java | 42 ++ .../domains/alloyexamples/Filesystem/FSObject.java | 52 +++ .../domains/alloyexamples/Filesystem/File.java | 18 + .../alloyexamples/Filesystem/FileSystem.java | 70 +++ .../Filesystem/FilesystemFactory.java | 69 +++ .../Filesystem/FilesystemPackage.java | 511 +++++++++++++++++++++ .../domains/alloyexamples/Filesystem/Model.java | 69 +++ .../alloyexamples/Filesystem/impl/DirImpl.java | 165 +++++++ .../Filesystem/impl/FSObjectImpl.java | 194 ++++++++ .../alloyexamples/Filesystem/impl/FileImpl.java | 36 ++ .../Filesystem/impl/FileSystemImpl.java | 205 +++++++++ .../Filesystem/impl/FilesystemFactoryImpl.java | 128 ++++++ .../Filesystem/impl/FilesystemPackageImpl.java | 356 ++++++++++++++ .../alloyexamples/Filesystem/impl/ModelImpl.java | 221 +++++++++ .../Filesystem/util/FilesystemAdapterFactory.java | 192 ++++++++ .../Filesystem/util/FilesystemSwitch.java | 196 ++++++++ 16 files changed, 2524 insertions(+) create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/Dir.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FSObject.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/File.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FileSystem.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FilesystemFactory.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FilesystemPackage.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/Model.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FSObjectImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemFactoryImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemPackageImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/util/FilesystemAdapterFactory.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/util/FilesystemSwitch.java (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme') diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/Dir.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/Dir.java new file mode 100644 index 00000000..59900ac7 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/Dir.java @@ -0,0 +1,42 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Dir'. + * + * + *

+ * The following features are supported: + *

+ * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getDir() + * @model + * @generated + */ +public interface Dir extends FSObject { + /** + * Returns the value of the 'Contents' containment reference list. + * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject}. + * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject#getParent Parent}'. + * + *

+ * If the meaning of the 'Contents' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Contents' containment reference list. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getDir_Contents() + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject#getParent + * @model opposite="parent" containment="true" + * @generated + */ + EList getContents(); + +} // Dir diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FSObject.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FSObject.java new file mode 100644 index 00000000..2cc4d454 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FSObject.java @@ -0,0 +1,52 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'FS Object'. + * + * + *

+ * The following features are supported: + *

+ * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getFSObject() + * @model abstract="true" + * @generated + */ +public interface FSObject extends EObject { + + /** + * Returns the value of the 'Parent' container reference. + * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir#getContents Contents}'. + * + *

+ * If the meaning of the 'Parent' container reference isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Parent' container reference. + * @see #setParent(Dir) + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getFSObject_Parent() + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir#getContents + * @model opposite="contents" transient="false" + * @generated + */ + Dir getParent(); + + /** + * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject#getParent Parent}' container reference. + * + * + * @param value the new value of the 'Parent' container reference. + * @see #getParent() + * @generated + */ + void setParent(Dir value); +} // FSObject diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/File.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/File.java new file mode 100644 index 00000000..e765cbda --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/File.java @@ -0,0 +1,18 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem; + + +/** + * + * A representation of the model object 'File'. + * + * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getFile() + * @model + * @generated + */ +public interface File extends FSObject { + +} // File diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FileSystem.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FileSystem.java new file mode 100644 index 00000000..1896e31e --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FileSystem.java @@ -0,0 +1,70 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'File System'. + * + * + *

+ * The following features are supported: + *

+ * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getFileSystem() + * @model + * @generated + */ +public interface FileSystem extends EObject { + /** + * Returns the value of the 'Root' containment reference. + * + *

+ * If the meaning of the 'Root' containment reference isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Root' containment reference. + * @see #setRoot(Dir) + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getFileSystem_Root() + * @model containment="true" required="true" + * @generated + */ + Dir getRoot(); + + /** + * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem#getRoot Root}' containment reference. + * + * + * @param value the new value of the 'Root' containment reference. + * @see #getRoot() + * @generated + */ + void setRoot(Dir value); + + /** + * Returns the value of the 'Live' reference list. + * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject}. + * + *

+ * If the meaning of the 'Live' reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Live' reference list. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getFileSystem_Live() + * @model transient="true" changeable="false" volatile="true" derived="true" + * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live'" + * @generated + */ + EList getLive(); + +} // FileSystem diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FilesystemFactory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FilesystemFactory.java new file mode 100644 index 00000000..aaba633f --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FilesystemFactory.java @@ -0,0 +1,69 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage + * @generated + */ +public interface FilesystemFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + FilesystemFactory eINSTANCE = hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FilesystemFactoryImpl.init(); + + /** + * Returns a new object of class 'File System'. + * + * + * @return a new object of class 'File System'. + * @generated + */ + FileSystem createFileSystem(); + + /** + * Returns a new object of class 'Dir'. + * + * + * @return a new object of class 'Dir'. + * @generated + */ + Dir createDir(); + + /** + * Returns a new object of class 'File'. + * + * + * @return a new object of class 'File'. + * @generated + */ + File createFile(); + + /** + * Returns a new object of class 'Model'. + * + * + * @return a new object of class 'Model'. + * @generated + */ + Model createModel(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + FilesystemPackage getFilesystemPackage(); + +} //FilesystemFactory diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FilesystemPackage.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FilesystemPackage.java new file mode 100644 index 00000000..cad9293e --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FilesystemPackage.java @@ -0,0 +1,511 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemFactory + * @model kind="package" + * annotation="http://www.eclipse.org/emf/2002/Ecore settingDelegates='org.eclipse.viatra.query.querybasedfeature'" + * @generated + */ +public interface FilesystemPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "Filesystem"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "FS"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "FS"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + FilesystemPackage eINSTANCE = hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FilesystemPackageImpl.init(); + + /** + * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileSystemImpl File System}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileSystemImpl + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FilesystemPackageImpl#getFileSystem() + * @generated + */ + int FILE_SYSTEM = 0; + + /** + * The feature id for the 'Root' containment reference. + * + * + * @generated + * @ordered + */ + int FILE_SYSTEM__ROOT = 0; + + /** + * The feature id for the 'Live' reference list. + * + * + * @generated + * @ordered + */ + int FILE_SYSTEM__LIVE = 1; + + /** + * The number of structural features of the 'File System' class. + * + * + * @generated + * @ordered + */ + int FILE_SYSTEM_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'File System' class. + * + * + * @generated + * @ordered + */ + int FILE_SYSTEM_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FSObjectImpl FS Object}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FSObjectImpl + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FilesystemPackageImpl#getFSObject() + * @generated + */ + int FS_OBJECT = 1; + + /** + * The feature id for the 'Parent' container reference. + * + * + * @generated + * @ordered + */ + int FS_OBJECT__PARENT = 0; + + /** + * The number of structural features of the 'FS Object' class. + * + * + * @generated + * @ordered + */ + int FS_OBJECT_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'FS Object' class. + * + * + * @generated + * @ordered + */ + int FS_OBJECT_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.DirImpl Dir}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.DirImpl + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FilesystemPackageImpl#getDir() + * @generated + */ + int DIR = 2; + + /** + * The feature id for the 'Parent' container reference. + * + * + * @generated + * @ordered + */ + int DIR__PARENT = FS_OBJECT__PARENT; + + /** + * The feature id for the 'Contents' containment reference list. + * + * + * @generated + * @ordered + */ + int DIR__CONTENTS = FS_OBJECT_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Dir' class. + * + * + * @generated + * @ordered + */ + int DIR_FEATURE_COUNT = FS_OBJECT_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Dir' class. + * + * + * @generated + * @ordered + */ + int DIR_OPERATION_COUNT = FS_OBJECT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileImpl File}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileImpl + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FilesystemPackageImpl#getFile() + * @generated + */ + int FILE = 3; + + /** + * The feature id for the 'Parent' container reference. + * + * + * @generated + * @ordered + */ + int FILE__PARENT = FS_OBJECT__PARENT; + + /** + * The number of structural features of the 'File' class. + * + * + * @generated + * @ordered + */ + int FILE_FEATURE_COUNT = FS_OBJECT_FEATURE_COUNT + 0; + + /** + * The number of operations of the 'File' class. + * + * + * @generated + * @ordered + */ + int FILE_OPERATION_COUNT = FS_OBJECT_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.ModelImpl Model}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.ModelImpl + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FilesystemPackageImpl#getModel() + * @generated + */ + int MODEL = 4; + + /** + * The feature id for the 'Filesystems' containment reference. + * + * + * @generated + * @ordered + */ + int MODEL__FILESYSTEMS = 0; + + /** + * The feature id for the 'Other FS Objects' containment reference list. + * + * + * @generated + * @ordered + */ + int MODEL__OTHER_FS_OBJECTS = 1; + + /** + * The number of structural features of the 'Model' class. + * + * + * @generated + * @ordered + */ + int MODEL_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Model' class. + * + * + * @generated + * @ordered + */ + int MODEL_OPERATION_COUNT = 0; + + + /** + * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem File System}'. + * + * + * @return the meta object for class 'File System'. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem + * @generated + */ + EClass getFileSystem(); + + /** + * Returns the meta object for the containment reference '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem#getRoot Root}'. + * + * + * @return the meta object for the containment reference 'Root'. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem#getRoot() + * @see #getFileSystem() + * @generated + */ + EReference getFileSystem_Root(); + + /** + * Returns the meta object for the reference list '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem#getLive Live}'. + * + * + * @return the meta object for the reference list 'Live'. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem#getLive() + * @see #getFileSystem() + * @generated + */ + EReference getFileSystem_Live(); + + /** + * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject FS Object}'. + * + * + * @return the meta object for class 'FS Object'. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject + * @generated + */ + EClass getFSObject(); + + /** + * Returns the meta object for the container reference '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject#getParent Parent}'. + * + * + * @return the meta object for the container reference 'Parent'. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject#getParent() + * @see #getFSObject() + * @generated + */ + EReference getFSObject_Parent(); + + /** + * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir Dir}'. + * + * + * @return the meta object for class 'Dir'. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir + * @generated + */ + EClass getDir(); + + /** + * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir#getContents Contents}'. + * + * + * @return the meta object for the containment reference list 'Contents'. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir#getContents() + * @see #getDir() + * @generated + */ + EReference getDir_Contents(); + + /** + * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.File File}'. + * + * + * @return the meta object for class 'File'. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.File + * @generated + */ + EClass getFile(); + + /** + * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model Model}'. + * + * + * @return the meta object for class 'Model'. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model + * @generated + */ + EClass getModel(); + + /** + * Returns the meta object for the containment reference '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model#getFilesystems Filesystems}'. + * + * + * @return the meta object for the containment reference 'Filesystems'. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model#getFilesystems() + * @see #getModel() + * @generated + */ + EReference getModel_Filesystems(); + + /** + * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model#getOtherFSObjects Other FS Objects}'. + * + * + * @return the meta object for the containment reference list 'Other FS Objects'. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model#getOtherFSObjects() + * @see #getModel() + * @generated + */ + EReference getModel_OtherFSObjects(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + FilesystemFactory getFilesystemFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileSystemImpl File System}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileSystemImpl + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FilesystemPackageImpl#getFileSystem() + * @generated + */ + EClass FILE_SYSTEM = eINSTANCE.getFileSystem(); + + /** + * The meta object literal for the 'Root' containment reference feature. + * + * + * @generated + */ + EReference FILE_SYSTEM__ROOT = eINSTANCE.getFileSystem_Root(); + + /** + * The meta object literal for the 'Live' reference list feature. + * + * + * @generated + */ + EReference FILE_SYSTEM__LIVE = eINSTANCE.getFileSystem_Live(); + + /** + * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FSObjectImpl FS Object}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FSObjectImpl + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FilesystemPackageImpl#getFSObject() + * @generated + */ + EClass FS_OBJECT = eINSTANCE.getFSObject(); + + /** + * The meta object literal for the 'Parent' container reference feature. + * + * + * @generated + */ + EReference FS_OBJECT__PARENT = eINSTANCE.getFSObject_Parent(); + + /** + * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.DirImpl Dir}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.DirImpl + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FilesystemPackageImpl#getDir() + * @generated + */ + EClass DIR = eINSTANCE.getDir(); + + /** + * The meta object literal for the 'Contents' containment reference list feature. + * + * + * @generated + */ + EReference DIR__CONTENTS = eINSTANCE.getDir_Contents(); + + /** + * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileImpl File}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileImpl + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FilesystemPackageImpl#getFile() + * @generated + */ + EClass FILE = eINSTANCE.getFile(); + + /** + * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.ModelImpl Model}' class. + * + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.ModelImpl + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FilesystemPackageImpl#getModel() + * @generated + */ + EClass MODEL = eINSTANCE.getModel(); + + /** + * The meta object literal for the 'Filesystems' containment reference feature. + * + * + * @generated + */ + EReference MODEL__FILESYSTEMS = eINSTANCE.getModel_Filesystems(); + + /** + * The meta object literal for the 'Other FS Objects' containment reference list feature. + * + * + * @generated + */ + EReference MODEL__OTHER_FS_OBJECTS = eINSTANCE.getModel_OtherFSObjects(); + + } + +} //FilesystemPackage diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/Model.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/Model.java new file mode 100644 index 00000000..c67a3c8a --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/Model.java @@ -0,0 +1,69 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Model'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model#getFilesystems Filesystems}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model#getOtherFSObjects Other FS Objects}
  • + *
+ * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getModel() + * @model + * @generated + */ +public interface Model extends EObject { + /** + * Returns the value of the 'Filesystems' containment reference. + * + *

+ * If the meaning of the 'Filesystems' containment reference isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Filesystems' containment reference. + * @see #setFilesystems(FileSystem) + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getModel_Filesystems() + * @model containment="true" required="true" + * @generated + */ + FileSystem getFilesystems(); + + /** + * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model#getFilesystems Filesystems}' containment reference. + * + * + * @param value the new value of the 'Filesystems' containment reference. + * @see #getFilesystems() + * @generated + */ + void setFilesystems(FileSystem value); + + /** + * Returns the value of the 'Other FS Objects' containment reference list. + * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject}. + * + *

+ * If the meaning of the 'Other FS Objects' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Other FS Objects' containment reference list. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getModel_OtherFSObjects() + * @model containment="true" + * @generated + */ + EList getOtherFSObjects(); + +} // Model diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java new file mode 100644 index 00000000..62df04af --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java @@ -0,0 +1,165 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl; + +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Dir'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.DirImpl#getContents Contents}
  • + *
+ * + * @generated + */ +public class DirImpl extends FSObjectImpl implements Dir { + /** + * The cached value of the '{@link #getContents() Contents}' containment reference list. + * + * + * @see #getContents() + * @generated + * @ordered + */ + protected EList contents; + + /** + * + * + * @generated + */ + protected DirImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FilesystemPackage.Literals.DIR; + } + + /** + * + * + * @generated + */ + public EList getContents() { + if (contents == null) { + contents = new EObjectContainmentWithInverseEList(FSObject.class, this, FilesystemPackage.DIR__CONTENTS, FilesystemPackage.FS_OBJECT__PARENT); + } + return contents; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case FilesystemPackage.DIR__CONTENTS: + return ((InternalEList)(InternalEList)getContents()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case FilesystemPackage.DIR__CONTENTS: + return ((InternalEList)getContents()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FilesystemPackage.DIR__CONTENTS: + return getContents(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FilesystemPackage.DIR__CONTENTS: + getContents().clear(); + getContents().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FilesystemPackage.DIR__CONTENTS: + getContents().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FilesystemPackage.DIR__CONTENTS: + return contents != null && !contents.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //DirImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FSObjectImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FSObjectImpl.java new file mode 100644 index 00000000..c8e73b4e --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FSObjectImpl.java @@ -0,0 +1,194 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl; + +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; + +/** + * + * An implementation of the model object 'FS Object'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FSObjectImpl#getParent Parent}
  • + *
+ * + * @generated + */ +public abstract class FSObjectImpl extends MinimalEObjectImpl.Container implements FSObject { + /** + * + * + * @generated + */ + protected FSObjectImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FilesystemPackage.Literals.FS_OBJECT; + } + + /** + * + * + * @generated + */ + public Dir getParent() { + if (eContainerFeatureID() != FilesystemPackage.FS_OBJECT__PARENT) return null; + return (Dir)eInternalContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetParent(Dir newParent, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject)newParent, FilesystemPackage.FS_OBJECT__PARENT, msgs); + return msgs; + } + + /** + * + * + * @generated + */ + public void setParent(Dir newParent) { + if (newParent != eInternalContainer() || (eContainerFeatureID() != FilesystemPackage.FS_OBJECT__PARENT && newParent != null)) { + if (EcoreUtil.isAncestor(this, newParent)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newParent != null) + msgs = ((InternalEObject)newParent).eInverseAdd(this, FilesystemPackage.DIR__CONTENTS, Dir.class, msgs); + msgs = basicSetParent(newParent, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FilesystemPackage.FS_OBJECT__PARENT, newParent, newParent)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case FilesystemPackage.FS_OBJECT__PARENT: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetParent((Dir)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case FilesystemPackage.FS_OBJECT__PARENT: + return basicSetParent(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case FilesystemPackage.FS_OBJECT__PARENT: + return eInternalContainer().eInverseRemove(this, FilesystemPackage.DIR__CONTENTS, Dir.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FilesystemPackage.FS_OBJECT__PARENT: + return getParent(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FilesystemPackage.FS_OBJECT__PARENT: + setParent((Dir)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FilesystemPackage.FS_OBJECT__PARENT: + setParent((Dir)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FilesystemPackage.FS_OBJECT__PARENT: + return getParent() != null; + } + return super.eIsSet(featureID); + } + +} //FSObjectImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileImpl.java new file mode 100644 index 00000000..55cd8a23 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileImpl.java @@ -0,0 +1,36 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl; + +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.File; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage; +import org.eclipse.emf.ecore.EClass; + +/** + * + * An implementation of the model object 'File'. + * + * + * @generated + */ +public class FileImpl extends FSObjectImpl implements File { + /** + * + * + * @generated + */ + protected FileImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FilesystemPackage.Literals.FILE; + } + +} //FileImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java new file mode 100644 index 00000000..adf30f3a --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java @@ -0,0 +1,205 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl; + +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'File System'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileSystemImpl#getRoot Root}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileSystemImpl#getLive Live}
  • + *
+ * + * @generated + */ +public class FileSystemImpl extends MinimalEObjectImpl.Container implements FileSystem { + /** + * The cached value of the '{@link #getRoot() Root}' containment reference. + * + * + * @see #getRoot() + * @generated + * @ordered + */ + protected Dir root; + + /** + * The cached setting delegate for the '{@link #getLive() Live}' reference list. + * + * + * @see #getLive() + * @generated + * @ordered + */ + protected EStructuralFeature.Internal.SettingDelegate LIVE__ESETTING_DELEGATE = ((EStructuralFeature.Internal)FilesystemPackage.Literals.FILE_SYSTEM__LIVE).getSettingDelegate(); + + /** + * + * + * @generated + */ + protected FileSystemImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FilesystemPackage.Literals.FILE_SYSTEM; + } + + /** + * + * + * @generated + */ + public Dir getRoot() { + return root; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetRoot(Dir newRoot, NotificationChain msgs) { + Dir oldRoot = root; + root = newRoot; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FilesystemPackage.FILE_SYSTEM__ROOT, oldRoot, newRoot); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setRoot(Dir newRoot) { + if (newRoot != root) { + NotificationChain msgs = null; + if (root != null) + msgs = ((InternalEObject)root).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FilesystemPackage.FILE_SYSTEM__ROOT, null, msgs); + if (newRoot != null) + msgs = ((InternalEObject)newRoot).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FilesystemPackage.FILE_SYSTEM__ROOT, null, msgs); + msgs = basicSetRoot(newRoot, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FilesystemPackage.FILE_SYSTEM__ROOT, newRoot, newRoot)); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + public EList getLive() { + return (EList)LIVE__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case FilesystemPackage.FILE_SYSTEM__ROOT: + return basicSetRoot(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FilesystemPackage.FILE_SYSTEM__ROOT: + return getRoot(); + case FilesystemPackage.FILE_SYSTEM__LIVE: + return getLive(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FilesystemPackage.FILE_SYSTEM__ROOT: + setRoot((Dir)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FilesystemPackage.FILE_SYSTEM__ROOT: + setRoot((Dir)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FilesystemPackage.FILE_SYSTEM__ROOT: + return root != null; + case FilesystemPackage.FILE_SYSTEM__LIVE: + return LIVE__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); + } + return super.eIsSet(featureID); + } + +} //FileSystemImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemFactoryImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemFactoryImpl.java new file mode 100644 index 00000000..e40b0bd1 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemFactoryImpl.java @@ -0,0 +1,128 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl; + +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.*; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class FilesystemFactoryImpl extends EFactoryImpl implements FilesystemFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static FilesystemFactory init() { + try { + FilesystemFactory theFilesystemFactory = (FilesystemFactory)EPackage.Registry.INSTANCE.getEFactory(FilesystemPackage.eNS_URI); + if (theFilesystemFactory != null) { + return theFilesystemFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new FilesystemFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public FilesystemFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case FilesystemPackage.FILE_SYSTEM: return createFileSystem(); + case FilesystemPackage.DIR: return createDir(); + case FilesystemPackage.FILE: return createFile(); + case FilesystemPackage.MODEL: return createModel(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public FileSystem createFileSystem() { + FileSystemImpl fileSystem = new FileSystemImpl(); + return fileSystem; + } + + /** + * + * + * @generated + */ + public Dir createDir() { + DirImpl dir = new DirImpl(); + return dir; + } + + /** + * + * + * @generated + */ + public File createFile() { + FileImpl file = new FileImpl(); + return file; + } + + /** + * + * + * @generated + */ + public Model createModel() { + ModelImpl model = new ModelImpl(); + return model; + } + + /** + * + * + * @generated + */ + public FilesystemPackage getFilesystemPackage() { + return (FilesystemPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static FilesystemPackage getPackage() { + return FilesystemPackage.eINSTANCE; + } + +} //FilesystemFactoryImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemPackageImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemPackageImpl.java new file mode 100644 index 00000000..87390fee --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemPackageImpl.java @@ -0,0 +1,356 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl; + +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.File; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemFactory; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPackage { + /** + * + * + * @generated + */ + private EClass fileSystemEClass = null; + + /** + * + * + * @generated + */ + private EClass fsObjectEClass = null; + + /** + * + * + * @generated + */ + private EClass dirEClass = null; + + /** + * + * + * @generated + */ + private EClass fileEClass = null; + + /** + * + * + * @generated + */ + private EClass modelEClass = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#eNS_URI + * @see #init() + * @generated + */ + private FilesystemPackageImpl() { + super(eNS_URI, FilesystemFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link FilesystemPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static FilesystemPackage init() { + if (isInited) return (FilesystemPackage)EPackage.Registry.INSTANCE.getEPackage(FilesystemPackage.eNS_URI); + + // Obtain or create and register package + FilesystemPackageImpl theFilesystemPackage = (FilesystemPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FilesystemPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FilesystemPackageImpl()); + + isInited = true; + + // Create package meta-data objects + theFilesystemPackage.createPackageContents(); + + // Initialize created meta-data + theFilesystemPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theFilesystemPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(FilesystemPackage.eNS_URI, theFilesystemPackage); + return theFilesystemPackage; + } + + /** + * + * + * @generated + */ + public EClass getFileSystem() { + return fileSystemEClass; + } + + /** + * + * + * @generated + */ + public EReference getFileSystem_Root() { + return (EReference)fileSystemEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getFileSystem_Live() { + return (EReference)fileSystemEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getFSObject() { + return fsObjectEClass; + } + + /** + * + * + * @generated + */ + public EReference getFSObject_Parent() { + return (EReference)fsObjectEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getDir() { + return dirEClass; + } + + /** + * + * + * @generated + */ + public EReference getDir_Contents() { + return (EReference)dirEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getFile() { + return fileEClass; + } + + /** + * + * + * @generated + */ + public EClass getModel() { + return modelEClass; + } + + /** + * + * + * @generated + */ + public EReference getModel_Filesystems() { + return (EReference)modelEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getModel_OtherFSObjects() { + return (EReference)modelEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public FilesystemFactory getFilesystemFactory() { + return (FilesystemFactory)getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + fileSystemEClass = createEClass(FILE_SYSTEM); + createEReference(fileSystemEClass, FILE_SYSTEM__ROOT); + createEReference(fileSystemEClass, FILE_SYSTEM__LIVE); + + fsObjectEClass = createEClass(FS_OBJECT); + createEReference(fsObjectEClass, FS_OBJECT__PARENT); + + dirEClass = createEClass(DIR); + createEReference(dirEClass, DIR__CONTENTS); + + fileEClass = createEClass(FILE); + + modelEClass = createEClass(MODEL); + createEReference(modelEClass, MODEL__FILESYSTEMS); + createEReference(modelEClass, MODEL__OTHER_FS_OBJECTS); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + dirEClass.getESuperTypes().add(this.getFSObject()); + fileEClass.getESuperTypes().add(this.getFSObject()); + + // Initialize classes, features, and operations; add parameters + initEClass(fileSystemEClass, FileSystem.class, "FileSystem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getFileSystem_Root(), this.getDir(), null, "root", null, 1, 1, FileSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getFileSystem_Live(), this.getFSObject(), null, "live", null, 0, -1, FileSystem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(fsObjectEClass, FSObject.class, "FSObject", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getFSObject_Parent(), this.getDir(), this.getDir_Contents(), "parent", null, 0, 1, FSObject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(dirEClass, Dir.class, "Dir", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getDir_Contents(), this.getFSObject(), this.getFSObject_Parent(), "contents", null, 0, -1, Dir.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(fileEClass, File.class, "File", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getModel_Filesystems(), this.getFileSystem(), null, "filesystems", null, 1, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getModel_OtherFSObjects(), this.getFSObject(), null, "otherFSObjects", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http://www.eclipse.org/emf/2002/Ecore + createEcoreAnnotations(); + // org.eclipse.viatra.query.querybasedfeature + createOrgAnnotations(); + } + + /** + * Initializes the annotations for http://www.eclipse.org/emf/2002/Ecore. + * + * + * @generated + */ + protected void createEcoreAnnotations() { + String source = "http://www.eclipse.org/emf/2002/Ecore"; + addAnnotation + (this, + source, + new String[] { + "settingDelegates", "org.eclipse.viatra.query.querybasedfeature" + }); + } + + /** + * Initializes the annotations for org.eclipse.viatra.query.querybasedfeature. + * + * + * @generated + */ + protected void createOrgAnnotations() { + String source = "org.eclipse.viatra.query.querybasedfeature"; + addAnnotation + (getFileSystem_Live(), + source, + new String[] { + "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live" + }); + } + +} //FilesystemPackageImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java new file mode 100644 index 00000000..4c236e8e --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java @@ -0,0 +1,221 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl; + +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage; +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Model'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.ModelImpl#getFilesystems Filesystems}
  • + *
  • {@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.ModelImpl#getOtherFSObjects Other FS Objects}
  • + *
+ * + * @generated + */ +public class ModelImpl extends MinimalEObjectImpl.Container implements Model { + /** + * The cached value of the '{@link #getFilesystems() Filesystems}' containment reference. + * + * + * @see #getFilesystems() + * @generated + * @ordered + */ + protected FileSystem filesystems; + + /** + * The cached value of the '{@link #getOtherFSObjects() Other FS Objects}' containment reference list. + * + * + * @see #getOtherFSObjects() + * @generated + * @ordered + */ + protected EList otherFSObjects; + + /** + * + * + * @generated + */ + protected ModelImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FilesystemPackage.Literals.MODEL; + } + + /** + * + * + * @generated + */ + public FileSystem getFilesystems() { + return filesystems; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFilesystems(FileSystem newFilesystems, NotificationChain msgs) { + FileSystem oldFilesystems = filesystems; + filesystems = newFilesystems; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FilesystemPackage.MODEL__FILESYSTEMS, oldFilesystems, newFilesystems); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setFilesystems(FileSystem newFilesystems) { + if (newFilesystems != filesystems) { + NotificationChain msgs = null; + if (filesystems != null) + msgs = ((InternalEObject)filesystems).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FilesystemPackage.MODEL__FILESYSTEMS, null, msgs); + if (newFilesystems != null) + msgs = ((InternalEObject)newFilesystems).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FilesystemPackage.MODEL__FILESYSTEMS, null, msgs); + msgs = basicSetFilesystems(newFilesystems, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FilesystemPackage.MODEL__FILESYSTEMS, newFilesystems, newFilesystems)); + } + + /** + * + * + * @generated + */ + public EList getOtherFSObjects() { + if (otherFSObjects == null) { + otherFSObjects = new EObjectContainmentEList(FSObject.class, this, FilesystemPackage.MODEL__OTHER_FS_OBJECTS); + } + return otherFSObjects; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case FilesystemPackage.MODEL__FILESYSTEMS: + return basicSetFilesystems(null, msgs); + case FilesystemPackage.MODEL__OTHER_FS_OBJECTS: + return ((InternalEList)getOtherFSObjects()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FilesystemPackage.MODEL__FILESYSTEMS: + return getFilesystems(); + case FilesystemPackage.MODEL__OTHER_FS_OBJECTS: + return getOtherFSObjects(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FilesystemPackage.MODEL__FILESYSTEMS: + setFilesystems((FileSystem)newValue); + return; + case FilesystemPackage.MODEL__OTHER_FS_OBJECTS: + getOtherFSObjects().clear(); + getOtherFSObjects().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FilesystemPackage.MODEL__FILESYSTEMS: + setFilesystems((FileSystem)null); + return; + case FilesystemPackage.MODEL__OTHER_FS_OBJECTS: + getOtherFSObjects().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FilesystemPackage.MODEL__FILESYSTEMS: + return filesystems != null; + case FilesystemPackage.MODEL__OTHER_FS_OBJECTS: + return otherFSObjects != null && !otherFSObjects.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //ModelImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/util/FilesystemAdapterFactory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/util/FilesystemAdapterFactory.java new file mode 100644 index 00000000..dc87e685 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/util/FilesystemAdapterFactory.java @@ -0,0 +1,192 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.util; + +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.*; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage + * @generated + */ +public class FilesystemAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static FilesystemPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public FilesystemAdapterFactory() { + if (modelPackage == null) { + modelPackage = FilesystemPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected FilesystemSwitch modelSwitch = + new FilesystemSwitch() { + @Override + public Adapter caseFileSystem(FileSystem object) { + return createFileSystemAdapter(); + } + @Override + public Adapter caseFSObject(FSObject object) { + return createFSObjectAdapter(); + } + @Override + public Adapter caseDir(Dir object) { + return createDirAdapter(); + } + @Override + public Adapter caseFile(File object) { + return createFileAdapter(); + } + @Override + public Adapter caseModel(Model object) { + return createModelAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem File System}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem + * @generated + */ + public Adapter createFileSystemAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject FS Object}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject + * @generated + */ + public Adapter createFSObjectAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir Dir}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir + * @generated + */ + public Adapter createDirAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.File File}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.File + * @generated + */ + public Adapter createFileAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model Model}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model + * @generated + */ + public Adapter createModelAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //FilesystemAdapterFactory diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/util/FilesystemSwitch.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/util/FilesystemSwitch.java new file mode 100644 index 00000000..ce2079c8 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/util/FilesystemSwitch.java @@ -0,0 +1,196 @@ +/** + */ +package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.util; + +import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.*; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) 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 hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage + * @generated + */ +public class FilesystemSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static FilesystemPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public FilesystemSwitch() { + if (modelPackage == null) { + modelPackage = FilesystemPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case FilesystemPackage.FILE_SYSTEM: { + FileSystem fileSystem = (FileSystem)theEObject; + T result = caseFileSystem(fileSystem); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FilesystemPackage.FS_OBJECT: { + FSObject fsObject = (FSObject)theEObject; + T result = caseFSObject(fsObject); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FilesystemPackage.DIR: { + Dir dir = (Dir)theEObject; + T result = caseDir(dir); + if (result == null) result = caseFSObject(dir); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FilesystemPackage.FILE: { + File file = (File)theEObject; + T result = caseFile(file); + if (result == null) result = caseFSObject(file); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FilesystemPackage.MODEL: { + Model model = (Model)theEObject; + T result = caseModel(model); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'File System'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'File System'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFileSystem(FileSystem object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'FS Object'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'FS Object'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFSObject(FSObject object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Dir'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Dir'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDir(Dir object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'File'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'File'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFile(File object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Model'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Model'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseModel(Model object) { + return null; + } + + /** + * 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. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //FilesystemSwitch -- cgit v1.2.3-54-g00ecf