/*******************************************************************************
* Copyright (c) 2011-2013 University of Mannheim: Chair for Software Engineering
* 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:
* Ralph Gerbig - initial API and implementation and initial documentation
*******************************************************************************/
package de.uni_mannheim.informatik.swt.models.plm.PLM;
import org.eclipse.emf.common.util.EList;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Connection</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link de.uni_mannheim.informatik.swt.models.plm.PLM.Connection#isTransitive <em>Transitive</em>}</li>
* <li>{@link de.uni_mannheim.informatik.swt.models.plm.PLM.Connection#getParticipation <em>Participation</em>}</li>
* </ul>
* </p>
*
* @see de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage#getConnection()
* @model annotation="Comment Unique\040Workaround='if (this.participant == null) {\r\n\t\t this.participant = new EObjectResolvingEList<Clabject>(Clabject.class, this,\r\n\t\t \t\tPLMPackage.DOMAIN_CONNECTION__PARTICIPANT) {\r\n\t\t @Override\r\n\t\t protected boolean isUnique() {\r\n\t\t return false;\r\n\t\t }\r\n\t\t };\r\n\t\t }\r\n\t\t return this.participant;'"
* @generated
*/
public interface Connection extends Clabject {
/**
* Returns the value of the '<em><b>Transitive</b></em>' attribute.
* The default value is <code>"false"</code>.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Transitive</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Transitive</em>' attribute.
* @see #setTransitive(boolean)
* @see de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage#getConnection_Transitive()
* @model default="false"
* @generated
*/
boolean isTransitive();
/**
* Sets the value of the '{@link de.uni_mannheim.informatik.swt.models.plm.PLM.Connection#isTransitive <em>Transitive</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Transitive</em>' attribute.
* @see #isTransitive()
* @generated
*/
void setTransitive(boolean value);
/**
* Returns the value of the '<em><b>Participation</b></em>' containment reference list.
* The list contents are of type {@link de.uni_mannheim.informatik.swt.models.plm.PLM.Participation}.
* It is bidirectional and its opposite is '{@link de.uni_mannheim.informatik.swt.models.plm.PLM.Participation#getConnection <em>Connection</em>}'.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Participation</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>Participation</em>' containment reference list.
* @see de.uni_mannheim.informatik.swt.models.plm.PLM.PLMPackage#getConnection_Participation()
* @see de.uni_mannheim.informatik.swt.models.plm.PLM.Participation#getConnection
* @model opposite="connection" containment="true"
* @generated
*/
EList<Participation> getParticipation();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns the clabjects that are reachable through this operation, i.e. the destinations of the navigable participations of the connection
* <!-- end-model-doc -->
* @model kind="operation"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.participation->select(r | r.navigable).destination->asOrderedSet()'"
* @generated
*/
EList<Clabject> getDomain();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns the clabjects that are participate in this connection, but are not navigable.
* <!-- end-model-doc -->
* @model kind="operation"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.participation->reject(r | r.navigable).destination->asOrderedSet()'"
* @generated
*/
EList<Clabject> getNotDomain();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns a human readable string representation constructed from the participations
* <!-- end-model-doc -->
* @model kind="operation" required="true" ordered="false"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='--Works only on connections with two or more participants or has a name by itself\r\nif (not (self.participation->size() > 1)) then\r\n\tif (not self.name.oclIsUndefined() or self.name <> \'\') then\r\n\t\tself.name\r\n\telse\r\n\t\t\'\'\r\n\tendif\r\nelse\r\n\tif (not self.name.oclIsUndefined() and self.name.size() <> 0) then\r\n\t\tself.name\r\n\telse\r\n\t\tlet navigableParticipations:OrderedSet(Participation) =\r\n\t\t\tself.participation->select(r | r.navigable)->asOrderedSet()\r\n\t\tin\r\n\t\tif (navigableParticipations->size() = 1) then\r\n\t\t\tlet domainParticipationName:String = \r\n\t\t\t\tnavigableParticipations->first().getHumanReadableParticipationName()\r\n\t\t\tin\r\n\t\t\tlet notNavigableParticipations:OrderedSet(Participation)=\t\r\n\t\t\t\tself.participation->reject(r | r.navigable)->asOrderedSet()\r\n\t\t\tin\r\n\t\t\tif (notNavigableParticipations->size() = 0) then\r\n\t\t\t\tnavigableParticipations.destination->first().name.concat(\'.\').concat(domainParticipationName)\r\n\t\t\telse\r\n\t\t\t\tnotNavigableParticipations->first().destination.name.concat(\'.\').concat(domainParticipationName)\r\n\t\t\tendif\r\n\t\telse\r\n\t\t\tif (navigableParticipations->size() > 0) then\r\n\t\t\t\tlet connectionName:String = \r\n\t\t\t\t\tnavigableParticipations->iterate(r:Participation; name:String = \'\' |\r\n\t\t\t\t\t\tlet participationNameToUpper:String = \r\n\t\t\t\t\t\t\tif (r.destination.name.size() = 0) then\r\n\t\t\t\t\t\t\t\t\'\'\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tr.destination.name.substring(1,1).toUpper().concat(if (r.destination.name.size() > 1) then r.destination.name.substring(2, r.destination.name.size()) else \'\' endif)\r\n\t\t\t\t\t\t\tendif\r\n\t\t\t\t\t\tin\r\n\t\t\t\t\t\tif (r = navigableParticipations->last()) then\t\r\n\t\t\t\t\t\t\tname.concat(participationNameToUpper)\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tname.concat(participationNameToUpper).concat(\'And\')\r\n\t\t\t\t\t\tendif\r\n\t\t\t\t\t)\r\n\t\t\t\tin\r\n\t\t\t\t\t\'Between\'.concat(connectionName)\r\n\t\t\telse\r\n\t\t\t\t\'\'\r\n\t\t\tendif\r\n\t\tendif\r\n\tendif\r\nendif'"
* @generated
*/
String getHumanReadableName();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns the participants of the connection, i.e. the destinations of all the participations
* <!-- end-model-doc -->
* @model kind="operation"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.getAllParticipations().destination->asOrderedSet()'"
* @generated
*/
EList<Clabject> getParticipants();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns the participationNames of the participations of the connection
* <!-- end-model-doc -->
* @model kind="operation"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.participation->collect(r|r.getHumanReadableParticipationName())->asOrderedSet()'"
* @generated
*/
EList<String> getParticipationNames();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns the clabjects that are in the domain of the connection and are not the source
* <!-- end-model-doc -->
* @model sourceRequired="true"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.participation->select(r | r.navigable and r.destination <> source).destination->asOrderedSet()'"
* @generated
*/
EList<Clabject> getDomain(Clabject source);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns the participationNames the source is reachable with through this connection
* <!-- end-model-doc -->
* @model sourceRequired="true"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.participation->select(r | r.destination = source)->collect(r|r.participationName())->asOrderedSet()'"
* @generated
*/
EList<String> getParticipationNamesForParticipant(Clabject source);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns the lower multiplicity of the participation identified by rN
* <!-- end-model-doc -->
* @model rNRequired="true"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.participation->select(r | r.participationName() = rN).lower->first()'"
* @generated
*/
int getLowerForParticipationName(String rN);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns the upper multiplicity of the participation identified by rN
* <!-- end-model-doc -->
* @model rNRequired="true"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.participation->select(r | r.participationName() = rN).upper->first()'"
* @generated
*/
int getUpperForParticipationName(String rN);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns the navigability of the participation identified by rN
* <!-- end-model-doc -->
* @model rNRequired="true"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.participation->select(r | r.participationName() = rN).navigable->first()'"
* @generated
*/
boolean isNavigableForParticipationName(String rN);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns the number of participations in the connection
* <!-- end-model-doc -->
* @model kind="operation" required="true"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.participation->size()'"
* @generated
*/
int getOrder();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns the participations that the connection inherits from its supertypes. a participation is inherited if the participationName is not already present in a participation defined with the connection itself
* <!-- end-model-doc -->
* @model kind="operation"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.getDirectSupertypes()->iterate(\r\n\tsuper;\r\n\tr : OrderedSet(Participation)= OrderedSet{} |\r\n\tr->union(super.oclAsType(Connection).getAllParticipations()->reject(rs|r->exists(rss|rss.participationName()=rs.participationName())))->asOrderedSet()\r\n)'"
* @generated
*/
EList<Participation> getInheritedParticipations();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns all participations of the connection, including the inherited ones
* <!-- end-model-doc -->
* @model kind="operation"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.participation->union(\r\n\tself.getInheritedParticipations()->reject(r | self.participation->exists(rs | rs.participationName() = r.participationName() ) )\r\n)->asOrderedSet()'"
* @generated
*/
EList<Participation> getAllParticipations();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns the clabject reachable through the connection via rN, i.e. the destination of the participation of the connection where the participationName is rN
* <!-- end-model-doc -->
* @model rNRequired="true"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='self.participation->select(r | r.participationName() = rN).destination->first()'"
* @generated
*/
Clabject getParticipantForParticipationName(String rN);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* returns a human readable string representation
* <!-- end-model-doc -->
* @model required="true" ordered="false"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='if self.name.oclIsUndefined() or self.name = \'\' then\n\tself.participation.represent()->iterate(\n\t\tr:String; res:String=\'|\'| res.concat(r).concat(\'|\')\n\t)\nelse \n\tself.name\nendif'"
* @generated
*/
String represent();
} // Connection