library
Book
title
author
library
Person
name
givenName
familyName
loans
Library
getLoansDueBefore
dueDate
books
loans
name
Loan
checkLoanBooksInSameLibrary
diagnostics
context
person
books
dueDate
UoD
allLibraries
allPersons
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmi:id="_Tb04gXT5EeCrWsURfnMdtQ"
    name="library" nsURI="platform:/plugin/org.eclipse.emf/js4emf/examples/library/library.ecore"
    nsPrefix="library">
  <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
    <details key="validationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/Javascript"/>
    <details key="settingDelegates" value="http://www.eclipse.org/emf/2002/Ecore/Javascript"/>
  </eAnnotations>
  <eClassifiers xsi:type="ecore:EClass" xmi:id="_621qUHT5EeCrWsURfnMdtQ" name="Book">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="author" eType="#//Person"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="library" eType="#//Library"
        eOpposite="#//Library/books"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Person">
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="nameHasLetterAndSpaceOnly"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/Javascript">
      <details key="nameHasLetterAndSpaceOnly" value="var i;&#xA;var s = this.name;&#xA;for (i = 0; s != null &amp;&amp; i &lt; s.length; i++) {&#xA;  var c = s.charAt(i);&#xA;  if (! (java.lang.Character.isLetter(c) || c == ' ')) {&#xA;    return false;&#xA;  }&#xA;}&#xA;return true;"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="givenName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
        changeable="false" volatile="true" transient="true" derived="true">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/Javascript">
        <details key="Javascript" value="var name = this.name;&#xA;var pos = name.indexOf(' ');&#xA;return pos &lt; 0 ? null : name.substring(0, pos);"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="familyName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
        changeable="false" volatile="true" transient="true" derived="true">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/Javascript">
        <details key="Javascript" value="var name = this.name;&#xA;var pos = name.lastIndexOf(' ');&#xA;return name.substring(pos + 1);"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EReference" name="loans" upperBound="-1"
        eType="#//Loan" eOpposite="#//Loan/person"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Library">
    <eOperations name="getLoansDueBefore" upperBound="-1" eType="#//Loan">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/Javascript">
        <details key="Javascript" value="var loans = newList();&#xA;var it = this.loans.iterator();&#xA;while (it.hasNext()) {&#xA;  var loan = it.next();&#xA;  if (loan.dueDate != null &amp;&amp; loan.dueDate.compareTo(dueDate) &lt;= 0) {&#xA;    loans.add(loan);&#xA;  }&#xA;}&#xA;return loans;&#xA;"/>
      </eAnnotations>
      <eParameters name="dueDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="books" upperBound="-1"
        eType="#_621qUHT5EeCrWsURfnMdtQ" containment="true" eOpposite="#//Book/library"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="loans" upperBound="-1"
        eType="#//Loan" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Loan">
    <eOperations name="checkLoanBooksInSameLibrary" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/Javascript">
        <details key="body" value="var it = this.books.iterator();&#xA;while (it.hasNext()) {&#xA;  var book = it.next();&#xA;  if (book.library != this.eContainer()) {&#xA;    return false;&#xA;  }&#xA;}&#xA;return true;&#xA;"/>
      </eAnnotations>
      <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/>
      <eParameters name="context" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap"/>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="person" eType="#//Person"
        eOpposite="#//Person/loans"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="books" upperBound="-1"
        eType="#_621qUHT5EeCrWsURfnMdtQ"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="dueDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="UoD">
    <eStructuralFeatures xsi:type="ecore:EReference" name="allLibraries" upperBound="-1"
        eType="#//Library" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="allPersons" upperBound="-1"
        eType="#//Person" containment="true"/>
  </eClassifiers>
</ecore:EPackage>

