/** * Copyright (c) 2015-2016 Obeo, Inria * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * - William Piers <william.piers@obeo.fr> * - Philippe Merle <philippe.merle@inria.fr> */ package org.occiware.clouddesigner.occi; import java.util.Map; import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Category</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * </p> * <ul> * <li>{@link org.occiware.clouddesigner.occi.Category#getTerm <em>Term</em>}</li> * <li>{@link org.occiware.clouddesigner.occi.Category#getScheme <em>Scheme</em>}</li> * <li>{@link org.occiware.clouddesigner.occi.Category#getTitle <em>Title</em>}</li> * <li>{@link org.occiware.clouddesigner.occi.Category#getAttributes <em>Attributes</em>}</li> * </ul> * * @see org.occiware.clouddesigner.occi.OCCIPackage#getCategory() * @model abstract="true" * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='IdentityUnique SchemeEndsWithSharp AttributesNameUnique'" * @generated */ public interface Category extends EObject { /** * Returns the value of the '<em><b>Term</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Term</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Term</em>' attribute. * @see #setTerm(String) * @see org.occiware.clouddesigner.occi.OCCIPackage#getCategory_Term() * @model dataType="org.occiware.clouddesigner.occi.String" required="true" * annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://schemas.ogf.org/occi/core/ecore!Category!term'" * @generated */ String getTerm(); /** * Sets the value of the '{@link org.occiware.clouddesigner.occi.Category#getTerm <em>Term</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Term</em>' attribute. * @see #getTerm() * @generated */ void setTerm(String value); /** * Returns the value of the '<em><b>Scheme</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Scheme</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Scheme</em>' attribute. * @see #setScheme(String) * @see org.occiware.clouddesigner.occi.OCCIPackage#getCategory_Scheme() * @model dataType="org.occiware.clouddesigner.occi.String" required="true" * annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://schemas.ogf.org/occi/core/ecore!Category!scheme'" * @generated */ String getScheme(); /** * Sets the value of the '{@link org.occiware.clouddesigner.occi.Category#getScheme <em>Scheme</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Scheme</em>' attribute. * @see #getScheme() * @generated */ void setScheme(String value); /** * Returns the value of the '<em><b>Title</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Title</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Title</em>' attribute. * @see #setTitle(String) * @see org.occiware.clouddesigner.occi.OCCIPackage#getCategory_Title() * @model dataType="org.occiware.clouddesigner.occi.String" * annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://schemas.ogf.org/occi/core/ecore!Category!title'" * @generated */ String getTitle(); /** * Sets the value of the '{@link org.occiware.clouddesigner.occi.Category#getTitle <em>Title</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Title</em>' attribute. * @see #getTitle() * @generated */ void setTitle(String value); /** * Returns the value of the '<em><b>Attributes</b></em>' containment reference list. * The list contents are of type {@link org.occiware.clouddesigner.occi.Attribute}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Attributes</em>' containment reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Attributes</em>' containment reference list. * @see org.occiware.clouddesigner.occi.OCCIPackage#getCategory_Attributes() * @model containment="true" * annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://schemas.ogf.org/occi/core/ecore!Category!attributes'" * @generated */ EList<Attribute> getAttributes(); /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @model annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n * \n * inv AttributesNameUnique:\n * let severity : Integer[1] = \'Category::AttributesNameUnique\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let status : OclAny[1] = attributes->isUnique(name)\n * in\n * \'Category::AttributesNameUnique\'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 0)\n * endif\n \052/\nfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.evaluation.Executor%> executor = <%org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal%>.getExecutor(this);\nfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.ids.IdResolver%> idResolver = executor.getIdResolver();\nfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.values.IntegerValue%> severity_0 = <%org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation%>.INSTANCE.evaluate(executor, <%org.occiware.clouddesigner.occi.OCCITables%>.STR_Category_c_c_AttributesNameUnique);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.occiware.clouddesigner.occi.OCCITables%>.INT_0).booleanValue();\n/*@NonInvalid\052/ boolean symbol_0;\nif (le) {\n symbol_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n}\nelse {\n /*@Caught\052/ /*@NonNull\052/ <%java.lang.Object%> CAUGHT_status;\n try {\n final /*@Thrown\052/ <%java.util.List%><<%org.occiware.clouddesigner.occi.Attribute%>> attributes = this.getAttributes();\n final /*@Thrown\052/ <%org.eclipse.ocl.pivot.values.OrderedSetValue%> BOXED_attributes = idResolver.createOrderedSetOfAll(<%org.occiware.clouddesigner.occi.OCCITables%>.ORD_CLSSid_Attribute, attributes);\n /*@Thrown\052/ <%org.eclipse.ocl.pivot.values.SetValue%>.Accumulator accumulator = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createSetAccumulatorValue(<%org.occiware.clouddesigner.occi.OCCITables%>.ORD_CLSSid_Attribute);\n /*@NonNull\052/ <%java.util.Iterator%><<%java.lang.Object%>> ITERATOR__1 = BOXED_attributes.iterator();\n /*@Thrown\052/ boolean status;\n while (true) {\n if (!ITERATOR__1.hasNext()) {\n status = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n break;\n }\n /*@NonInvalid\052/ <%org.occiware.clouddesigner.occi.Attribute%> _1 = (<%org.occiware.clouddesigner.occi.Attribute%>)ITERATOR__1.next();\n /**\n * name\n \052/\n final /*@Thrown\052/ <%java.lang.String%> name = _1.getName();\n //\n if (accumulator.includes(name) == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE) {\n status = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE;\t\t\t// Abort after second find\n break;\n }\n else {\n accumulator.add(name);\n }\n }\n CAUGHT_status = status;\n }\n catch (<%java.lang.Exception%> e) {\n CAUGHT_status = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n }\n final /*@NonInvalid\052/ boolean logDiagnostic = <%org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.ocl.pivot.ids.TypeId%>.BOOLEAN, <%org.occiware.clouddesigner.occi.OCCITables%>.STR_Category_c_c_AttributesNameUnique, this, null, diagnostics, context, null, severity_0, CAUGHT_status, <%org.occiware.clouddesigner.occi.OCCITables%>.INT_0).booleanValue();\n symbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" * @generated */ boolean AttributesNameUnique(DiagnosticChain diagnostics, Map<Object, Object> context); /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @model annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n * \n * inv IdentityUnique:\n * let severity : Integer[1] = \'Category::IdentityUnique\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let\n * status : OclAny[1] = Category.allInstances()\n * ->isUnique(scheme + term)\n * in\n * \'Category::IdentityUnique\'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 0)\n * endif\n \052/\nfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.evaluation.Executor%> executor = <%org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal%>.getExecutor(this);\nfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.ids.IdResolver%> idResolver = executor.getIdResolver();\nfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.values.IntegerValue%> severity_0 = <%org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation%>.INSTANCE.evaluate(executor, <%org.occiware.clouddesigner.occi.OCCITables%>.STR_Category_c_c_IdentityUnique);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.occiware.clouddesigner.occi.OCCITables%>.INT_0).booleanValue();\n/*@NonInvalid\052/ boolean symbol_0;\nif (le) {\n symbol_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n}\nelse {\n /*@Caught\052/ /*@NonNull\052/ <%java.lang.Object%> CAUGHT_status;\n try {\n final /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.Class%> TYP_occi_c_c_Category = idResolver.getClass(<%org.occiware.clouddesigner.occi.OCCITables%>.CLSSid_Category, null);\n final /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.values.SetValue%> allInstances = <%org.eclipse.ocl.pivot.library.classifier.ClassifierAllInstancesOperation%>.INSTANCE.evaluate(executor, <%org.occiware.clouddesigner.occi.OCCITables%>.SET_CLSSid_Category, TYP_occi_c_c_Category);\n /*@Thrown\052/ <%org.eclipse.ocl.pivot.values.SetValue%>.Accumulator accumulator = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createSetAccumulatorValue(<%org.occiware.clouddesigner.occi.OCCITables%>.SET_CLSSid_Category);\n /*@NonNull\052/ <%java.util.Iterator%><<%java.lang.Object%>> ITERATOR__1 = allInstances.iterator();\n /*@Thrown\052/ boolean status;\n while (true) {\n if (!ITERATOR__1.hasNext()) {\n status = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n break;\n }\n /*@NonInvalid\052/ <%org.occiware.clouddesigner.occi.Category%> _1 = (<%org.occiware.clouddesigner.occi.Category%>)ITERATOR__1.next();\n /**\n * scheme + term\n \052/\n final /*@Thrown\052/ <%java.lang.String%> scheme = _1.getScheme();\n final /*@Thrown\052/ <%java.lang.String%> term = _1.getTerm();\n final /*@Thrown\052/ <%java.lang.String%> sum = <%org.eclipse.ocl.pivot.library.string.StringConcatOperation%>.INSTANCE.evaluate(scheme, term);\n //\n if (accumulator.includes(sum) == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE) {\n status = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE;\t\t\t// Abort after second find\n break;\n }\n else {\n accumulator.add(sum);\n }\n }\n CAUGHT_status = status;\n }\n catch (<%java.lang.Exception%> e) {\n CAUGHT_status = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n }\n final /*@NonInvalid\052/ boolean logDiagnostic = <%org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.ocl.pivot.ids.TypeId%>.BOOLEAN, <%org.occiware.clouddesigner.occi.OCCITables%>.STR_Category_c_c_IdentityUnique, this, null, diagnostics, context, null, severity_0, CAUGHT_status, <%org.occiware.clouddesigner.occi.OCCITables%>.INT_0).booleanValue();\n symbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" * @generated */ boolean IdentityUnique(DiagnosticChain diagnostics, Map<Object, Object> context); /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @model annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n * \n * inv SchemeEndsWithSharp:\n * let severity : Integer[1] = \'Category::SchemeEndsWithSharp\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let\n * status : OclAny[1] = scheme.substring(\n * scheme.size(),\n * scheme.size()) = \'#\'\n * in\n * \'Category::SchemeEndsWithSharp\'.logDiagnostic(self, null, diagnostics, context, null, severity, status, 0)\n * endif\n \052/\nfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.evaluation.Executor%> executor = <%org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal%>.getExecutor(this);\nfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.values.IntegerValue%> severity_0 = <%org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation%>.INSTANCE.evaluate(executor, <%org.occiware.clouddesigner.occi.OCCITables%>.STR_Category_c_c_SchemeEndsWithSharp);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.occiware.clouddesigner.occi.OCCITables%>.INT_0).booleanValue();\n/*@NonInvalid\052/ boolean symbol_0;\nif (le) {\n symbol_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n}\nelse {\n /*@Caught\052/ /*@NonNull\052/ <%java.lang.Object%> CAUGHT_status;\n try {\n final /*@Thrown\052/ <%java.lang.String%> scheme = this.getScheme();\n final /*@Thrown\052/ <%org.eclipse.ocl.pivot.values.IntegerValue%> size_0 = <%org.eclipse.ocl.pivot.library.string.StringSizeOperation%>.INSTANCE.evaluate(scheme);\n final /*@Thrown\052/ <%java.lang.String%> substring = <%org.eclipse.ocl.pivot.library.string.StringSubstringOperation%>.INSTANCE.evaluate(scheme, size_0, size_0);\n final /*@Thrown\052/ boolean status = substring.equals(<%org.occiware.clouddesigner.occi.OCCITables%>.STR__35);\n CAUGHT_status = status;\n }\n catch (<%java.lang.Exception%> e) {\n CAUGHT_status = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n }\n final /*@NonInvalid\052/ boolean logDiagnostic = <%org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.ocl.pivot.ids.TypeId%>.BOOLEAN, <%org.occiware.clouddesigner.occi.OCCITables%>.STR_Category_c_c_SchemeEndsWithSharp, this, null, diagnostics, context, null, severity_0, CAUGHT_status, <%org.occiware.clouddesigner.occi.OCCITables%>.INT_0).booleanValue();\n symbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" * @generated */ boolean SchemeEndsWithSharp(DiagnosticChain diagnostics, Map<Object, Object> context); } // Category