{"directed":true,"nodes":[{"nsPrefix":"library","nsURI":"platform:/plugin/org.eclipse.emf/js4emf/examples/library/library.ecore","name":"library","id":0,"eClass":"EPackage"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Book","instanceClass":null,"abstract":false,"id":1,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Person","instanceClass":null,"abstract":false,"id":2,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Library","instanceClass":null,"abstract":false,"id":3,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Loan","instanceClass":null,"abstract":false,"id":4,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"UoD","instanceClass":null,"abstract":false,"id":5,"interface":false,"eClass":"EClass"},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"title","changeable":true,"lowerBound":0,"iD":false,"id":6,"derived":false},{"container":false,"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"author","changeable":true,"resolveProxies":true,"lowerBound":0,"id":7,"derived":false},{"container":true,"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"library","changeable":true,"resolveProxies":true,"lowerBound":0,"id":8,"derived":false},{"id":9,"eClass":"EGenericType"},{"id":10,"eClass":"EGenericType"},{"id":11,"eClass":"EGenericType"},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"books","changeable":true,"resolveProxies":true,"lowerBound":0,"id":12,"derived":false},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"name","changeable":true,"lowerBound":0,"iD":false,"id":13,"derived":false},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":true,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":true,"unique":true,"name":"givenName","changeable":false,"lowerBound":0,"iD":false,"id":14,"derived":true},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":true,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":true,"unique":true,"name":"familyName","changeable":false,"lowerBound":0,"iD":false,"id":15,"derived":true},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"loans","changeable":true,"resolveProxies":true,"lowerBound":0,"id":16,"derived":false},{"id":17,"eClass":"EGenericType"},{"id":18,"eClass":"EGenericType"},{"id":19,"eClass":"EGenericType"},{"id":20,"eClass":"EGenericType"},{"container":false,"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"person","changeable":true,"resolveProxies":true,"lowerBound":0,"id":21,"derived":false},{"ordered":true,"upperBound":-1,"unique":true,"name":"getLoansDueBefore","lowerBound":0,"id":22,"many":true,"required":false,"eClass":"EOperation"},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"loans","changeable":true,"resolveProxies":true,"lowerBound":0,"id":23,"derived":false},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"name","changeable":true,"lowerBound":0,"iD":false,"id":24,"derived":false},{"id":25,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"dueDate","lowerBound":0,"id":26,"many":false,"required":false,"eClass":"EParameter"},{"id":27,"eClass":"EGenericType"},{"id":28,"eClass":"EGenericType"},{"id":29,"eClass":"EGenericType"},{"id":30,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"checkLoanBooksInSameLibrary","lowerBound":0,"id":31,"many":false,"required":false,"eClass":"EOperation"},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"books","changeable":true,"resolveProxies":true,"lowerBound":0,"id":32,"derived":false},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"dueDate","changeable":true,"lowerBound":0,"iD":false,"id":33,"derived":false},{"id":34,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"diagnostics","lowerBound":0,"id":35,"many":false,"required":false,"eClass":"EParameter"},{"ordered":true,"upperBound":1,"unique":true,"name":"context","lowerBound":0,"id":36,"many":false,"required":false,"eClass":"EParameter"},{"id":37,"eClass":"EGenericType"},{"id":38,"eClass":"EGenericType"},{"id":39,"eClass":"EGenericType"},{"id":40,"eClass":"EGenericType"},{"id":41,"eClass":"EGenericType"},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"allLibraries","changeable":true,"resolveProxies":true,"lowerBound":0,"id":42,"derived":false},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"allPersons","changeable":true,"resolveProxies":true,"lowerBound":0,"id":43,"derived":false},{"id":44,"eClass":"EGenericType"},{"id":45,"eClass":"EGenericType"}],"links":[{"source":0,"target":1},{"source":0,"target":2},{"source":0,"target":3},{"source":0,"target":4},{"source":0,"target":5},{"source":1,"target":0},{"source":1,"target":6},{"source":1,"target":7},{"source":1,"target":8},{"source":6,"target":9},{"source":6,"target":1},{"source":7,"target":2},{"source":7,"target":10},{"source":7,"target":1},{"source":10,"target":2},{"source":8,"target":3},{"source":8,"target":11},{"source":8,"target":1},{"source":8,"target":12},{"source":11,"target":3},{"source":2,"target":0},{"source":2,"target":13},{"source":2,"target":14},{"source":2,"target":15},{"source":2,"target":16},{"source":13,"target":17},{"source":13,"target":2},{"source":14,"target":18},{"source":14,"target":2},{"source":15,"target":19},{"source":15,"target":2},{"source":16,"target":4},{"source":16,"target":20},{"source":16,"target":2},{"source":16,"target":21},{"source":20,"target":4},{"source":3,"target":0},{"source":3,"target":22},{"source":3,"target":12},{"source":3,"target":23},{"source":3,"target":24},{"source":22,"target":4},{"source":22,"target":25},{"source":22,"target":3},{"source":22,"target":26},{"source":25,"target":4},{"source":26,"target":27},{"source":26,"target":22},{"source":12,"target":1},{"source":12,"target":28},{"source":12,"target":3},{"source":12,"target":8},{"source":28,"target":1},{"source":23,"target":4},{"source":23,"target":29},{"source":23,"target":3},{"source":29,"target":4},{"source":24,"target":30},{"source":24,"target":3},{"source":4,"target":0},{"source":4,"target":31},{"source":4,"target":21},{"source":4,"target":32},{"source":4,"target":33},{"source":31,"target":34},{"source":31,"target":4},{"source":31,"target":35},{"source":31,"target":36},{"source":35,"target":37},{"source":35,"target":31},{"source":36,"target":38},{"source":36,"target":31},{"source":21,"target":2},{"source":21,"target":39},{"source":21,"target":4},{"source":21,"target":16},{"source":39,"target":2},{"source":32,"target":1},{"source":32,"target":40},{"source":32,"target":4},{"source":40,"target":1},{"source":33,"target":41},{"source":33,"target":4},{"source":5,"target":0},{"source":5,"target":42},{"source":5,"target":43},{"source":42,"target":3},{"source":42,"target":44},{"source":42,"target":5},{"source":44,"target":3},{"source":43,"target":2},{"source":43,"target":45},{"source":43,"target":5},{"source":45,"target":2}],"multigraph":true}