Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 290605 | Differences between
and this patch

Collapse All | Expand All

(-)model/OCL.ecore (-3 / +20 lines)
Lines 1119-1125 Link Here
1119
          </eGenericType>
1119
          </eGenericType>
1120
        </eParameters>
1120
        </eParameters>
1121
      </eOperations>
1121
      </eOperations>
1122
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="integerSymbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/>
1122
      <eOperations name="setIntegerSymbol" ordered="false" lowerBound="1">
1123
        <eParameters name="value" ordered="false" lowerBound="1" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EIntegerObject"/>
1124
      </eOperations>
1125
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="integerSymbol" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBigInteger"/>
1123
      <eGenericSuperTypes eClassifier="#//expressions/NumericLiteralExp">
1126
      <eGenericSuperTypes eClassifier="#//expressions/NumericLiteralExp">
1124
        <eTypeArguments eTypeParameter="#//expressions/IntegerLiteralExp/C"/>
1127
        <eTypeArguments eTypeParameter="#//expressions/IntegerLiteralExp/C"/>
1125
      </eGenericSuperTypes>
1128
      </eGenericSuperTypes>
Lines 1151-1157 Link Here
1151
          </eGenericType>
1154
          </eGenericType>
1152
        </eParameters>
1155
        </eParameters>
1153
      </eOperations>
1156
      </eOperations>
1154
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="integerSymbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/>
1157
      <eOperations name="setIntegerSymbol" ordered="false" lowerBound="1">
1158
        <eParameters name="value" ordered="false" lowerBound="1" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EIntegerObject"/>
1159
      </eOperations>
1160
      <eOperations name="setUnlimitedNaturalSymbol" ordered="false" lowerBound="1">
1161
        <eParameters name="value" ordered="false" lowerBound="1" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EIntegerObject"/>
1162
      </eOperations>
1163
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="unlimitedNaturalSymbol"
1164
          eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBigInteger">
1165
        <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
1166
          <details key="name" value=""/>
1167
        </eAnnotations>
1168
      </eStructuralFeatures>
1155
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="unlimited" lowerBound="1"
1169
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="unlimited" lowerBound="1"
1156
          eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
1170
          eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
1157
          changeable="false" volatile="true" transient="true" derived="true"/>
1171
          changeable="false" volatile="true" transient="true" derived="true"/>
Lines 1703-1709 Link Here
1703
          </eGenericType>
1717
          </eGenericType>
1704
        </eParameters>
1718
        </eParameters>
1705
      </eOperations>
1719
      </eOperations>
1706
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="realSymbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDoubleObject"/>
1720
      <eOperations name="setRealSymbol" ordered="false" lowerBound="1">
1721
        <eParameters name="value" ordered="false" lowerBound="1" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EDoubleObject"/>
1722
      </eOperations>
1723
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="realSymbol" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBigDecimal"/>
1707
      <eGenericSuperTypes eClassifier="#//expressions/NumericLiteralExp">
1724
      <eGenericSuperTypes eClassifier="#//expressions/NumericLiteralExp">
1708
        <eTypeArguments eTypeParameter="#//expressions/RealLiteralExp/C"/>
1725
        <eTypeArguments eTypeParameter="#//expressions/RealLiteralExp/C"/>
1709
      </eGenericSuperTypes>
1726
      </eGenericSuperTypes>
(-)model/OCL.genmodel (-1 / +14 lines)
Lines 10-15 Link Here
10
    featureMapWrapperInternalInterface="" featureMapWrapperClass="" codeFormatting="true"
10
    featureMapWrapperInternalInterface="" featureMapWrapperClass="" codeFormatting="true"
11
    testSuiteClass="org.eclipse.ocl.tests.AllTests" booleanFlagsField="eFlags" booleanFlagsReservedBits="8"
11
    testSuiteClass="org.eclipse.ocl.tests.AllTests" booleanFlagsField="eFlags" booleanFlagsReservedBits="8"
12
    importerID="org.eclipse.uml2.uml.ecore.importer" complianceLevel="5.0" copyrightFields="false"
12
    importerID="org.eclipse.uml2.uml.ecore.importer" complianceLevel="5.0" copyrightFields="false"
13
    usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore"
13
    invariantPrefix="check">
14
    invariantPrefix="check">
14
  <genAnnotations source="http://www.eclipse.org/emf/2002/GenModel/importer/org.eclipse.uml2.uml.ecore.importer">
15
  <genAnnotations source="http://www.eclipse.org/emf/2002/GenModel/importer/org.eclipse.uml2.uml.ecore.importer">
15
    <details key="DUPLICATE_FEATURE_INHERITANCE" value="PROCESS"/>
16
    <details key="DUPLICATE_FEATURE_INHERITANCE" value="PROCESS"/>
Lines 414-432 Link Here
414
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/IntegerLiteralExp/integer_type/diagnostics"/>
415
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/IntegerLiteralExp/integer_type/diagnostics"/>
415
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/IntegerLiteralExp/integer_type/context"/>
416
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/IntegerLiteralExp/integer_type/context"/>
416
        </genOperations>
417
        </genOperations>
418
        <genOperations xsi:type="genmodel:GenOperation" ecoreOperation="OCL.ecore#//expressions/IntegerLiteralExp/setIntegerSymbol">
419
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/IntegerLiteralExp/setIntegerSymbol/value"/>
420
        </genOperations>
417
      </genClasses>
421
      </genClasses>
418
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCL.ecore#//expressions/NumericLiteralExp">
422
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCL.ecore#//expressions/NumericLiteralExp">
419
        <genTypeParameters ecoreTypeParameter="OCL.ecore#//expressions/NumericLiteralExp/C"/>
423
        <genTypeParameters ecoreTypeParameter="OCL.ecore#//expressions/NumericLiteralExp/C"/>
420
      </genClasses>
424
      </genClasses>
421
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp">
425
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp">
422
        <genTypeParameters ecoreTypeParameter="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/C"/>
426
        <genTypeParameters ecoreTypeParameter="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/C"/>
423
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/integerSymbol"/>
427
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/unlimitedNaturalSymbol"/>
424
        <genFeatures xsi:type="genmodel:GenFeature" property="Readonly" createChild="false"
428
        <genFeatures xsi:type="genmodel:GenFeature" property="Readonly" createChild="false"
425
            ecoreFeature="ecore:EAttribute OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/unlimited"/>
429
            ecoreFeature="ecore:EAttribute OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/unlimited"/>
426
        <genOperations xsi:type="genmodel:GenOperation" ecoreOperation="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/natural_type">
430
        <genOperations xsi:type="genmodel:GenOperation" ecoreOperation="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/natural_type">
427
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/natural_type/diagnostics"/>
431
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/natural_type/diagnostics"/>
428
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/natural_type/context"/>
432
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/natural_type/context"/>
429
        </genOperations>
433
        </genOperations>
434
        <genOperations xsi:type="genmodel:GenOperation" ecoreOperation="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/setIntegerSymbol">
435
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/setIntegerSymbol/value"/>
436
        </genOperations>
437
        <genOperations xsi:type="genmodel:GenOperation" ecoreOperation="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/setUnlimitedNaturalSymbol">
438
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/UnlimitedNaturalLiteralExp/setUnlimitedNaturalSymbol/value"/>
439
        </genOperations>
430
      </genClasses>
440
      </genClasses>
431
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCL.ecore#//expressions/InvalidLiteralExp">
441
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCL.ecore#//expressions/InvalidLiteralExp">
432
        <genTypeParameters ecoreTypeParameter="OCL.ecore#//expressions/InvalidLiteralExp/C"/>
442
        <genTypeParameters ecoreTypeParameter="OCL.ecore#//expressions/InvalidLiteralExp/C"/>
Lines 583-588 Link Here
583
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/RealLiteralExp/real_type/diagnostics"/>
593
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/RealLiteralExp/real_type/diagnostics"/>
584
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/RealLiteralExp/real_type/context"/>
594
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/RealLiteralExp/real_type/context"/>
585
        </genOperations>
595
        </genOperations>
596
        <genOperations xsi:type="genmodel:GenOperation" ecoreOperation="OCL.ecore#//expressions/RealLiteralExp/setRealSymbol">
597
          <genParameters xsi:type="genmodel:GenParameter" ecoreParameter="OCL.ecore#//expressions/RealLiteralExp/setRealSymbol/value"/>
598
        </genOperations>
586
      </genClasses>
599
      </genClasses>
587
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCL.ecore#//expressions/StateExp">
600
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCL.ecore#//expressions/StateExp">
588
        <genTypeParameters ecoreTypeParameter="OCL.ecore#//expressions/StateExp/C"/>
601
        <genTypeParameters ecoreTypeParameter="OCL.ecore#//expressions/StateExp/C"/>
(-)model/OCL.uml (-5 / +28 lines)
Lines 714-720 Link Here
714
        </ownedTemplateSignature>
714
        </ownedTemplateSignature>
715
        <generalization xmi:id="_unvVyNppEdu-d8Dv4wLx9Q" general="_unvVy9ppEdu-d8Dv4wLx9Q"/>
715
        <generalization xmi:id="_unvVyNppEdu-d8Dv4wLx9Q" general="_unvVy9ppEdu-d8Dv4wLx9Q"/>
716
        <ownedAttribute xmi:id="_unvVydppEdu-d8Dv4wLx9Q" name="integerSymbol" visibility="public" isOrdered="true">
716
        <ownedAttribute xmi:id="_unvVydppEdu-d8Dv4wLx9Q" name="integerSymbol" visibility="public" isOrdered="true">
717
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EIntegerObject"/>
717
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_METAMODELS/Ecore.metamodel.uml#EBigInteger"/>
718
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_unvVytppEdu-d8Dv4wLx9Q"/>
718
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_unvVytppEdu-d8Dv4wLx9Q"/>
719
        </ownedAttribute>
719
        </ownedAttribute>
720
        <nestedClassifier xmi:type="uml:Class" xmi:id="_unvVy9ppEdu-d8Dv4wLx9Q" name="NumericLiteralExp_C">
720
        <nestedClassifier xmi:type="uml:Class" xmi:id="_unvVy9ppEdu-d8Dv4wLx9Q" name="NumericLiteralExp_C">
Lines 722-727 Link Here
722
            <parameterSubstitution xmi:id="_unvVzdppEdu-d8Dv4wLx9Q" formal="_unvV0NppEdu-d8Dv4wLx9Q" actual="_unvVx9ppEdu-d8Dv4wLx9Q"/>
722
            <parameterSubstitution xmi:id="_unvVzdppEdu-d8Dv4wLx9Q" formal="_unvV0NppEdu-d8Dv4wLx9Q" actual="_unvVx9ppEdu-d8Dv4wLx9Q"/>
723
          </templateBinding>
723
          </templateBinding>
724
        </nestedClassifier>
724
        </nestedClassifier>
725
        <ownedOperation xmi:id="_-fBR4AA0Ed-7_agdSFnrQQ" name="setIntegerSymbol">
726
          <ownedParameter xmi:id="_BpWf4AA1Ed-7_agdSFnrQQ" name="value">
727
            <type xmi:type="uml:PrimitiveType" href="pathmap://UML_METAMODELS/Ecore.metamodel.uml#EIntegerObject"/>
728
          </ownedParameter>
729
        </ownedOperation>
725
      </packagedElement>
730
      </packagedElement>
726
      <packagedElement xmi:type="uml:Class" xmi:id="_unvVztppEdu-d8Dv4wLx9Q" name="NumericLiteralExp" isAbstract="true">
731
      <packagedElement xmi:type="uml:Class" xmi:id="_unvVztppEdu-d8Dv4wLx9Q" name="NumericLiteralExp" isAbstract="true">
727
        <ownedTemplateSignature xmi:type="uml:RedefinableTemplateSignature" xmi:id="_unvVz9ppEdu-d8Dv4wLx9Q" parameter="_unvV0NppEdu-d8Dv4wLx9Q">
732
        <ownedTemplateSignature xmi:type="uml:RedefinableTemplateSignature" xmi:id="_unvVz9ppEdu-d8Dv4wLx9Q" parameter="_unvV0NppEdu-d8Dv4wLx9Q">
Lines 749-756 Link Here
749
          </ownedParameter>
754
          </ownedParameter>
750
        </ownedTemplateSignature>
755
        </ownedTemplateSignature>
751
        <generalization xmi:id="_unvV2tppEdu-d8Dv4wLx9Q" general="_unvV3tppEdu-d8Dv4wLx9Q"/>
756
        <generalization xmi:id="_unvV2tppEdu-d8Dv4wLx9Q" general="_unvV3tppEdu-d8Dv4wLx9Q"/>
752
        <ownedAttribute xmi:id="_unvV29ppEdu-d8Dv4wLx9Q" name="integerSymbol" visibility="public" isOrdered="true">
757
        <ownedAttribute xmi:id="_unvV29ppEdu-d8Dv4wLx9Q" name="unlimitedNaturalSymbol" visibility="public" isOrdered="true">
753
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EIntegerObject"/>
758
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_METAMODELS/Ecore.metamodel.uml#EBigInteger"/>
754
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_unvV3NppEdu-d8Dv4wLx9Q"/>
759
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_unvV3NppEdu-d8Dv4wLx9Q"/>
755
        </ownedAttribute>
760
        </ownedAttribute>
756
        <ownedAttribute xmi:id="_unvV3dppEdu-d8Dv4wLx9Q" name="unlimited" visibility="public" isOrdered="true" isReadOnly="true" isDerived="true">
761
        <ownedAttribute xmi:id="_unvV3dppEdu-d8Dv4wLx9Q" name="unlimited" visibility="public" isOrdered="true" isReadOnly="true" isDerived="true">
Lines 761-766 Link Here
761
            <parameterSubstitution xmi:id="_unvV4NppEdu-d8Dv4wLx9Q" formal="_unvV0NppEdu-d8Dv4wLx9Q" actual="_unvV2dppEdu-d8Dv4wLx9Q"/>
766
            <parameterSubstitution xmi:id="_unvV4NppEdu-d8Dv4wLx9Q" formal="_unvV0NppEdu-d8Dv4wLx9Q" actual="_unvV2dppEdu-d8Dv4wLx9Q"/>
762
          </templateBinding>
767
          </templateBinding>
763
        </nestedClassifier>
768
        </nestedClassifier>
769
        <ownedOperation xmi:id="_4u-wcAA1Ed-7_agdSFnrQQ" name="setIntegerSymbol">
770
          <ownedParameter xmi:id="_4u-wcQA1Ed-7_agdSFnrQQ" name="value">
771
            <type xmi:type="uml:PrimitiveType" href="pathmap://UML_METAMODELS/Ecore.metamodel.uml#EIntegerObject"/>
772
          </ownedParameter>
773
        </ownedOperation>
774
        <ownedOperation xmi:id="_6MG1wAA1Ed-7_agdSFnrQQ" name="setUnlimitedNaturalSymbol">
775
          <ownedParameter xmi:id="_6MG1wQA1Ed-7_agdSFnrQQ" name="value">
776
            <type xmi:type="uml:PrimitiveType" href="pathmap://UML_METAMODELS/Ecore.metamodel.uml#EIntegerObject"/>
777
          </ownedParameter>
778
        </ownedOperation>
764
      </packagedElement>
779
      </packagedElement>
765
      <packagedElement xmi:type="uml:Class" xmi:id="_unvV4dppEdu-d8Dv4wLx9Q" name="InvalidLiteralExp">
780
      <packagedElement xmi:type="uml:Class" xmi:id="_unvV4dppEdu-d8Dv4wLx9Q" name="InvalidLiteralExp">
766
        <ownedTemplateSignature xmi:type="uml:RedefinableTemplateSignature" xmi:id="_unvV4tppEdu-d8Dv4wLx9Q" parameter="_unvV49ppEdu-d8Dv4wLx9Q">
781
        <ownedTemplateSignature xmi:type="uml:RedefinableTemplateSignature" xmi:id="_unvV4tppEdu-d8Dv4wLx9Q" parameter="_unvV49ppEdu-d8Dv4wLx9Q">
Lines 1183-1189 Link Here
1183
        </ownedTemplateSignature>
1198
        </ownedTemplateSignature>
1184
        <generalization xmi:id="_un1aYNppEdu-d8Dv4wLx9Q" general="_un1aY9ppEdu-d8Dv4wLx9Q"/>
1199
        <generalization xmi:id="_un1aYNppEdu-d8Dv4wLx9Q" general="_un1aY9ppEdu-d8Dv4wLx9Q"/>
1185
        <ownedAttribute xmi:id="_un1aYdppEdu-d8Dv4wLx9Q" name="realSymbol" visibility="public" isOrdered="true">
1200
        <ownedAttribute xmi:id="_un1aYdppEdu-d8Dv4wLx9Q" name="realSymbol" visibility="public" isOrdered="true">
1186
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EDoubleObject"/>
1201
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_METAMODELS/Ecore.metamodel.uml#EBigDecimal"/>
1187
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_un1aYtppEdu-d8Dv4wLx9Q"/>
1202
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_un1aYtppEdu-d8Dv4wLx9Q"/>
1188
        </ownedAttribute>
1203
        </ownedAttribute>
1189
        <nestedClassifier xmi:type="uml:Class" xmi:id="_un1aY9ppEdu-d8Dv4wLx9Q" name="NumericLiteralExp_C">
1204
        <nestedClassifier xmi:type="uml:Class" xmi:id="_un1aY9ppEdu-d8Dv4wLx9Q" name="NumericLiteralExp_C">
Lines 1191-1196 Link Here
1191
            <parameterSubstitution xmi:id="_un1aZdppEdu-d8Dv4wLx9Q" formal="_unvV0NppEdu-d8Dv4wLx9Q" actual="_un1aX9ppEdu-d8Dv4wLx9Q"/>
1206
            <parameterSubstitution xmi:id="_un1aZdppEdu-d8Dv4wLx9Q" formal="_unvV0NppEdu-d8Dv4wLx9Q" actual="_un1aX9ppEdu-d8Dv4wLx9Q"/>
1192
          </templateBinding>
1207
          </templateBinding>
1193
        </nestedClassifier>
1208
        </nestedClassifier>
1209
        <ownedOperation xmi:id="_QCQfIAA1Ed-7_agdSFnrQQ" name="setRealSymbol">
1210
          <ownedParameter xmi:id="_QCQfIQA1Ed-7_agdSFnrQQ" name="value">
1211
            <type xmi:type="uml:PrimitiveType" href="pathmap://UML_METAMODELS/Ecore.metamodel.uml#EDoubleObject"/>
1212
          </ownedParameter>
1213
        </ownedOperation>
1194
      </packagedElement>
1214
      </packagedElement>
1195
      <packagedElement xmi:type="uml:Class" xmi:id="_un1aZtppEdu-d8Dv4wLx9Q" name="StateExp">
1215
      <packagedElement xmi:type="uml:Class" xmi:id="_un1aZtppEdu-d8Dv4wLx9Q" name="StateExp">
1196
        <ownedTemplateSignature xmi:type="uml:RedefinableTemplateSignature" xmi:id="_un1aZ9ppEdu-d8Dv4wLx9Q" parameter="_un1aaNppEdu-d8Dv4wLx9Q _un1aatppEdu-d8Dv4wLx9Q">
1216
        <ownedTemplateSignature xmi:type="uml:RedefinableTemplateSignature" xmi:id="_un1aZ9ppEdu-d8Dv4wLx9Q" parameter="_un1aaNppEdu-d8Dv4wLx9Q _un1aatppEdu-d8Dv4wLx9Q">
Lines 2194-2200 Link Here
2194
  <Ecore:EGenericType xmi:id="_up2L8NppEdu-d8Dv4wLx9Q" base_Class="_unvV09ppEdu-d8Dv4wLx9Q"/>
2214
  <Ecore:EGenericType xmi:id="_up2L8NppEdu-d8Dv4wLx9Q" base_Class="_unvV09ppEdu-d8Dv4wLx9Q"/>
2195
  <Ecore:EClass xmi:id="_up2L8dppEdu-d8Dv4wLx9Q" base_Class="_unvV1tppEdu-d8Dv4wLx9Q"/>
2215
  <Ecore:EClass xmi:id="_up2L8dppEdu-d8Dv4wLx9Q" base_Class="_unvV1tppEdu-d8Dv4wLx9Q"/>
2196
  <Ecore:ETypeParameter xmi:id="_up2L8tppEdu-d8Dv4wLx9Q" base_TemplateParameter="_unvV2NppEdu-d8Dv4wLx9Q"/>
2216
  <Ecore:ETypeParameter xmi:id="_up2L8tppEdu-d8Dv4wLx9Q" base_TemplateParameter="_unvV2NppEdu-d8Dv4wLx9Q"/>
2197
  <Ecore:EAttribute xmi:id="_up2L89ppEdu-d8Dv4wLx9Q" base_Property="_unvV29ppEdu-d8Dv4wLx9Q"/>
2217
  <Ecore:EAttribute xmi:id="_up2L89ppEdu-d8Dv4wLx9Q" xmlName="" base_Property="_unvV29ppEdu-d8Dv4wLx9Q"/>
2198
  <Ecore:EAttribute xmi:id="_up2L9NppEdu-d8Dv4wLx9Q" isTransient="true" isVolatile="true" base_Property="_unvV3dppEdu-d8Dv4wLx9Q"/>
2218
  <Ecore:EAttribute xmi:id="_up2L9NppEdu-d8Dv4wLx9Q" isTransient="true" isVolatile="true" base_Property="_unvV3dppEdu-d8Dv4wLx9Q"/>
2199
  <Ecore:EGenericType xmi:id="_up2L9dppEdu-d8Dv4wLx9Q" base_Class="_unvV3tppEdu-d8Dv4wLx9Q"/>
2219
  <Ecore:EGenericType xmi:id="_up2L9dppEdu-d8Dv4wLx9Q" base_Class="_unvV3tppEdu-d8Dv4wLx9Q"/>
2200
  <Ecore:EClass xmi:id="_up2L9tppEdu-d8Dv4wLx9Q" base_Class="_unvV4dppEdu-d8Dv4wLx9Q"/>
2220
  <Ecore:EClass xmi:id="_up2L9tppEdu-d8Dv4wLx9Q" base_Class="_unvV4dppEdu-d8Dv4wLx9Q"/>
Lines 2302-2305 Link Here
2302
  <Ecore:EParameter xmi:id="_SCfO4N1nEduZ74nG8yJaxg" base_Parameter="_FcnTgN1nEduZ74nG8yJaxg"/>
2322
  <Ecore:EParameter xmi:id="_SCfO4N1nEduZ74nG8yJaxg" base_Parameter="_FcnTgN1nEduZ74nG8yJaxg"/>
2303
  <Ecore_1:EClass xmi:id="_1lMzkNXZEd6ci-srLwOkAQ" base_Class="_-PCtwNLlEd6hmvYFRJXZTA"/>
2323
  <Ecore_1:EClass xmi:id="_1lMzkNXZEd6ci-srLwOkAQ" base_Class="_-PCtwNLlEd6hmvYFRJXZTA"/>
2304
  <Ecore:EReference xmi:id="_82aXYNXZEd6ci-srLwOkAQ" base_Property="_ykFGANLmEd6hmvYFRJXZTA"/>
2324
  <Ecore:EReference xmi:id="_82aXYNXZEd6ci-srLwOkAQ" base_Property="_ykFGANLmEd6hmvYFRJXZTA"/>
2325
  <Ecore:EDataType xmi:id="_t-sakP9tEd67_agdSFnrQQ" instanceClassName="java.lang.Number"/>
2326
  <Ecore:EOperation xmi:id="_HzTgsAA1Ed-7_agdSFnrQQ" base_Operation="_-fBR4AA0Ed-7_agdSFnrQQ"/>
2327
  <Ecore:EParameter xmi:id="_JKevAAA1Ed-7_agdSFnrQQ" base_Parameter="_BpWf4AA1Ed-7_agdSFnrQQ"/>
2305
</xmi:XMI>
2328
</xmi:XMI>
(-)model/OCLCST.ecore (-3 / +4 lines)
Lines 240-252 Link Here
240
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="symbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
240
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="symbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
241
    </eClassifiers>
241
    </eClassifiers>
242
    <eClassifiers xsi:type="ecore:EClass" name="IntegerLiteralExpCS" eSuperTypes="#//cst/PrimitiveLiteralExpCS">
242
    <eClassifiers xsi:type="ecore:EClass" name="IntegerLiteralExpCS" eSuperTypes="#//cst/PrimitiveLiteralExpCS">
243
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="integerSymbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/>
243
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="integerSymbol" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBigInteger"/>
244
    </eClassifiers>
244
    </eClassifiers>
245
    <eClassifiers xsi:type="ecore:EClass" name="UnlimitedNaturalLiteralExpCS" eSuperTypes="#//cst/PrimitiveLiteralExpCS">
245
    <eClassifiers xsi:type="ecore:EClass" name="UnlimitedNaturalLiteralExpCS" eSuperTypes="#//cst/PrimitiveLiteralExpCS">
246
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="integerSymbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/>
246
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="unlimitedNaturalSymbol"
247
          eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBigInteger"/>
247
    </eClassifiers>
248
    </eClassifiers>
248
    <eClassifiers xsi:type="ecore:EClass" name="RealLiteralExpCS" eSuperTypes="#//cst/PrimitiveLiteralExpCS">
249
    <eClassifiers xsi:type="ecore:EClass" name="RealLiteralExpCS" eSuperTypes="#//cst/PrimitiveLiteralExpCS">
249
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="realSymbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDoubleObject"/>
250
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="realSymbol" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBigDecimal"/>
250
    </eClassifiers>
251
    </eClassifiers>
251
    <eClassifiers xsi:type="ecore:EClass" name="StringLiteralExpCS" eSuperTypes="#//cst/PrimitiveLiteralExpCS">
252
    <eClassifiers xsi:type="ecore:EClass" name="StringLiteralExpCS" eSuperTypes="#//cst/PrimitiveLiteralExpCS">
252
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="stringSymbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
253
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="stringSymbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
(-)model/OCLCST.genmodel (-2 / +3 lines)
Lines 9-15 Link Here
9
    rootImplementsInterface="" featureMapWrapperInterface="" featureMapWrapperInternalInterface=""
9
    rootImplementsInterface="" featureMapWrapperInterface="" featureMapWrapperInternalInterface=""
10
    featureMapWrapperClass="" codeFormatting="true" testSuiteClass="org.eclipse.ocl.tests.OCLAllTests"
10
    featureMapWrapperClass="" codeFormatting="true" testSuiteClass="org.eclipse.ocl.tests.OCLAllTests"
11
    booleanFlagsField="eFlags" booleanFlagsReservedBits="8" importerID="org.eclipse.uml2.uml.ecore.importer"
11
    booleanFlagsField="eFlags" booleanFlagsReservedBits="8" importerID="org.eclipse.uml2.uml.ecore.importer"
12
    complianceLevel="5.0" copyrightFields="false" binaryCompatibleReflectiveMethods="true">
12
    complianceLevel="5.0" copyrightFields="false" binaryCompatibleReflectiveMethods="true"
13
    usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore">
13
  <genAnnotations source="http://www.eclipse.org/emf/2002/GenModel/importer/org.eclipse.uml2.uml.ecore.importer">
14
  <genAnnotations source="http://www.eclipse.org/emf/2002/GenModel/importer/org.eclipse.uml2.uml.ecore.importer">
14
    <details key="DUPLICATE_FEATURE_INHERITANCE" value="DISCARD"/>
15
    <details key="DUPLICATE_FEATURE_INHERITANCE" value="DISCARD"/>
15
    <details key="DUPLICATE_OPERATIONS" value="DISCARD"/>
16
    <details key="DUPLICATE_OPERATIONS" value="DISCARD"/>
Lines 240-246 Link Here
240
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/IntegerLiteralExpCS/integerSymbol"/>
241
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/IntegerLiteralExpCS/integerSymbol"/>
241
      </genClasses>
242
      </genClasses>
242
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/UnlimitedNaturalLiteralExpCS">
243
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/UnlimitedNaturalLiteralExpCS">
243
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/UnlimitedNaturalLiteralExpCS/integerSymbol"/>
244
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/UnlimitedNaturalLiteralExpCS/unlimitedNaturalSymbol"/>
244
      </genClasses>
245
      </genClasses>
245
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/RealLiteralExpCS">
246
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/RealLiteralExpCS">
246
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/RealLiteralExpCS/realSymbol"/>
247
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/RealLiteralExpCS/realSymbol"/>
(-)model/OCLCST.uml (-4 / +6 lines)
Lines 509-529 Link Here
509
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-A_8fEduhWtVvKtiQ7w" name="IntegerLiteralExpCS">
509
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-A_8fEduhWtVvKtiQ7w" name="IntegerLiteralExpCS">
510
        <generalization xmi:id="_qdx-BP8fEduhWtVvKtiQ7w" general="_qdx9__8fEduhWtVvKtiQ7w"/>
510
        <generalization xmi:id="_qdx-BP8fEduhWtVvKtiQ7w" general="_qdx9__8fEduhWtVvKtiQ7w"/>
511
        <ownedAttribute xmi:id="_qdx-Bf8fEduhWtVvKtiQ7w" name="integerSymbol" visibility="public" isOrdered="true">
511
        <ownedAttribute xmi:id="_qdx-Bf8fEduhWtVvKtiQ7w" name="integerSymbol" visibility="public" isOrdered="true">
512
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EIntegerObject"/>
512
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_METAMODELS/Ecore.metamodel.uml#EBigInteger"/>
513
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx-Bv8fEduhWtVvKtiQ7w"/>
513
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx-Bv8fEduhWtVvKtiQ7w"/>
514
        </ownedAttribute>
514
        </ownedAttribute>
515
      </packagedElement>
515
      </packagedElement>
516
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-B_8fEduhWtVvKtiQ7w" name="UnlimitedNaturalLiteralExpCS">
516
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-B_8fEduhWtVvKtiQ7w" name="UnlimitedNaturalLiteralExpCS">
517
        <generalization xmi:id="_qdx-CP8fEduhWtVvKtiQ7w" general="_qdx9__8fEduhWtVvKtiQ7w"/>
517
        <generalization xmi:id="_qdx-CP8fEduhWtVvKtiQ7w" general="_qdx9__8fEduhWtVvKtiQ7w"/>
518
        <ownedAttribute xmi:id="_qdx-Cf8fEduhWtVvKtiQ7w" name="integerSymbol" visibility="public" isOrdered="true">
518
        <ownedAttribute xmi:id="_qdx-Cf8fEduhWtVvKtiQ7w" name="unlimitedNaturalSymbol" visibility="public" isOrdered="true">
519
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EIntegerObject"/>
519
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_METAMODELS/Ecore.metamodel.uml#EBigInteger"/>
520
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx-Cv8fEduhWtVvKtiQ7w"/>
520
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx-Cv8fEduhWtVvKtiQ7w"/>
521
        </ownedAttribute>
521
        </ownedAttribute>
522
      </packagedElement>
522
      </packagedElement>
523
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-C_8fEduhWtVvKtiQ7w" name="RealLiteralExpCS">
523
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-C_8fEduhWtVvKtiQ7w" name="RealLiteralExpCS">
524
        <generalization xmi:id="_qdx-DP8fEduhWtVvKtiQ7w" general="_qdx9__8fEduhWtVvKtiQ7w"/>
524
        <generalization xmi:id="_qdx-DP8fEduhWtVvKtiQ7w" general="_qdx9__8fEduhWtVvKtiQ7w"/>
525
        <ownedAttribute xmi:id="_qdx-Df8fEduhWtVvKtiQ7w" name="realSymbol" visibility="public" isOrdered="true">
525
        <ownedAttribute xmi:id="_qdx-Df8fEduhWtVvKtiQ7w" name="realSymbol" visibility="public" isOrdered="true">
526
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EDoubleObject"/>
526
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_METAMODELS/Ecore.metamodel.uml#EBigDecimal"/>
527
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx-Dv8fEduhWtVvKtiQ7w"/>
527
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx-Dv8fEduhWtVvKtiQ7w"/>
528
        </ownedAttribute>
528
        </ownedAttribute>
529
      </packagedElement>
529
      </packagedElement>
Lines 856-859 Link Here
856
  <Ecore:EClass xmi:id="_u2txsL8sEd2tbsirxV4pLA" base_Class="_WuZt4L8sEd2tbsirxV4pLA"/>
856
  <Ecore:EClass xmi:id="_u2txsL8sEd2tbsirxV4pLA" base_Class="_WuZt4L8sEd2tbsirxV4pLA"/>
857
  <Ecore:EReference xmi:id="_xEai4L8tEd2tbsirxV4pLA" base_Property="_woRO4L8sEd2tbsirxV4pLA"/>
857
  <Ecore:EReference xmi:id="_xEai4L8tEd2tbsirxV4pLA" base_Property="_woRO4L8sEd2tbsirxV4pLA"/>
858
  <Ecore:EAttribute xmi:id="_K42H8AKSEd6O0MANVU0HEw" base_Property="_HPVqoAKSEd6O0MANVU0HEw"/>
858
  <Ecore:EAttribute xmi:id="_K42H8AKSEd6O0MANVU0HEw" base_Property="_HPVqoAKSEd6O0MANVU0HEw"/>
859
  <Ecore:EAttribute xmi:id="_GDcw4P9qEd67_agdSFnrQQ"/>
860
  <Ecore:EDataType xmi:id="__GNnEP9rEd67_agdSFnrQQ" instanceClassName="java.lang.Number"/>
859
</xmi:XMI>
861
</xmi:XMI>
(-)src/org/eclipse/ocl/AbstractEvaluationVisitor.java (+1 lines)
Lines 526-531 Link Here
526
     * @return the coerced number, or the original number, in case of overflow
526
     * @return the coerced number, or the original number, in case of overflow
527
     * 
527
     * 
528
     * @since 1.2
528
     * @since 1.2
529
     * @deprecated use ObjectUtil.normalize
529
     */
530
     */
530
    protected Number higherPrecisionNumber(Number number) {
531
    protected Number higherPrecisionNumber(Number number) {
531
        return NumberUtil.higherPrecisionNumber(number);
532
        return NumberUtil.higherPrecisionNumber(number);
(-)src/org/eclipse/ocl/EvaluationVisitorImpl.java (-343 / +136 lines)
Lines 20-25 Link Here
20
20
21
package org.eclipse.ocl;
21
package org.eclipse.ocl;
22
22
23
import java.math.BigDecimal;
24
import java.math.BigInteger;
25
import java.math.RoundingMode;
23
import java.util.AbstractList;
26
import java.util.AbstractList;
24
import java.util.ArrayList;
27
import java.util.ArrayList;
25
import java.util.Collection;
28
import java.util.Collection;
Lines 257-271 Link Here
257
			OCLExpression<C> arg = args.get(0);
260
			OCLExpression<C> arg = args.get(0);
258
			Object argVal = arg.accept(getVisitor());
261
			Object argVal = arg.accept(getVisitor());
259
	        
262
	        
260
	        if (sourceVal instanceof Number) {
263
	        // normalise to BigInteger or BigDecimal for comparison
261
	            // coerce to Long or Double, if possible, for comparison
264
	        sourceVal = ObjectUtil.normalise(sourceVal);
262
	            sourceVal = higherPrecisionNumber((Number) sourceVal);
265
	        argVal = ObjectUtil.normalise(argVal);
263
	        }
264
	        
265
	        if (argVal instanceof Number) {
266
	            // coerce to Long or Double, if possible, for comparison
267
	            argVal = higherPrecisionNumber((Number) argVal);
268
	        }
269
266
270
			return Boolean.valueOf(ObjectUtil.equal(sourceVal, argVal));
267
			return Boolean.valueOf(ObjectUtil.equal(sourceVal, argVal));
271
		}
268
		}
Lines 277-291 Link Here
277
			OCLExpression<C> arg = args.get(0);
274
			OCLExpression<C> arg = args.get(0);
278
			Object argVal = arg.accept(getVisitor());
275
			Object argVal = arg.accept(getVisitor());
279
		       
276
		       
280
	        if (sourceVal instanceof Number) {
277
	        // normalise to BigInteger or BigDecimal for comparison
281
	            // coerce to Long or Double, if possible, for comparison
278
	        sourceVal = ObjectUtil.normalise(sourceVal);
282
	            sourceVal = higherPrecisionNumber((Number) sourceVal);
279
            argVal = ObjectUtil.normalise(argVal);
283
	        }
284
           
285
            if (argVal instanceof Number) {
286
                // coerce to Long or Double, if possible, for comparison
287
                argVal = higherPrecisionNumber((Number) argVal);
288
            }
289
280
290
			return Boolean.valueOf(!ObjectUtil.equal(sourceVal, argVal));
281
			return Boolean.valueOf(!ObjectUtil.equal(sourceVal, argVal));
291
		}
282
		}
Lines 309-391 Link Here
309
                    return getInvalid();
300
                    return getInvalid();
310
                }
301
                }
311
				
302
				
303
		        // normalise to BigInteger or BigDecimal
304
		        sourceVal = ObjectUtil.normalise(sourceVal);
312
				// evaluate this operation
305
				// evaluate this operation
313
				switch (opCode) {
306
				switch (opCode) {
314
						
307
						
315
					case PredefinedType.MINUS:
308
					case PredefinedType.MINUS:
316
						// Integer::minus()
309
                        if (sourceVal instanceof UnlimitedNaturalLiteralExp<?>) {
317
						if (sourceVal instanceof Integer) {
310
                            // the unlimited value has no negative
318
                            return - (Integer) sourceVal;
311
                            return getInvalid();
319
                        } else if (sourceVal instanceof Long) {
320
                            return - (Long) sourceVal;
321
                        }
312
                        }
322
313
						if (sourceVal instanceof BigInteger) {
323
						// Double::minus()
314
							// Integer::minus()
324
						return - (Double) sourceVal;
315
		                    return ((BigInteger) sourceVal).negate();
316
		                }
317
						else {
318
							// Double::minus()
319
		                    return ((BigDecimal) sourceVal).negate();
320
		                }
325
321
326
					case PredefinedType.ABS:
322
					case PredefinedType.ABS:
327
						if (sourceVal instanceof Integer) {
323
                        if (sourceVal instanceof UnlimitedNaturalLiteralExp<?>) {
328
						    int sourceInt = (Integer) sourceVal;
324
                            // the unlimited value has no absolute
329
                            
325
                            return getInvalid();
330
                            if (sourceType == getUnlimitedNatural()) {
326
                        }
331
                                // the unlimited value has no absolute
327
						if (sourceVal instanceof BigInteger) {
332
                                if (sourceInt == UnlimitedNaturalLiteralExp.UNLIMITED) {
333
                                    return getInvalid();
334
                                }
335
                            }
336
                            
337
							// Integer::abs()
338
							return Math.abs(sourceInt);
339
                        } else if (sourceVal instanceof Long) {
340
                            long sourceInt = (Long) sourceVal;
341
                            
342
                            if (sourceType == getUnlimitedNatural()) {
343
                                // the unlimited value has no absolute
344
                                if (sourceInt == UnlimitedNaturalLiteralExp.UNLIMITED) {
345
                                    return getInvalid();
346
                                }
347
                            }
348
                            
349
                            // Integer::abs()
328
                            // Integer::abs()
350
                            return Math.abs(sourceInt);
329
                            return ((BigInteger)sourceVal).abs();
351
                        }
330
                        }
352
                        
331
						else {
353
						// Real::abs()
332
							// Real::abs()
354
						return Math.abs((Double) sourceVal);
333
                            return ((BigDecimal)sourceVal).abs();
334
						}
355
335
356
					case PredefinedType.FLOOR:
336
					case PredefinedType.FLOOR:
357
						if (sourceVal instanceof Double) {
337
                        // the unlimited value has no floor
338
                        if (sourceVal instanceof UnlimitedNaturalLiteralExp<?>) {
339
                            return getInvalid();
340
                        }
341
						if (sourceVal instanceof BigDecimal) {
358
							// Real::floor()
342
							// Real::floor()
359
							return (int) Math.floor((Double) sourceVal);
343
							return ((BigDecimal)sourceVal).divideToIntegralValue(BigDecimal.ONE).toBigInteger();
360
						}
344
						}
361
362
                        if (sourceType == getUnlimitedNatural()) {
363
                            long sourceInt = (Long) higherPrecisionNumber((Number) sourceVal);
364
                            
365
                            // the unlimited value has no floor
366
                            if (sourceInt == UnlimitedNaturalLiteralExp.UNLIMITED) {
367
                                return getInvalid();
368
                            }
369
                        }
370
                        
371
						// Integer::floor()
345
						// Integer::floor()
372
						return sourceVal;
346
						return sourceVal;
373
347
374
					case PredefinedType.ROUND:
348
					case PredefinedType.ROUND:
375
						if (sourceVal instanceof Double) {
349
                        // the unlimited value can't be rounded
350
                        if (sourceVal instanceof UnlimitedNaturalLiteralExp<?>) {
351
                            return getInvalid();
352
                        }
353
						if (sourceVal instanceof BigDecimal) {
376
							// Real::round()
354
							// Real::round()
377
							return (int) Math.round((Double) sourceVal);
355
							return ((BigDecimal)sourceVal).add(new BigDecimal(0.5)).divideToIntegralValue(BigDecimal.ONE).toBigInteger();
378
						}
356
						}
379
380
                        if (sourceType == getUnlimitedNatural()) {
381
                            long sourceInt = (Long) higherPrecisionNumber((Number) sourceVal);
382
                            
383
                            // the unlimited value can't be rounded
384
                            if (sourceInt == UnlimitedNaturalLiteralExp.UNLIMITED) {
385
                                return getInvalid();
386
                            }
387
                        }
388
                        
389
						// Integer::round()
357
						// Integer::round()
390
						return sourceVal;
358
						return sourceVal;
391
359
Lines 524-529 Link Here
524
					// Integer
492
					// Integer
525
					// and back (necessary since in OCL Integers extend
493
					// and back (necessary since in OCL Integers extend
526
					// Reals but this is not true of the java primtives).
494
					// Reals but this is not true of the java primtives).
495
                	argType = ((TypeExp<C>)arg).getReferredType();
527
496
528
					// if the source is undefined or the conversion to
497
					// if the source is undefined or the conversion to
529
					// OclVoid so is the result
498
					// OclVoid so is the result
Lines 534-555 Link Here
534
                        return getInvalid();
503
                        return getInvalid();
535
                    }
504
                    }
536
505
537
					if (sourceVal instanceof Double
506
					if (sourceVal instanceof BigDecimal
538
						&& (argType == getInteger())) {
507
						&& (argType == getInteger())) {
539
                        return new Integer(((Double) sourceVal).intValue());
508
                        BigInteger bigInteger = ((BigDecimal) sourceVal).toBigInteger();
540
                    } else if (sourceVal instanceof Integer
509
                        BigDecimal delta = ((BigDecimal) sourceVal).subtract(new BigDecimal(bigInteger));
510
						return delta.signum() == 0 ? bigInteger : getInvalid();
511
                    } else if (sourceVal instanceof BigInteger
541
						&& (argType == getReal())) {
512
						&& (argType == getReal())) {
542
                        
513
                        
543
                        if (sourceType == getUnlimitedNatural()) {
514
/*                        if (sourceType == getUnlimitedNatural()) {
544
                            int sourceInt = (Integer) sourceVal;
515
                            int sourceInt = (Integer) sourceVal;
545
                            
516
                            
546
                            // the unlimited value is positive infinity
517
                            // the unlimited value is positive infinity
547
                            if (sourceInt == UnlimitedNaturalLiteralExp.UNLIMITED) {
518
                            if (sourceInt == UnlimitedNaturalLiteralExp.UNLIMITED.intValue()) {
548
                                return Double.POSITIVE_INFINITY;
519
                                return Double.POSITIVE_INFINITY;
549
                            }
520
                            }
550
                        }
521
                        } */
551
                        
522
                        
552
						return new Double(((Integer) sourceVal).doubleValue());
523
						return new BigDecimal((BigInteger) sourceVal);
553
                    }
524
                    }
554
                    
525
                    
555
					return sourceVal;
526
					return sourceVal;
Lines 561-673 Link Here
561
					argVal = arg.accept(getVisitor());
532
					argVal = arg.accept(getVisitor());
562
				}
533
				}
563
534
564
				if (sourceVal instanceof Number) {
535
				// we have a numeric operation.  Promote to high precision
565
                    // we have a numeric operation.  Promote to high precision
536
                sourceVal = ObjectUtil.normalise(sourceVal);                   
566
                    sourceVal = higherPrecisionNumber((Number) sourceVal);
537
                argVal = ObjectUtil.normalise(argVal);
567
                    
568
                    if (argVal instanceof Number) {
569
                        argVal = higherPrecisionNumber((Number) argVal);
570
                    }
571
				}
572
				
538
				
573
				if (sourceVal instanceof Long && argVal instanceof Long) {
539
                boolean sourceUnlimited = sourceVal instanceof UnlimitedNaturalLiteralExp<?>;
574
					//
540
                boolean argUnlimited = argVal instanceof UnlimitedNaturalLiteralExp<?>;
575
					// source and single arg are both integers
541
                if (sourceUnlimited && argUnlimited) {
576
					//
542
                    switch (opCode) {
577
578
                    long sourceInt = (Long) sourceVal;
579
                    long argInt = (Long) argVal;
580
                    
581
                    boolean sourceUnlimited =
582
                        sourceType == getUnlimitedNatural()
583
                            && sourceInt == UnlimitedNaturalLiteralExp.UNLIMITED;
584
                    boolean argUnlimited =
585
                        argType == getUnlimitedNatural()
586
                            && argInt == UnlimitedNaturalLiteralExp.UNLIMITED;
587
                    
588
                    if (sourceUnlimited && argUnlimited) {
589
                        switch (opCode) {
590
                            case PredefinedType.LESS_THAN:
591
                            case PredefinedType.LESS_THAN_EQUAL:
592
                            case PredefinedType.GREATER_THAN:
593
                            case PredefinedType.GREATER_THAN_EQUAL:
594
                                // two inifinte values cannot be compared.  We
595
                                //   allow = and <> only to test for unbounded
596
                                //   multiplicities
597
                                return Boolean.FALSE;
598
                            default:
599
                                // cannot do arithmetic on the unlimited value
600
                                return getInvalid();
601
                            }
602
                    } else if (sourceUnlimited || argUnlimited) {
603
                        switch (opCode) {
604
                        case PredefinedType.LESS_THAN:
543
                        case PredefinedType.LESS_THAN:
605
                        case PredefinedType.LESS_THAN_EQUAL:
544
                        case PredefinedType.LESS_THAN_EQUAL:
606
                            return argUnlimited;
607
                        case PredefinedType.GREATER_THAN:
545
                        case PredefinedType.GREATER_THAN:
608
                        case PredefinedType.GREATER_THAN_EQUAL:
546
                        case PredefinedType.GREATER_THAN_EQUAL:
609
                            return sourceUnlimited;
547
                            // two inifinte values cannot be compared.  We
548
                            //   allow = and <> only to test for unbounded
549
                            //   multiplicities
550
                            return Boolean.FALSE;
610
                        default:
551
                        default:
611
                            // cannot do arithmetic on the unlimited value
552
                            // cannot do arithmetic on the unlimited value
612
                            return getInvalid();
553
                            return getInvalid();
613
                        }
554
                        }
555
                } else if (sourceUnlimited || argUnlimited) {
556
                    switch (opCode) {
557
                    case PredefinedType.LESS_THAN:
558
                    case PredefinedType.LESS_THAN_EQUAL:
559
                        return argUnlimited;
560
                    case PredefinedType.GREATER_THAN:
561
                    case PredefinedType.GREATER_THAN_EQUAL:
562
                        return sourceUnlimited;
563
                    default:
564
                        // cannot do arithmetic on the unlimited value
565
                        return getInvalid();
614
                    }
566
                    }
567
				} else if (sourceVal instanceof BigInteger && argVal instanceof BigInteger) {
568
					//
569
					// source and single arg are both integers
570
					//
571
572
//                    long sourceInt = (Long) sourceVal;
573
//                    long argInt = (Long) argVal;
574
                    
615
                    
575
                    
616
					switch (opCode) {
576
					switch (opCode) {
617
577
618
						// Integer::plus(Integer)
578
						// Integer::plus(Integer)
619
						case PredefinedType.PLUS:
579
						case PredefinedType.PLUS:
620
							return coerceNumber(sourceInt + argInt);
580
							return ((BigInteger)sourceVal).add((BigInteger)argVal);
621
581
622
						// Integer::minus(Integer)
582
						// Integer::minus(Integer)
623
						case PredefinedType.MINUS:
583
						case PredefinedType.MINUS:
624
							return coerceNumber(sourceInt - argInt);
584
							return ((BigInteger)sourceVal).subtract((BigInteger)argVal);
625
585
626
						// Integer::times(Integer)
586
						// Integer::times(Integer)
627
						case PredefinedType.TIMES:
587
						case PredefinedType.TIMES:
628
							return coerceNumber(sourceInt * argInt);
588
							return ((BigInteger)sourceVal).multiply((BigInteger)argVal);
629
589
630
						// Integer::divide(Integer)
590
						// Integer::divide(Integer)
631
						case PredefinedType.DIVIDE: {
591
						case PredefinedType.DIVIDE: {
632
							// denominator of 0 means undefined
592
							// denominator of 0 means undefined
633
							double num = sourceInt;
593
							return (((BigInteger)argVal).signum() == 0) ? getInvalid() :
634
							double denom = argInt;
594
								new BigDecimal((BigInteger)sourceVal).divide(new BigDecimal((BigInteger)argVal), RoundingMode.HALF_EVEN);
635
							return (denom == 0.0) ? getInvalid() : num / denom;
636
						}
595
						}
637
596
638
						// Integer::div(Integer)
597
						// Integer::div(Integer)
639
						case PredefinedType.DIV:
598
						case PredefinedType.DIV:
640
							// denominator of 0 means undefined
599
							// denominator of 0 means undefined
641
							return (argInt == 0) ? getInvalid() :
600
							return (((BigInteger)argVal).signum() == 0) ? getInvalid() :
642
							    coerceNumber(sourceInt / argInt);
601
								((BigInteger)sourceVal).divide((BigInteger)argVal);
643
602
644
						// Integer::mod(Integer)
603
						// Integer::mod(Integer)
645
						case PredefinedType.MOD:
604
						case PredefinedType.MOD:
646
							return coerceNumber(sourceInt % argInt);
605
							return ((BigInteger)sourceVal).mod((BigInteger)argVal);
647
606
648
						// Integer::max(Integer)
607
						// Integer::max(Integer)
649
						case PredefinedType.MAX:
608
						case PredefinedType.MAX:
650
							return coerceNumber(Math.max(sourceInt, argInt));
609
							return ((BigInteger)sourceVal).max((BigInteger)argVal);
651
610
652
						// Integer::min(Integer)
611
						// Integer::min(Integer)
653
						case PredefinedType.MIN:
612
						case PredefinedType.MIN:
654
							return coerceNumber(Math.min(sourceInt, argInt));
613
							return ((BigInteger)sourceVal).min((BigInteger)argVal);
655
614
656
						// Integer::lessThan(Integer)
615
						// Integer::lessThan(Integer)
657
						case PredefinedType.LESS_THAN:
616
						case PredefinedType.LESS_THAN:
658
							return sourceInt < argInt;
617
							return ((BigInteger)sourceVal).compareTo((BigInteger)argVal) < 0;
659
618
660
						// Integer::greaterThan(Integer)
619
						// Integer::greaterThan(Integer)
661
						case PredefinedType.GREATER_THAN:
620
						case PredefinedType.GREATER_THAN:
662
							return sourceInt > argInt;
621
							return ((BigInteger)sourceVal).compareTo((BigInteger)argVal) > 0;
663
622
664
						// Integer::lessThanEqual(Integer)
623
						// Integer::lessThanEqual(Integer)
665
						case PredefinedType.LESS_THAN_EQUAL:
624
						case PredefinedType.LESS_THAN_EQUAL:
666
							return sourceInt <= argInt;
625
							return ((BigInteger)sourceVal).compareTo((BigInteger)argVal) <= 0;
667
626
668
						// Integer::greaterThanEqual(Integer)
627
						// Integer::greaterThanEqual(Integer)
669
						case PredefinedType.GREATER_THAN_EQUAL:
628
						case PredefinedType.GREATER_THAN_EQUAL:
670
							return sourceInt >= argInt;
629
							return ((BigInteger)sourceVal).compareTo((BigInteger)argVal) >= 0;
671
630
672
						default: {
631
						default: {
673
							String message = OCLMessages.bind(
632
							String message = OCLMessages.bind(
Lines 679-859 Link Here
679
							throw error;
638
							throw error;
680
						}
639
						}
681
					}
640
					}
682
				} else if (sourceVal instanceof Long
641
				} else if (sourceVal instanceof Number
683
					&& argVal instanceof Double) {
642
						&& argVal instanceof Number) {
684
				    
643
					if (sourceVal instanceof BigInteger) {
685
					//
644
						sourceVal = new BigDecimal((BigInteger) sourceVal); 
686
					// source is an integer and single arg is a real
687
					//
688
689
                    long sourceInt = (Long) sourceVal;
690
                    double argReal = (Double) argVal;
691
                    
692
                    if (sourceType == getUnlimitedNatural()) {
693
                        if (sourceInt == UnlimitedNaturalLiteralExp.UNLIMITED) {
694
                            switch (opCode) {
695
                            case PredefinedType.LESS_THAN:
696
                                // unlimited is not less than or equal to
697
                                //   any Real value
698
                                return Boolean.FALSE;
699
                            case PredefinedType.GREATER_THAN:
700
                            case PredefinedType.GREATER_THAN_EQUAL:
701
                                // unlimited is greater than 
702
                                //   every Real value
703
                                return Boolean.TRUE;
704
                            default:
705
                                // cannot do arithmetic on the unlimited value
706
                                return getInvalid();
707
                            }
708
                        }
709
                    }
710
                    
711
					switch (opCode) {
712
713
						// Integer::plus(Real)
714
						case PredefinedType.PLUS:
715
							return coerceNumber(sourceInt + argReal);
716
717
						// Integer::minus(Real)
718
						case PredefinedType.MINUS:
719
							return coerceNumber(sourceInt - argReal);
720
721
						// Integer::times(Real)
722
						case PredefinedType.TIMES:
723
							return coerceNumber(sourceInt * argReal);
724
725
						// Integer::divide(Real)
726
                        case PredefinedType.DIVIDE:
727
                            // denominator of 0 results in undefined
728
                            return (argReal == 0.0) ? getInvalid() : sourceInt / argReal;
729
730
						// Integer::max(Real)
731
						case PredefinedType.MAX:
732
							return coerceNumber(Math.max(sourceInt, argReal));
733
734
						// Integer::min(Real)
735
						case PredefinedType.MIN:
736
							return coerceNumber(Math.min(sourceInt, argReal));
737
738
						// Integer::lessThan(Real)
739
						case PredefinedType.LESS_THAN:
740
							return sourceInt < argReal;
741
742
						// Integer::greaterThan(Real)
743
						case PredefinedType.GREATER_THAN:
744
							return sourceInt > argReal;
745
746
						// Integer::lessThanEqual(Real)
747
						case PredefinedType.LESS_THAN_EQUAL:
748
							return sourceInt <= argReal;
749
750
						// Integer::greaterThanEqual(Real)
751
						case PredefinedType.GREATER_THAN_EQUAL:
752
							return sourceInt >= argReal;
753
754
						default: {
755
							String message = OCLMessages.bind(
756
									OCLMessages.UnknownOperation_ERROR_,
757
									getName(oper));
758
							RuntimeException error = new RuntimeException(message);
759
							OCLPlugin.throwing(getClass(),
760
								"visitOperationCallExp", error);//$NON-NLS-1$
761
							throw error;
762
						}
763
					}
645
					}
764
				}
646
					if (argVal instanceof BigInteger) {
765
647
						argVal = new BigDecimal((BigInteger) argVal); 
766
				else if (sourceVal instanceof Double
767
					&& argVal instanceof Long) {
768
				    
769
				    double sourceReal = (Double) sourceVal;
770
				    long argInt = (Long) argVal;
771
				    
772
					//
773
					// source is a real and single arg is an integer
774
					//	
775
776
                    if (argType == getUnlimitedNatural()) {
777
                        if (argInt == UnlimitedNaturalLiteralExp.UNLIMITED) {
778
                            switch (opCode) {
779
                            case PredefinedType.LESS_THAN:
780
                                // unlimited is greater than 
781
                                //   every Real value
782
                                return Boolean.TRUE;
783
                            case PredefinedType.GREATER_THAN:
784
                            case PredefinedType.GREATER_THAN_EQUAL:
785
                                // unlimited is not less than or equal to
786
                                //   any Real value
787
                                return Boolean.FALSE;
788
                            default:
789
                                // cannot do arithmetic on the unlimited value
790
                                return getInvalid();
791
                            }
792
                        }
793
                    }
794
795
                    // for these arithmetic operations, don't need to coerce
796
                    // the result to any other precision because OCL Reals are
797
                    // represented as Doubles, anyway
798
					switch (opCode) {
799
800
						// Real::plus(Integer)
801
						case PredefinedType.PLUS:
802
							return sourceReal + argInt;
803
804
						// Real::minus(Integer)
805
						case PredefinedType.MINUS:
806
							return sourceReal - argInt;
807
808
						// Real::times(Integer)
809
						case PredefinedType.TIMES:
810
							return sourceReal * argInt;
811
812
						// Real::divide(Integer)
813
                        case PredefinedType.DIVIDE:
814
                            // denominator of 0 results in undefined
815
                            return (argInt == 0) ? getInvalid() : sourceReal / argInt;
816
817
						// Real::max(Integer)
818
						case PredefinedType.MAX:
819
							return Math.max(sourceReal, argInt);
820
821
						// Real::min(Integer)
822
						case PredefinedType.MIN:
823
							return Math.min(sourceReal, argInt);
824
825
						// Real::lessThan(Integer)
826
						case PredefinedType.LESS_THAN:
827
							return sourceReal < argInt;
828
829
						// Real::greaterThan(Integer)
830
						case PredefinedType.GREATER_THAN:
831
							return sourceReal > argInt;
832
833
						// Real::lessThanEqual(Integer)
834
						case PredefinedType.LESS_THAN_EQUAL:
835
							return sourceReal <= argInt;
836
837
						// Real::greaterThanEqual(Integer)
838
						case PredefinedType.GREATER_THAN_EQUAL:
839
							return sourceReal >= argInt;
840
841
						default: {
842
							String message = OCLMessages.bind(
843
									OCLMessages.UnknownOperation_ERROR_,
844
								getName(oper));
845
							RuntimeException error = new RuntimeException(message);
846
							OCLPlugin.throwing(getClass(),
847
								"visitOperationCallExp", error);//$NON-NLS-1$
848
							throw error;
849
						}
850
					}
648
					}
851
				} else if (sourceVal instanceof Double
852
					&& argVal instanceof Double) {
853
				    
854
                    double sourceReal = (Double) sourceVal;
855
                    double argReal = (Double) argVal;
856
				    
857
					//
649
					//
858
					// source is a real and single arg is a real
650
					// source is a real and single arg is a real
859
					//	
651
					//	
Lines 862-905 Link Here
862
654
863
						// Real::plus(Real)
655
						// Real::plus(Real)
864
						case PredefinedType.PLUS:
656
						case PredefinedType.PLUS:
865
							return sourceReal + argReal;
657
							return ((BigDecimal)sourceVal).add((BigDecimal)argVal);
866
658
867
						// Real::minus(Real)
659
						// Real::minus(Real)
868
						case PredefinedType.MINUS:
660
						case PredefinedType.MINUS:
869
							return sourceReal - argReal;
661
							return ((BigDecimal)sourceVal).subtract((BigDecimal)argVal);
870
662
871
						// Real::times(Real)
663
						// Real::times(Real)
872
						case PredefinedType.TIMES:
664
						case PredefinedType.TIMES:
873
							return sourceReal * argReal;
665
							return ((BigDecimal)sourceVal).multiply((BigDecimal)argVal);
874
666
875
						// Real::divide(Real)
667
						// Real::divide(Real)
876
						case PredefinedType.DIVIDE:
668
						case PredefinedType.DIVIDE:
877
                            // denominator of 0 results in undefined
669
                            // denominator of 0 results in undefined
878
                            return (argReal == 0.0) ? getInvalid() : sourceReal / argReal;
670
							return (((BigDecimal)argVal).signum() == 0) ? getInvalid() :
671
								((BigDecimal)sourceVal).divide((BigDecimal)argVal);
879
672
880
						// Real::max(Real)
673
						// Real::max(Real)
881
						case PredefinedType.MAX:
674
						case PredefinedType.MAX:
882
							return Math.max(sourceReal, argReal);
675
							return ((BigDecimal)sourceVal).max((BigDecimal)argVal);
883
676
884
						// Real::min(Real)
677
						// Real::min(Real)
885
						case PredefinedType.MIN:
678
						case PredefinedType.MIN:
886
							return Math.min(sourceReal, argReal);
679
							return ((BigDecimal)sourceVal).min((BigDecimal)argVal);
887
680
888
						// Real::lessThan(Real)
681
						// Real::lessThan(Real)
889
						case PredefinedType.LESS_THAN:
682
						case PredefinedType.LESS_THAN:
890
							return sourceReal < argReal;
683
							return ((BigDecimal)sourceVal).compareTo((BigDecimal)argVal) < 0;
891
684
892
						// Real::greaterThan(Real)
685
						// Real::greaterThan(Real)
893
						case PredefinedType.GREATER_THAN:
686
						case PredefinedType.GREATER_THAN:
894
							return sourceReal > argReal;
687
							return ((BigDecimal)sourceVal).compareTo((BigDecimal)argVal) > 0;
895
688
896
						// Real::lessThanEqual(Real)
689
						// Real::lessThanEqual(Real)
897
						case PredefinedType.LESS_THAN_EQUAL:
690
						case PredefinedType.LESS_THAN_EQUAL:
898
							return sourceReal <= argReal;
691
							return ((BigDecimal)sourceVal).compareTo((BigDecimal)argVal) <= 0;
899
692
900
						// Real::greaterThanEqual(Real)
693
						// Real::greaterThanEqual(Real)
901
						case PredefinedType.GREATER_THAN_EQUAL:
694
						case PredefinedType.GREATER_THAN_EQUAL:
902
							return sourceReal >= argReal;
695
							return ((BigDecimal)sourceVal).compareTo((BigDecimal)argVal) >= 0;
903
696
904
						default: {
697
						default: {
905
							String message = OCLMessages.bind(
698
							String message = OCLMessages.bind(
Lines 1101-1107 Link Here
1101
894
1102
						case PredefinedType.AT: {
895
						case PredefinedType.AT: {
1103
							// OrderedSet, Sequence::at(Integer)
896
							// OrderedSet, Sequence::at(Integer)
1104
							int indexVal = ((Integer) argVal).intValue();
897
							int indexVal = ((Number) argVal).intValue();
1105
							return CollectionUtil.at(sourceColl, indexVal);
898
							return CollectionUtil.at(sourceColl, indexVal);
1106
						}
899
						}
1107
900
Lines 1170-1196 Link Here
1170
					// just one ternary string operation
963
					// just one ternary string operation
1171
					// String::substring(Integer, Integer)
964
					// String::substring(Integer, Integer)
1172
					// index orgin 1 for OCL
965
					// index orgin 1 for OCL
1173
					int lower = ((Integer) arg1).intValue() - 1;
966
					int lower = ((Number) arg1).intValue() - 1;
1174
					int upper = ((Integer) arg2).intValue();
967
					int upper = ((Number) arg2).intValue();
1175
					return ((String) sourceVal).substring(lower, upper);
968
					return ((String) sourceVal).substring(lower, upper);
1176
				} else if (sourceVal instanceof Collection<?>) {
969
				} else if (sourceVal instanceof Collection<?>) {
1177
					@SuppressWarnings("unchecked")
970
					@SuppressWarnings("unchecked")
1178
					Collection<Object> sourceColl = (Collection<Object>) sourceVal;
971
					Collection<Object> sourceColl = (Collection<Object>) sourceVal;
1179
					if (opCode == PredefinedType.INSERT_AT) {
972
					if (opCode == PredefinedType.INSERT_AT) {
1180
						// OrderedSet, Sequence::insertAt(Integer, T)
973
						// OrderedSet, Sequence::insertAt(Integer, T)
1181
						int index = ((Integer) arg1).intValue();
974
						int index = ((Number) arg1).intValue();
1182
						return CollectionUtil.insertAt(sourceColl, index,
975
						return CollectionUtil.insertAt(sourceColl, index,
1183
							arg2);
976
							arg2);
1184
					} else if (opCode == PredefinedType.SUB_ORDERED_SET) {
977
					} else if (opCode == PredefinedType.SUB_ORDERED_SET) {
1185
						// OrderedSet, Sequence::subOrderedSet(Integer, Integer)
978
						// OrderedSet, Sequence::subOrderedSet(Integer, Integer)
1186
						int lower = ((Integer) arg1).intValue();
979
						int lower = ((Number) arg1).intValue();
1187
						int upper = ((Integer) arg2).intValue();
980
						int upper = ((Number) arg2).intValue();
1188
						return CollectionUtil.subOrderedSet(sourceColl,
981
						return CollectionUtil.subOrderedSet(sourceColl,
1189
							lower, upper);
982
							lower, upper);
1190
					} else if (opCode == PredefinedType.SUB_SEQUENCE) {
983
					} else if (opCode == PredefinedType.SUB_SEQUENCE) {
1191
						// Sequence::subSequence(Integer, Integer)
984
						// Sequence::subSequence(Integer, Integer)
1192
						int lower = ((Integer) arg1).intValue();
985
						int lower = ((Number) arg1).intValue();
1193
						int upper = ((Integer) arg2).intValue();
986
						int upper = ((Number) arg2).intValue();
1194
						return CollectionUtil.subSequence(sourceColl,
987
						return CollectionUtil.subSequence(sourceColl,
1195
							lower, upper);
988
							lower, upper);
1196
					}
989
					}
Lines 2044-2050 Link Here
2044
    @Override
1837
    @Override
2045
    public Object visitUnlimitedNaturalLiteralExp(
1838
    public Object visitUnlimitedNaturalLiteralExp(
2046
            UnlimitedNaturalLiteralExp<C> literalExp) {
1839
            UnlimitedNaturalLiteralExp<C> literalExp) {
2047
        return literalExp.getIntegerSymbol();
1840
        return literalExp.isUnlimited() ? literalExp : literalExp.getUnlimitedNaturalSymbol();
2048
    }
1841
    }
2049
1842
2050
	/**
1843
	/**
Lines 2129-2141 Link Here
2129
			OCLExpression<C> last = collRange.getLast();
1922
			OCLExpression<C> last = collRange.getLast();
2130
1923
2131
			// evaluate first value
1924
			// evaluate first value
2132
			Integer firstVal = (Integer) first.accept(getVisitor());
1925
			Number firstVal = (Number) first.accept(getVisitor());
2133
			if (firstVal == null) {
1926
			if (firstVal == null) {
2134
				result.add(null);
1927
				result.add(null);
2135
				return result;
1928
				return result;
2136
			}
1929
			}
2137
			// evaluate last value
1930
			// evaluate last value
2138
			Integer lastVal = (Integer) last.accept(getVisitor());
1931
			Number lastVal = (Number) last.accept(getVisitor());
2139
			if (lastVal == null) {
1932
			if (lastVal == null) {
2140
				result.add(null);
1933
				result.add(null);
2141
				return result;
1934
				return result;
Lines 2168-2182 Link Here
2168
					OCLExpression<C> last = range.getLast();
1961
					OCLExpression<C> last = range.getLast();
2169
1962
2170
					// evaluate first value
1963
					// evaluate first value
2171
					Integer firstVal = (Integer) first.accept(getVisitor());
1964
					Number firstVal = (Number) first.accept(getVisitor());
2172
					Integer lastVal = (Integer) last.accept(getVisitor());
1965
					Number lastVal = (Number) last.accept(getVisitor());
2173
					if (!((firstVal == null) || (lastVal == null))) {
1966
					if (!((firstVal == null) || (lastVal == null))) {
2174
						// TODO: enhance IntegerRangeList to support multiple ranges
1967
						// TODO: enhance IntegerRangeList to support multiple ranges
2175
						// add values between first and last inclusive
1968
						// add values between first and last inclusive
2176
						int firstInt = firstVal.intValue();
1969
						int firstInt = firstVal.intValue();
2177
						int lastInt = lastVal.intValue();
1970
						int lastInt = lastVal.intValue();
2178
						for (int i = firstInt; i <= lastInt; i++) {
1971
						for (int i = firstInt; i <= lastInt; i++) {
2179
                            result.add(new Integer(i));
1972
                            result.add(BigInteger.valueOf(i));
2180
                        }
1973
                        }
2181
					}
1974
					}
2182
				} // end of collection range
1975
				} // end of collection range
Lines 2190-2196 Link Here
2190
1983
2191
	// private static inner class for lazy lists over an integer range
1984
	// private static inner class for lazy lists over an integer range
2192
	private static final class IntegerRangeList
1985
	private static final class IntegerRangeList
2193
		extends AbstractList<Integer> {
1986
		extends AbstractList<BigInteger> {
2194
1987
2195
//		public IntegerRangeList() {
1988
//		public IntegerRangeList() {
2196
//			super();
1989
//			super();
Lines 2216-2222 Link Here
2216
		}
2009
		}
2217
2010
2218
		@Override
2011
		@Override
2219
        public Integer get(int index) {
2012
        public BigInteger get(int index) {
2220
			if (index < 0 || index >= size()) {
2013
			if (index < 0 || index >= size()) {
2221
				String message = OCLMessages.bind(
2014
				String message = OCLMessages.bind(
2222
						OCLMessages.IndexOutOfRange_ERROR_,
2015
						OCLMessages.IndexOutOfRange_ERROR_,
Lines 2229-2257 Link Here
2229
				OCLPlugin.throwing(getClass(), "get", error);//$NON-NLS-1$
2022
				OCLPlugin.throwing(getClass(), "get", error);//$NON-NLS-1$
2230
				throw error;
2023
				throw error;
2231
			}
2024
			}
2232
			return new Integer(first + index);
2025
			return BigInteger.valueOf(first + index);
2233
		}
2026
		}
2234
2027
2235
		@Override
2028
		@Override
2236
        public Iterator<Integer> iterator() {
2029
        public Iterator<BigInteger> iterator() {
2237
			// local iterator class that provides
2030
			// local iterator class that provides
2238
			// hasNext() and next() methods appropriate
2031
			// hasNext() and next() methods appropriate
2239
			// for this range set
2032
			// for this range set
2240
			class IntegerRangeIterator
2033
			class IntegerRangeIterator
2241
				implements Iterator<Integer> {
2034
				implements Iterator<BigInteger> {
2242
2035
2243
				public IntegerRangeIterator() {
2036
				public IntegerRangeIterator() {
2244
					curr = first;
2037
					curr = first;
2245
					initialized = false;
2038
					initialized = false;
2246
				}
2039
				}
2247
2040
2248
				public Integer next() {
2041
				public BigInteger next() {
2249
					if (!initialized) {
2042
					if (!initialized) {
2250
						curr = first - 1;
2043
						curr = first - 1;
2251
						initialized = true;
2044
						initialized = true;
2252
					}
2045
					}
2253
					if (hasNext()) {
2046
					if (hasNext()) {
2254
                        return new Integer(++curr);
2047
                        return BigInteger.valueOf(++curr);
2255
                    }
2048
                    }
2256
					throw new NoSuchElementException();
2049
					throw new NoSuchElementException();
2257
				}
2050
				}
(-)src/org/eclipse/ocl/OCL.java (-2 / +38 lines)
Lines 31-36 Link Here
31
import org.eclipse.ocl.helper.OCLHelper;
31
import org.eclipse.ocl.helper.OCLHelper;
32
import org.eclipse.ocl.internal.OCLDebugOptions;
32
import org.eclipse.ocl.internal.OCLDebugOptions;
33
import org.eclipse.ocl.internal.OCLPlugin;
33
import org.eclipse.ocl.internal.OCLPlugin;
34
import org.eclipse.ocl.internal.evaluation.NumberUtil;
34
import org.eclipse.ocl.internal.evaluation.QueryImpl;
35
import org.eclipse.ocl.internal.evaluation.QueryImpl;
35
import org.eclipse.ocl.internal.helper.HelperUtil;
36
import org.eclipse.ocl.internal.helper.HelperUtil;
36
import org.eclipse.ocl.lpg.ProblemHandler;
37
import org.eclipse.ocl.lpg.ProblemHandler;
Lines 418-437 Link Here
418
	 * Evaluates a query expression on a context object (which is bound to the
419
	 * Evaluates a query expression on a context object (which is bound to the
419
	 * <tt>self</tt> variable). Clients should use the
420
	 * <tt>self</tt> variable). Clients should use the
420
	 * {@link #isInvalid(Object)} method to check whether the evaluation result
421
	 * {@link #isInvalid(Object)} method to check whether the evaluation result
421
	 * is <tt>OclInvalid</tt>.
422
	 * is <tt>invalid</tt>.
423
	 * <p>Any BigDecimal or BigInteger result is converted to the smallest of Double, or Long or
424
	 * Integer when possible. Use {@link #rawEvaluate(Object, Object)} to retain the internal precision.</p>
422
	 * 
425
	 * 
423
	 * @param context
426
	 * @param context
424
	 *            the context (self) object
427
	 *            the context (self) object
425
	 * @param expression
428
	 * @param expression
426
	 *            the OCL expression to evaluate
429
	 *            the OCL expression to evaluate
427
	 * 
430
	 * 
428
	 * @return the value of the expression, or <tt>OclInvalid</tt> if the
431
	 * @return the value of the expression, or <tt>invalid</tt> if the
429
	 *         evaluation fails for reasons other than a run-time exception
432
	 *         evaluation fails for reasons other than a run-time exception
430
	 * 
433
	 * 
431
	 * @see #isInvalid(Object)
434
	 * @see #isInvalid(Object)
435
	 * @see #rawEvaluate(Object, Object)
432
	 * @see #check(Object, Object)
436
	 * @see #check(Object, Object)
433
	 */
437
	 */
434
	public Object evaluate(Object context, OCLExpression<C> expression) {
438
	public Object evaluate(Object context, OCLExpression<C> expression) {
439
		Object result = rawEvaluate(context, expression);
440
		if (result instanceof Number) {
441
			result = NumberUtil.coerceNumber((Number) result);
442
		}
443
		return result;
444
	}
445
446
	/**
447
	 * Evaluates a query expression on a context object (which is bound to the
448
	 * <tt>self</tt> variable). Clients should use the
449
	 * {@link #isInvalid(Object)} method to check whether the evaluation result
450
	 * is <tt>invalid</tt>.
451
	 * <br>Any Real result is represented by a BigDecimal object.
452
	 * <br>Any Integer result is represented by a BigInteger object.
453
	 * <br>Any (limited) UnlimitedNatural result is represented by a BigInteger object.
454
	 * <br>The unlimited UnlimitedNatural result is represented by an UnlimitedNaturalLiteralExp object
455
	 * whose value is UnlimitedNaturalLiteralExp.UNLIMITED.
456
	 * 
457
	 * @param context
458
	 *            the context (self) object
459
	 * @param expression
460
	 *            the OCL expression to evaluate
461
	 * 
462
	 * @return the value of the expression, or <tt>invalid</tt> if the
463
	 *         evaluation fails for reasons other than a run-time exception
464
	 * 
465
	 * @see #isInvalid(Object)
466
	 * @see #check(Object, Object)
467
	 * @see #evaluate(Object, Object)
468
	 * @since 3.0
469
	 */
470
	public Object rawEvaluate(Object context, OCLExpression<C> expression) {
435
		evaluationProblems = null;
471
		evaluationProblems = null;
436
		
472
		
437
		// can determine a more appropriate context from the context
473
		// can determine a more appropriate context from the context
(-)src/org/eclipse/ocl/cst/CSTPackage.java (-13 / +12 lines)
Lines 3568-3582 Link Here
3568
	int UNLIMITED_NATURAL_LITERAL_EXP_CS__SYMBOL = PRIMITIVE_LITERAL_EXP_CS__SYMBOL;
3568
	int UNLIMITED_NATURAL_LITERAL_EXP_CS__SYMBOL = PRIMITIVE_LITERAL_EXP_CS__SYMBOL;
3569
3569
3570
	/**
3570
	/**
3571
	 * The feature id for the '<em><b>Integer Symbol</b></em>' attribute.
3571
	 * The feature id for the '<em><b>Unlimited Natural Symbol</b></em>' attribute.
3572
	 * <!-- begin-user-doc -->
3572
	 * <!-- begin-user-doc -->
3573
	 * This value may change when the model code is regenerated.
3573
	 * @since 3.0
3574
	 * It is subject to change without notice.
3575
	 * <!-- end-user-doc -->
3574
	 * <!-- end-user-doc -->
3576
	 * @generated
3575
	 * @generated
3577
	 * @ordered
3576
	 * @ordered
3578
	 */
3577
	 */
3579
	int UNLIMITED_NATURAL_LITERAL_EXP_CS__INTEGER_SYMBOL = PRIMITIVE_LITERAL_EXP_CS_FEATURE_COUNT + 0;
3578
	int UNLIMITED_NATURAL_LITERAL_EXP_CS__UNLIMITED_NATURAL_SYMBOL = PRIMITIVE_LITERAL_EXP_CS_FEATURE_COUNT + 0;
3580
3579
3581
	/**
3580
	/**
3582
	 * The number of structural features of the '<em>Unlimited Natural Literal Exp CS</em>' class.
3581
	 * The number of structural features of the '<em>Unlimited Natural Literal Exp CS</em>' class.
Lines 3668-3675 Link Here
3668
	/**
3667
	/**
3669
	 * The feature id for the '<em><b>Real Symbol</b></em>' attribute.
3668
	 * The feature id for the '<em><b>Real Symbol</b></em>' attribute.
3670
	 * <!-- begin-user-doc -->
3669
	 * <!-- begin-user-doc -->
3671
	 * This value may change when the model code is regenerated.
3672
	 * It is subject to change without notice.
3673
	 * <!-- end-user-doc -->
3670
	 * <!-- end-user-doc -->
3674
	 * @generated
3671
	 * @generated
3675
	 * @ordered
3672
	 * @ordered
Lines 6243-6257 Link Here
6243
	EClass getUnlimitedNaturalLiteralExpCS();
6240
	EClass getUnlimitedNaturalLiteralExpCS();
6244
6241
6245
	/**
6242
	/**
6246
	 * Returns the meta object for the attribute '{@link org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS#getIntegerSymbol <em>Integer Symbol</em>}'.
6243
	 * Returns the meta object for the attribute '{@link org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS#getUnlimitedNaturalSymbol <em>Unlimited Natural Symbol</em>}'.
6247
	 * <!-- begin-user-doc -->
6244
	 * <!-- begin-user-doc -->
6245
	 * @since 3.0
6248
	 * <!-- end-user-doc -->
6246
	 * <!-- end-user-doc -->
6249
	 * @return the meta object for the attribute '<em>Integer Symbol</em>'.
6247
	 * @return the meta object for the attribute '<em>Unlimited Natural Symbol</em>'.
6250
	 * @see org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS#getIntegerSymbol()
6248
	 * @see org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS#getUnlimitedNaturalSymbol()
6251
	 * @see #getUnlimitedNaturalLiteralExpCS()
6249
	 * @see #getUnlimitedNaturalLiteralExpCS()
6252
	 * @generated
6250
	 * @generated
6253
	 */
6251
	 */
6254
	EAttribute getUnlimitedNaturalLiteralExpCS_IntegerSymbol();
6252
	EAttribute getUnlimitedNaturalLiteralExpCS_UnlimitedNaturalSymbol();
6255
6253
6256
	/**
6254
	/**
6257
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.RealLiteralExpCS <em>Real Literal Exp CS</em>}'.
6255
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.RealLiteralExpCS <em>Real Literal Exp CS</em>}'.
Lines 7560-7572 Link Here
7560
			.getUnlimitedNaturalLiteralExpCS();
7558
			.getUnlimitedNaturalLiteralExpCS();
7561
7559
7562
		/**
7560
		/**
7563
		 * The meta object literal for the '<em><b>Integer Symbol</b></em>' attribute feature.
7561
		 * The meta object literal for the '<em><b>Unlimited Natural Symbol</b></em>' attribute feature.
7564
		 * <!-- begin-user-doc -->
7562
		 * <!-- begin-user-doc -->
7563
		 * @since 3.0
7565
		 * <!-- end-user-doc -->
7564
		 * <!-- end-user-doc -->
7566
		 * @generated
7565
		 * @generated
7567
		 */
7566
		 */
7568
		EAttribute UNLIMITED_NATURAL_LITERAL_EXP_CS__INTEGER_SYMBOL = eINSTANCE
7567
		EAttribute UNLIMITED_NATURAL_LITERAL_EXP_CS__UNLIMITED_NATURAL_SYMBOL = eINSTANCE
7569
			.getUnlimitedNaturalLiteralExpCS_IntegerSymbol();
7568
			.getUnlimitedNaturalLiteralExpCS_UnlimitedNaturalSymbol();
7570
7569
7571
		/**
7570
		/**
7572
		 * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.RealLiteralExpCSImpl <em>Real Literal Exp CS</em>}' class.
7571
		 * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.RealLiteralExpCSImpl <em>Real Literal Exp CS</em>}' class.
(-)src/org/eclipse/ocl/cst/IntegerLiteralExpCS.java (-3 / +7 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.cst;
18
package org.eclipse.ocl.cst;
19
19
20
import java.math.BigInteger;
21
20
/**
22
/**
21
 * <!-- begin-user-doc -->
23
 * <!-- begin-user-doc -->
22
 * A representation of the model object '<em><b>Integer Literal Exp CS</b></em>'.
24
 * A representation of the model object '<em><b>Integer Literal Exp CS</b></em>'.
Lines 43-65 Link Here
43
	 * If the meaning of the '<em>Integer Symbol</em>' attribute isn't clear,
45
	 * If the meaning of the '<em>Integer Symbol</em>' attribute isn't clear,
44
	 * there really should be more of a description here...
46
	 * there really should be more of a description here...
45
	 * </p>
47
	 * </p>
48
	 * @since 3.0
46
	 * <!-- end-user-doc -->
49
	 * <!-- end-user-doc -->
47
	 * @return the value of the '<em>Integer Symbol</em>' attribute.
50
	 * @return the value of the '<em>Integer Symbol</em>' attribute.
48
	 * @see #setIntegerSymbol(Integer)
51
	 * @see #setIntegerSymbol(BigInteger)
49
	 * @see org.eclipse.ocl.cst.CSTPackage#getIntegerLiteralExpCS_IntegerSymbol()
52
	 * @see org.eclipse.ocl.cst.CSTPackage#getIntegerLiteralExpCS_IntegerSymbol()
50
	 * @model
53
	 * @model
51
	 * @generated
54
	 * @generated
52
	 */
55
	 */
53
	Integer getIntegerSymbol();
56
	BigInteger getIntegerSymbol();
54
57
55
	/**
58
	/**
56
	 * Sets the value of the '{@link org.eclipse.ocl.cst.IntegerLiteralExpCS#getIntegerSymbol <em>Integer Symbol</em>}' attribute.
59
	 * Sets the value of the '{@link org.eclipse.ocl.cst.IntegerLiteralExpCS#getIntegerSymbol <em>Integer Symbol</em>}' attribute.
57
	 * <!-- begin-user-doc -->
60
	 * <!-- begin-user-doc -->
61
	 * @since 3.0
58
	 * <!-- end-user-doc -->
62
	 * <!-- end-user-doc -->
59
	 * @param value the new value of the '<em>Integer Symbol</em>' attribute.
63
	 * @param value the new value of the '<em>Integer Symbol</em>' attribute.
60
	 * @see #getIntegerSymbol()
64
	 * @see #getIntegerSymbol()
61
	 * @generated
65
	 * @generated
62
	 */
66
	 */
63
	void setIntegerSymbol(Integer value);
67
	void setIntegerSymbol(BigInteger value);
64
68
65
} // IntegerLiteralExpCS
69
} // IntegerLiteralExpCS
(-)src/org/eclipse/ocl/cst/RealLiteralExpCS.java (-3 / +7 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.cst;
18
package org.eclipse.ocl.cst;
19
19
20
import java.math.BigDecimal;
21
20
/**
22
/**
21
 * <!-- begin-user-doc -->
23
 * <!-- begin-user-doc -->
22
 * A representation of the model object '<em><b>Real Literal Exp CS</b></em>'.
24
 * A representation of the model object '<em><b>Real Literal Exp CS</b></em>'.
Lines 43-65 Link Here
43
	 * If the meaning of the '<em>Real Symbol</em>' attribute isn't clear,
45
	 * If the meaning of the '<em>Real Symbol</em>' attribute isn't clear,
44
	 * there really should be more of a description here...
46
	 * there really should be more of a description here...
45
	 * </p>
47
	 * </p>
48
	 * @since 3.0
46
	 * <!-- end-user-doc -->
49
	 * <!-- end-user-doc -->
47
	 * @return the value of the '<em>Real Symbol</em>' attribute.
50
	 * @return the value of the '<em>Real Symbol</em>' attribute.
48
	 * @see #setRealSymbol(Double)
51
	 * @see #setRealSymbol(BigDecimal)
49
	 * @see org.eclipse.ocl.cst.CSTPackage#getRealLiteralExpCS_RealSymbol()
52
	 * @see org.eclipse.ocl.cst.CSTPackage#getRealLiteralExpCS_RealSymbol()
50
	 * @model
53
	 * @model
51
	 * @generated
54
	 * @generated
52
	 */
55
	 */
53
	Double getRealSymbol();
56
	BigDecimal getRealSymbol();
54
57
55
	/**
58
	/**
56
	 * Sets the value of the '{@link org.eclipse.ocl.cst.RealLiteralExpCS#getRealSymbol <em>Real Symbol</em>}' attribute.
59
	 * Sets the value of the '{@link org.eclipse.ocl.cst.RealLiteralExpCS#getRealSymbol <em>Real Symbol</em>}' attribute.
57
	 * <!-- begin-user-doc -->
60
	 * <!-- begin-user-doc -->
61
	 * @since 3.0
58
	 * <!-- end-user-doc -->
62
	 * <!-- end-user-doc -->
59
	 * @param value the new value of the '<em>Real Symbol</em>' attribute.
63
	 * @param value the new value of the '<em>Real Symbol</em>' attribute.
60
	 * @see #getRealSymbol()
64
	 * @see #getRealSymbol()
61
	 * @generated
65
	 * @generated
62
	 */
66
	 */
63
	void setRealSymbol(Double value);
67
	void setRealSymbol(BigDecimal value);
64
68
65
} // RealLiteralExpCS
69
} // RealLiteralExpCS
(-)src/org/eclipse/ocl/cst/UnlimitedNaturalLiteralExpCS.java (-11 / +15 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.cst;
18
package org.eclipse.ocl.cst;
19
19
20
import java.math.BigInteger;
21
20
/**
22
/**
21
 * <!-- begin-user-doc -->
23
 * <!-- begin-user-doc -->
22
 * A representation of the model object '<em><b>Unlimited Natural Literal Exp CS</b></em>'.
24
 * A representation of the model object '<em><b>Unlimited Natural Literal Exp CS</b></em>'.
Lines 25-31 Link Here
25
 * <p>
27
 * <p>
26
 * The following features are supported:
28
 * The following features are supported:
27
 * <ul>
29
 * <ul>
28
 *   <li>{@link org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS#getIntegerSymbol <em>Integer Symbol</em>}</li>
30
 *   <li>{@link org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS#getUnlimitedNaturalSymbol <em>Unlimited Natural Symbol</em>}</li>
29
 * </ul>
31
 * </ul>
30
 * </p>
32
 * </p>
31
 *
33
 *
Lines 37-65 Link Here
37
		extends PrimitiveLiteralExpCS {
39
		extends PrimitiveLiteralExpCS {
38
40
39
	/**
41
	/**
40
	 * Returns the value of the '<em><b>Integer Symbol</b></em>' attribute.
42
	 * Returns the value of the '<em><b>Unlimited Natural Symbol</b></em>' attribute.
41
	 * <!-- begin-user-doc -->
43
	 * <!-- begin-user-doc -->
42
	 * <p>
44
	 * <p>
43
	 * If the meaning of the '<em>Integer Symbol</em>' attribute isn't clear,
45
	 * If the meaning of the '<em>Unlimited Natural Symbol</em>' attribute isn't clear,
44
	 * there really should be more of a description here...
46
	 * there really should be more of a description here...
45
	 * </p>
47
	 * </p>
48
	 * @since 3.0
46
	 * <!-- end-user-doc -->
49
	 * <!-- end-user-doc -->
47
	 * @return the value of the '<em>Integer Symbol</em>' attribute.
50
	 * @return the value of the '<em>Unlimited Natural Symbol</em>' attribute.
48
	 * @see #setIntegerSymbol(Integer)
51
	 * @see #setUnlimitedNaturalSymbol(BigInteger)
49
	 * @see org.eclipse.ocl.cst.CSTPackage#getUnlimitedNaturalLiteralExpCS_IntegerSymbol()
52
	 * @see org.eclipse.ocl.cst.CSTPackage#getUnlimitedNaturalLiteralExpCS_UnlimitedNaturalSymbol()
50
	 * @model
53
	 * @model
51
	 * @generated
54
	 * @generated
52
	 */
55
	 */
53
	Integer getIntegerSymbol();
56
	BigInteger getUnlimitedNaturalSymbol();
54
57
55
	/**
58
	/**
56
	 * Sets the value of the '{@link org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS#getIntegerSymbol <em>Integer Symbol</em>}' attribute.
59
	 * Sets the value of the '{@link org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS#getUnlimitedNaturalSymbol <em>Unlimited Natural Symbol</em>}' attribute.
57
	 * <!-- begin-user-doc -->
60
	 * <!-- begin-user-doc -->
61
	 * @since 3.0
58
	 * <!-- end-user-doc -->
62
	 * <!-- end-user-doc -->
59
	 * @param value the new value of the '<em>Integer Symbol</em>' attribute.
63
	 * @param value the new value of the '<em>Unlimited Natural Symbol</em>' attribute.
60
	 * @see #getIntegerSymbol()
64
	 * @see #getUnlimitedNaturalSymbol()
61
	 * @generated
65
	 * @generated
62
	 */
66
	 */
63
	void setIntegerSymbol(Integer value);
67
	void setUnlimitedNaturalSymbol(BigInteger value);
64
68
65
} // UnlimitedNaturalLiteralExpCS
69
} // UnlimitedNaturalLiteralExpCS
(-)src/org/eclipse/ocl/cst/impl/CSTFactoryImpl.java (+23 lines)
Lines 74-79 Link Here
74
import org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS;
74
import org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS;
75
import org.eclipse.ocl.cst.VariableCS;
75
import org.eclipse.ocl.cst.VariableCS;
76
import org.eclipse.ocl.cst.VariableExpCS;
76
import org.eclipse.ocl.cst.VariableExpCS;
77
import org.eclipse.ocl.util.ObjectUtil;
77
78
78
/**
79
/**
79
 * <!-- begin-user-doc -->
80
 * <!-- begin-user-doc -->
Lines 818-823 Link Here
818
819
819
	/**
820
	/**
820
	 * <!-- begin-user-doc -->
821
	 * <!-- begin-user-doc -->
822
	 * @since 3.0
823
	 * <!-- end-user-doc -->
824
	 * @generated NOT
825
	 */
826
	public Number createNumberFromString(EDataType eDataType,
827
			String initialValue) {
828
		return ObjectUtil.createNumber(initialValue);
829
	}
830
831
	/**
832
	 * <!-- begin-user-doc -->
833
	 * @since 3.0
834
	 * <!-- end-user-doc -->
835
	 * @generated NOT
836
	 */
837
	public String convertNumberToString(EDataType eDataType,
838
			Object instanceValue) {
839
		return instanceValue.toString();
840
	}
841
842
	/**
843
	 * <!-- begin-user-doc -->
821
	 * <!-- end-user-doc -->
844
	 * <!-- end-user-doc -->
822
	 * @generated
845
	 * @generated
823
	 */
846
	 */
(-)src/org/eclipse/ocl/cst/impl/CSTPackageImpl.java (-8 / +17 lines)
Lines 26-31 Link Here
26
import org.eclipse.emf.ecore.EEnum;
26
import org.eclipse.emf.ecore.EEnum;
27
import org.eclipse.emf.ecore.EPackage;
27
import org.eclipse.emf.ecore.EPackage;
28
import org.eclipse.emf.ecore.EReference;
28
import org.eclipse.emf.ecore.EReference;
29
import org.eclipse.emf.ecore.EcorePackage;
29
import org.eclipse.emf.ecore.impl.EPackageImpl;
30
import org.eclipse.emf.ecore.impl.EPackageImpl;
30
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
31
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
31
import org.eclipse.ocl.cst.CSTFactory;
32
import org.eclipse.ocl.cst.CSTFactory;
Lines 529-534 Link Here
529
530
530
		isInited = true;
531
		isInited = true;
531
532
533
		// Initialize simple dependencies
534
		EcorePackage.eINSTANCE.eClass();
535
532
		// Create package meta-data objects
536
		// Create package meta-data objects
533
		theCSTPackage.createPackageContents();
537
		theCSTPackage.createPackageContents();
534
538
Lines 1296-1305 Link Here
1296
1300
1297
	/**
1301
	/**
1298
	 * <!-- begin-user-doc -->
1302
	 * <!-- begin-user-doc -->
1303
	 * @since 3.0
1299
	 * <!-- end-user-doc -->
1304
	 * <!-- end-user-doc -->
1300
	 * @generated
1305
	 * @generated
1301
	 */
1306
	 */
1302
	public EAttribute getUnlimitedNaturalLiteralExpCS_IntegerSymbol() {
1307
	public EAttribute getUnlimitedNaturalLiteralExpCS_UnlimitedNaturalSymbol() {
1303
		return (EAttribute) unlimitedNaturalLiteralExpCSEClass
1308
		return (EAttribute) unlimitedNaturalLiteralExpCSEClass
1304
			.getEStructuralFeatures().get(0);
1309
			.getEStructuralFeatures().get(0);
1305
	}
1310
	}
Lines 1978-1984 Link Here
1978
1983
1979
		unlimitedNaturalLiteralExpCSEClass = createEClass(UNLIMITED_NATURAL_LITERAL_EXP_CS);
1984
		unlimitedNaturalLiteralExpCSEClass = createEClass(UNLIMITED_NATURAL_LITERAL_EXP_CS);
1980
		createEAttribute(unlimitedNaturalLiteralExpCSEClass,
1985
		createEAttribute(unlimitedNaturalLiteralExpCSEClass,
1981
			UNLIMITED_NATURAL_LITERAL_EXP_CS__INTEGER_SYMBOL);
1986
			UNLIMITED_NATURAL_LITERAL_EXP_CS__UNLIMITED_NATURAL_SYMBOL);
1982
1987
1983
		realLiteralExpCSEClass = createEClass(REAL_LITERAL_EXP_CS);
1988
		realLiteralExpCSEClass = createEClass(REAL_LITERAL_EXP_CS);
1984
		createEAttribute(realLiteralExpCSEClass,
1989
		createEAttribute(realLiteralExpCSEClass,
Lines 2066-2071 Link Here
2066
		setNsPrefix(eNS_PREFIX);
2071
		setNsPrefix(eNS_PREFIX);
2067
		setNsURI(eNS_URI);
2072
		setNsURI(eNS_URI);
2068
2073
2074
		// Obtain other dependent packages
2075
		EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE
2076
			.getEPackage(EcorePackage.eNS_URI);
2077
2069
		// Create type parameters
2078
		// Create type parameters
2070
2079
2071
		// Set bounds for type parameters
2080
		// Set bounds for type parameters
Lines 2589-2595 Link Here
2589
			"IntegerLiteralExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2598
			"IntegerLiteralExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2590
		initEAttribute(
2599
		initEAttribute(
2591
			getIntegerLiteralExpCS_IntegerSymbol(),
2600
			getIntegerLiteralExpCS_IntegerSymbol(),
2592
			ecorePackage.getEIntegerObject(),
2601
			theEcorePackage.getEBigInteger(),
2593
			"integerSymbol", null, 0, 1, IntegerLiteralExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
2602
			"integerSymbol", null, 0, 1, IntegerLiteralExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
2594
2603
2595
		initEClass(
2604
		initEClass(
Lines 2597-2605 Link Here
2597
			UnlimitedNaturalLiteralExpCS.class,
2606
			UnlimitedNaturalLiteralExpCS.class,
2598
			"UnlimitedNaturalLiteralExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2607
			"UnlimitedNaturalLiteralExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2599
		initEAttribute(
2608
		initEAttribute(
2600
			getUnlimitedNaturalLiteralExpCS_IntegerSymbol(),
2609
			getUnlimitedNaturalLiteralExpCS_UnlimitedNaturalSymbol(),
2601
			ecorePackage.getEIntegerObject(),
2610
			theEcorePackage.getEBigInteger(),
2602
			"integerSymbol", null, 0, 1, UnlimitedNaturalLiteralExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
2611
			"unlimitedNaturalSymbol", null, 0, 1, UnlimitedNaturalLiteralExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
2603
2612
2604
		initEClass(
2613
		initEClass(
2605
			realLiteralExpCSEClass,
2614
			realLiteralExpCSEClass,
Lines 2607-2613 Link Here
2607
			"RealLiteralExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2616
			"RealLiteralExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2608
		initEAttribute(
2617
		initEAttribute(
2609
			getRealLiteralExpCS_RealSymbol(),
2618
			getRealLiteralExpCS_RealSymbol(),
2610
			ecorePackage.getEDoubleObject(),
2619
			theEcorePackage.getEBigDecimal(),
2611
			"realSymbol", null, 0, 1, RealLiteralExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
2620
			"realSymbol", null, 0, 1, RealLiteralExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
2612
2621
2613
		initEClass(
2622
		initEClass(
Lines 2803-2809 Link Here
2803
	 * @generated
2812
	 * @generated
2804
	 */
2813
	 */
2805
	protected void createExtendedMetaDataAnnotations() {
2814
	protected void createExtendedMetaDataAnnotations() {
2806
		String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; //$NON-NLS-1$	    
2815
		String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; //$NON-NLS-1$		
2807
		addAnnotation(oclExpressionCSEClass, source, new String[]{
2816
		addAnnotation(oclExpressionCSEClass, source, new String[]{
2808
			"name", "OclExpressionCS" //$NON-NLS-1$ //$NON-NLS-2$
2817
			"name", "OclExpressionCS" //$NON-NLS-1$ //$NON-NLS-2$
2809
		});
2818
		});
(-)src/org/eclipse/ocl/cst/impl/IntegerLiteralExpCSImpl.java (-6 / +9 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.cst.impl;
18
package org.eclipse.ocl.cst.impl;
19
19
20
import java.math.BigInteger;
20
import org.eclipse.emf.common.notify.Notification;
21
import org.eclipse.emf.common.notify.Notification;
21
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.impl.ENotificationImpl;
23
import org.eclipse.emf.ecore.impl.ENotificationImpl;
Lines 48-54 Link Here
48
	 * @generated
49
	 * @generated
49
	 * @ordered
50
	 * @ordered
50
	 */
51
	 */
51
	protected static final Integer INTEGER_SYMBOL_EDEFAULT = null;
52
	protected static final BigInteger INTEGER_SYMBOL_EDEFAULT = null;
52
53
53
	/**
54
	/**
54
	 * The cached value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
55
	 * The cached value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
Lines 58-64 Link Here
58
	 * @generated
59
	 * @generated
59
	 * @ordered
60
	 * @ordered
60
	 */
61
	 */
61
	protected Integer integerSymbol = INTEGER_SYMBOL_EDEFAULT;
62
	protected BigInteger integerSymbol = INTEGER_SYMBOL_EDEFAULT;
62
63
63
	/**
64
	/**
64
	 * <!-- begin-user-doc -->
65
	 * <!-- begin-user-doc -->
Lines 81-100 Link Here
81
82
82
	/**
83
	/**
83
	 * <!-- begin-user-doc -->
84
	 * <!-- begin-user-doc -->
85
	 * @since 3.0
84
	 * <!-- end-user-doc -->
86
	 * <!-- end-user-doc -->
85
	 * @generated
87
	 * @generated
86
	 */
88
	 */
87
	public Integer getIntegerSymbol() {
89
	public BigInteger getIntegerSymbol() {
88
		return integerSymbol;
90
		return integerSymbol;
89
	}
91
	}
90
92
91
	/**
93
	/**
92
	 * <!-- begin-user-doc -->
94
	 * <!-- begin-user-doc -->
95
	 * @since 3.0
93
	 * <!-- end-user-doc -->
96
	 * <!-- end-user-doc -->
94
	 * @generated
97
	 * @generated
95
	 */
98
	 */
96
	public void setIntegerSymbol(Integer newIntegerSymbol) {
99
	public void setIntegerSymbol(BigInteger newIntegerSymbol) {
97
		Integer oldIntegerSymbol = integerSymbol;
100
		BigInteger oldIntegerSymbol = integerSymbol;
98
		integerSymbol = newIntegerSymbol;
101
		integerSymbol = newIntegerSymbol;
99
		if (eNotificationRequired())
102
		if (eNotificationRequired())
100
			eNotify(new ENotificationImpl(this, Notification.SET,
103
			eNotify(new ENotificationImpl(this, Notification.SET,
Lines 125-131 Link Here
125
	public void eSet(int featureID, Object newValue) {
128
	public void eSet(int featureID, Object newValue) {
126
		switch (featureID) {
129
		switch (featureID) {
127
			case CSTPackage.INTEGER_LITERAL_EXP_CS__INTEGER_SYMBOL :
130
			case CSTPackage.INTEGER_LITERAL_EXP_CS__INTEGER_SYMBOL :
128
				setIntegerSymbol((Integer) newValue);
131
				setIntegerSymbol((BigInteger) newValue);
129
				return;
132
				return;
130
		}
133
		}
131
		super.eSet(featureID, newValue);
134
		super.eSet(featureID, newValue);
(-)src/org/eclipse/ocl/cst/impl/RealLiteralExpCSImpl.java (-6 / +9 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.cst.impl;
18
package org.eclipse.ocl.cst.impl;
19
19
20
import java.math.BigDecimal;
20
import org.eclipse.emf.common.notify.Notification;
21
import org.eclipse.emf.common.notify.Notification;
21
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.impl.ENotificationImpl;
23
import org.eclipse.emf.ecore.impl.ENotificationImpl;
Lines 48-54 Link Here
48
	 * @generated
49
	 * @generated
49
	 * @ordered
50
	 * @ordered
50
	 */
51
	 */
51
	protected static final Double REAL_SYMBOL_EDEFAULT = null;
52
	protected static final BigDecimal REAL_SYMBOL_EDEFAULT = null;
52
53
53
	/**
54
	/**
54
	 * The cached value of the '{@link #getRealSymbol() <em>Real Symbol</em>}' attribute.
55
	 * The cached value of the '{@link #getRealSymbol() <em>Real Symbol</em>}' attribute.
Lines 58-64 Link Here
58
	 * @generated
59
	 * @generated
59
	 * @ordered
60
	 * @ordered
60
	 */
61
	 */
61
	protected Double realSymbol = REAL_SYMBOL_EDEFAULT;
62
	protected BigDecimal realSymbol = REAL_SYMBOL_EDEFAULT;
62
63
63
	/**
64
	/**
64
	 * <!-- begin-user-doc -->
65
	 * <!-- begin-user-doc -->
Lines 81-100 Link Here
81
82
82
	/**
83
	/**
83
	 * <!-- begin-user-doc -->
84
	 * <!-- begin-user-doc -->
85
	 * @since 3.0
84
	 * <!-- end-user-doc -->
86
	 * <!-- end-user-doc -->
85
	 * @generated
87
	 * @generated
86
	 */
88
	 */
87
	public Double getRealSymbol() {
89
	public BigDecimal getRealSymbol() {
88
		return realSymbol;
90
		return realSymbol;
89
	}
91
	}
90
92
91
	/**
93
	/**
92
	 * <!-- begin-user-doc -->
94
	 * <!-- begin-user-doc -->
95
	 * @since 3.0
93
	 * <!-- end-user-doc -->
96
	 * <!-- end-user-doc -->
94
	 * @generated
97
	 * @generated
95
	 */
98
	 */
96
	public void setRealSymbol(Double newRealSymbol) {
99
	public void setRealSymbol(BigDecimal newRealSymbol) {
97
		Double oldRealSymbol = realSymbol;
100
		BigDecimal oldRealSymbol = realSymbol;
98
		realSymbol = newRealSymbol;
101
		realSymbol = newRealSymbol;
99
		if (eNotificationRequired())
102
		if (eNotificationRequired())
100
			eNotify(new ENotificationImpl(this, Notification.SET,
103
			eNotify(new ENotificationImpl(this, Notification.SET,
Lines 125-131 Link Here
125
	public void eSet(int featureID, Object newValue) {
128
	public void eSet(int featureID, Object newValue) {
126
		switch (featureID) {
129
		switch (featureID) {
127
			case CSTPackage.REAL_LITERAL_EXP_CS__REAL_SYMBOL :
130
			case CSTPackage.REAL_LITERAL_EXP_CS__REAL_SYMBOL :
128
				setRealSymbol((Double) newValue);
131
				setRealSymbol((BigDecimal) newValue);
129
				return;
132
				return;
130
		}
133
		}
131
		super.eSet(featureID, newValue);
134
		super.eSet(featureID, newValue);
(-)src/org/eclipse/ocl/cst/impl/UnlimitedNaturalLiteralExpCSImpl.java (-27 / +35 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.cst.impl;
18
package org.eclipse.ocl.cst.impl;
19
19
20
import java.math.BigInteger;
20
import org.eclipse.emf.common.notify.Notification;
21
import org.eclipse.emf.common.notify.Notification;
21
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.impl.ENotificationImpl;
23
import org.eclipse.emf.ecore.impl.ENotificationImpl;
Lines 30-36 Link Here
30
 * <p>
31
 * <p>
31
 * The following features are implemented:
32
 * The following features are implemented:
32
 * <ul>
33
 * <ul>
33
 *   <li>{@link org.eclipse.ocl.cst.impl.UnlimitedNaturalLiteralExpCSImpl#getIntegerSymbol <em>Integer Symbol</em>}</li>
34
 *   <li>{@link org.eclipse.ocl.cst.impl.UnlimitedNaturalLiteralExpCSImpl#getUnlimitedNaturalSymbol <em>Unlimited Natural Symbol</em>}</li>
34
 * </ul>
35
 * </ul>
35
 * </p>
36
 * </p>
36
 *
37
 *
Lines 41-64 Link Here
41
		implements UnlimitedNaturalLiteralExpCS {
42
		implements UnlimitedNaturalLiteralExpCS {
42
43
43
	/**
44
	/**
44
	 * The default value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
45
	 * The default value of the '{@link #getUnlimitedNaturalSymbol() <em>Unlimited Natural Symbol</em>}' attribute.
45
	 * <!-- begin-user-doc -->
46
	 * <!-- begin-user-doc -->
47
	 * @since 3.0
46
	 * <!-- end-user-doc -->
48
	 * <!-- end-user-doc -->
47
	 * @see #getIntegerSymbol()
49
	 * @see #getUnlimitedNaturalSymbol()
48
	 * @generated
50
	 * @generated
49
	 * @ordered
51
	 * @ordered
50
	 */
52
	 */
51
	protected static final Integer INTEGER_SYMBOL_EDEFAULT = null;
53
	protected static final BigInteger UNLIMITED_NATURAL_SYMBOL_EDEFAULT = null;
52
54
53
	/**
55
	/**
54
	 * The cached value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
56
	 * The cached value of the '{@link #getUnlimitedNaturalSymbol() <em>Unlimited Natural Symbol</em>}' attribute.
55
	 * <!-- begin-user-doc -->
57
	 * <!-- begin-user-doc -->
58
	 * @since 3.0
56
	 * <!-- end-user-doc -->
59
	 * <!-- end-user-doc -->
57
	 * @see #getIntegerSymbol()
60
	 * @see #getUnlimitedNaturalSymbol()
58
	 * @generated
61
	 * @generated
59
	 * @ordered
62
	 * @ordered
60
	 */
63
	 */
61
	protected Integer integerSymbol = INTEGER_SYMBOL_EDEFAULT;
64
	protected BigInteger unlimitedNaturalSymbol = UNLIMITED_NATURAL_SYMBOL_EDEFAULT;
62
65
63
	/**
66
	/**
64
	 * <!-- begin-user-doc -->
67
	 * <!-- begin-user-doc -->
Lines 81-105 Link Here
81
84
82
	/**
85
	/**
83
	 * <!-- begin-user-doc -->
86
	 * <!-- begin-user-doc -->
87
	 * @since 3.0
84
	 * <!-- end-user-doc -->
88
	 * <!-- end-user-doc -->
85
	 * @generated
89
	 * @generated
86
	 */
90
	 */
87
	public Integer getIntegerSymbol() {
91
	public BigInteger getUnlimitedNaturalSymbol() {
88
		return integerSymbol;
92
		return unlimitedNaturalSymbol;
89
	}
93
	}
90
94
91
	/**
95
	/**
92
	 * <!-- begin-user-doc -->
96
	 * <!-- begin-user-doc -->
97
	 * @since 3.0
93
	 * <!-- end-user-doc -->
98
	 * <!-- end-user-doc -->
94
	 * @generated
99
	 * @generated
95
	 */
100
	 */
96
	public void setIntegerSymbol(Integer newIntegerSymbol) {
101
	public void setUnlimitedNaturalSymbol(BigInteger newUnlimitedNaturalSymbol) {
97
		Integer oldIntegerSymbol = integerSymbol;
102
		BigInteger oldUnlimitedNaturalSymbol = unlimitedNaturalSymbol;
98
		integerSymbol = newIntegerSymbol;
103
		unlimitedNaturalSymbol = newUnlimitedNaturalSymbol;
99
		if (eNotificationRequired())
104
		if (eNotificationRequired())
100
			eNotify(new ENotificationImpl(this, Notification.SET,
105
			eNotify(new ENotificationImpl(
101
				CSTPackage.UNLIMITED_NATURAL_LITERAL_EXP_CS__INTEGER_SYMBOL,
106
				this,
102
				oldIntegerSymbol, integerSymbol));
107
				Notification.SET,
108
				CSTPackage.UNLIMITED_NATURAL_LITERAL_EXP_CS__UNLIMITED_NATURAL_SYMBOL,
109
				oldUnlimitedNaturalSymbol, unlimitedNaturalSymbol));
103
	}
110
	}
104
111
105
	/**
112
	/**
Lines 110-117 Link Here
110
	@Override
117
	@Override
111
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
118
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
112
		switch (featureID) {
119
		switch (featureID) {
113
			case CSTPackage.UNLIMITED_NATURAL_LITERAL_EXP_CS__INTEGER_SYMBOL :
120
			case CSTPackage.UNLIMITED_NATURAL_LITERAL_EXP_CS__UNLIMITED_NATURAL_SYMBOL :
114
				return getIntegerSymbol();
121
				return getUnlimitedNaturalSymbol();
115
		}
122
		}
116
		return super.eGet(featureID, resolve, coreType);
123
		return super.eGet(featureID, resolve, coreType);
117
	}
124
	}
Lines 124-131 Link Here
124
	@Override
131
	@Override
125
	public void eSet(int featureID, Object newValue) {
132
	public void eSet(int featureID, Object newValue) {
126
		switch (featureID) {
133
		switch (featureID) {
127
			case CSTPackage.UNLIMITED_NATURAL_LITERAL_EXP_CS__INTEGER_SYMBOL :
134
			case CSTPackage.UNLIMITED_NATURAL_LITERAL_EXP_CS__UNLIMITED_NATURAL_SYMBOL :
128
				setIntegerSymbol((Integer) newValue);
135
				setUnlimitedNaturalSymbol((BigInteger) newValue);
129
				return;
136
				return;
130
		}
137
		}
131
		super.eSet(featureID, newValue);
138
		super.eSet(featureID, newValue);
Lines 139-146 Link Here
139
	@Override
146
	@Override
140
	public void eUnset(int featureID) {
147
	public void eUnset(int featureID) {
141
		switch (featureID) {
148
		switch (featureID) {
142
			case CSTPackage.UNLIMITED_NATURAL_LITERAL_EXP_CS__INTEGER_SYMBOL :
149
			case CSTPackage.UNLIMITED_NATURAL_LITERAL_EXP_CS__UNLIMITED_NATURAL_SYMBOL :
143
				setIntegerSymbol(INTEGER_SYMBOL_EDEFAULT);
150
				setUnlimitedNaturalSymbol(UNLIMITED_NATURAL_SYMBOL_EDEFAULT);
144
				return;
151
				return;
145
		}
152
		}
146
		super.eUnset(featureID);
153
		super.eUnset(featureID);
Lines 154-163 Link Here
154
	@Override
161
	@Override
155
	public boolean eIsSet(int featureID) {
162
	public boolean eIsSet(int featureID) {
156
		switch (featureID) {
163
		switch (featureID) {
157
			case CSTPackage.UNLIMITED_NATURAL_LITERAL_EXP_CS__INTEGER_SYMBOL :
164
			case CSTPackage.UNLIMITED_NATURAL_LITERAL_EXP_CS__UNLIMITED_NATURAL_SYMBOL :
158
				return INTEGER_SYMBOL_EDEFAULT == null
165
				return UNLIMITED_NATURAL_SYMBOL_EDEFAULT == null
159
					? integerSymbol != null
166
					? unlimitedNaturalSymbol != null
160
					: !INTEGER_SYMBOL_EDEFAULT.equals(integerSymbol);
167
					: !UNLIMITED_NATURAL_SYMBOL_EDEFAULT
168
						.equals(unlimitedNaturalSymbol);
161
		}
169
		}
162
		return super.eIsSet(featureID);
170
		return super.eIsSet(featureID);
163
	}
171
	}
Lines 173-180 Link Here
173
			return super.toString();
181
			return super.toString();
174
182
175
		StringBuffer result = new StringBuffer(super.toString());
183
		StringBuffer result = new StringBuffer(super.toString());
176
		result.append(" (integerSymbol: "); //$NON-NLS-1$
184
		result.append(" (unlimitedNaturalSymbol: "); //$NON-NLS-1$
177
		result.append(integerSymbol);
185
		result.append(unlimitedNaturalSymbol);
178
		result.append(')');
186
		result.append(')');
179
		return result.toString();
187
		return result.toString();
180
	}
188
	}
(-)src/org/eclipse/ocl/expressions/ExpressionsPackage.java (-11 / +12 lines)
Lines 1125-1139 Link Here
1125
	int UNLIMITED_NATURAL_LITERAL_EXP__END_POSITION = NUMERIC_LITERAL_EXP__END_POSITION;
1125
	int UNLIMITED_NATURAL_LITERAL_EXP__END_POSITION = NUMERIC_LITERAL_EXP__END_POSITION;
1126
1126
1127
	/**
1127
	/**
1128
	 * The feature id for the '<em><b>Integer Symbol</b></em>' attribute.
1128
	 * The feature id for the '<em><b>Unlimited Natural Symbol</b></em>' attribute.
1129
	 * <!-- begin-user-doc -->
1129
	 * <!-- begin-user-doc -->
1130
	 * This value may change when the model code is regenerated.
1130
	 * @since 3.0
1131
	 * It is subject to change without notice.
1132
	 * <!-- end-user-doc -->
1131
	 * <!-- end-user-doc -->
1133
	 * @generated
1132
	 * @generated
1134
	 * @ordered
1133
	 * @ordered
1135
	 */
1134
	 */
1136
	int UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL = NUMERIC_LITERAL_EXP_FEATURE_COUNT + 0;
1135
	int UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL = NUMERIC_LITERAL_EXP_FEATURE_COUNT + 0;
1137
1136
1138
	/**
1137
	/**
1139
	 * The feature id for the '<em><b>Unlimited</b></em>' attribute.
1138
	 * The feature id for the '<em><b>Unlimited</b></em>' attribute.
Lines 2859-2873 Link Here
2859
	EClass getUnlimitedNaturalLiteralExp();
2858
	EClass getUnlimitedNaturalLiteralExp();
2860
2859
2861
	/**
2860
	/**
2862
	 * Returns the meta object for the attribute '{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#getIntegerSymbol <em>Integer Symbol</em>}'.
2861
	 * Returns the meta object for the attribute '{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#getUnlimitedNaturalSymbol <em>Unlimited Natural Symbol</em>}'.
2863
	 * <!-- begin-user-doc -->
2862
	 * <!-- begin-user-doc -->
2863
	 * @since 3.0
2864
	 * <!-- end-user-doc -->
2864
	 * <!-- end-user-doc -->
2865
	 * @return the meta object for the attribute '<em>Integer Symbol</em>'.
2865
	 * @return the meta object for the attribute '<em>Unlimited Natural Symbol</em>'.
2866
	 * @see org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#getIntegerSymbol()
2866
	 * @see org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#getUnlimitedNaturalSymbol()
2867
	 * @see #getUnlimitedNaturalLiteralExp()
2867
	 * @see #getUnlimitedNaturalLiteralExp()
2868
	 * @generated
2868
	 * @generated
2869
	 */
2869
	 */
2870
	EAttribute getUnlimitedNaturalLiteralExp_IntegerSymbol();
2870
	EAttribute getUnlimitedNaturalLiteralExp_UnlimitedNaturalSymbol();
2871
2871
2872
	/**
2872
	/**
2873
	 * Returns the meta object for the attribute '{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#isUnlimited <em>Unlimited</em>}'.
2873
	 * Returns the meta object for the attribute '{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#isUnlimited <em>Unlimited</em>}'.
Lines 3674-3686 Link Here
3674
			.getUnlimitedNaturalLiteralExp();
3674
			.getUnlimitedNaturalLiteralExp();
3675
3675
3676
		/**
3676
		/**
3677
		 * The meta object literal for the '<em><b>Integer Symbol</b></em>' attribute feature.
3677
		 * The meta object literal for the '<em><b>Unlimited Natural Symbol</b></em>' attribute feature.
3678
		 * <!-- begin-user-doc -->
3678
		 * <!-- begin-user-doc -->
3679
		 * @since 3.0
3679
		 * <!-- end-user-doc -->
3680
		 * <!-- end-user-doc -->
3680
		 * @generated
3681
		 * @generated
3681
		 */
3682
		 */
3682
		EAttribute UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL = eINSTANCE
3683
		EAttribute UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL = eINSTANCE
3683
			.getUnlimitedNaturalLiteralExp_IntegerSymbol();
3684
			.getUnlimitedNaturalLiteralExp_UnlimitedNaturalSymbol();
3684
3685
3685
		/**
3686
		/**
3686
		 * The meta object literal for the '<em><b>Unlimited</b></em>' attribute feature.
3687
		 * The meta object literal for the '<em><b>Unlimited</b></em>' attribute feature.
(-)src/org/eclipse/ocl/expressions/IntegerLiteralExp.java (-3 / +14 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.math.BigInteger;
20
import java.util.Map;
21
import java.util.Map;
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
Lines 46-69 Link Here
46
	 * If the meaning of the '<em>Integer Symbol</em>' attribute isn't clear,
47
	 * If the meaning of the '<em>Integer Symbol</em>' attribute isn't clear,
47
	 * there really should be more of a description here...
48
	 * there really should be more of a description here...
48
	 * </p>
49
	 * </p>
50
	 * @since 3.0
49
	 * <!-- end-user-doc -->
51
	 * <!-- end-user-doc -->
50
	 * @return the value of the '<em>Integer Symbol</em>' attribute.
52
	 * @return the value of the '<em>Integer Symbol</em>' attribute.
51
	 * @see #setIntegerSymbol(Integer)
53
	 * @see #setIntegerSymbol(BigInteger)
52
	 * @see org.eclipse.ocl.expressions.ExpressionsPackage#getIntegerLiteralExp_IntegerSymbol()
54
	 * @see org.eclipse.ocl.expressions.ExpressionsPackage#getIntegerLiteralExp_IntegerSymbol()
53
	 * @model
55
	 * @model
54
	 * @generated
56
	 * @generated
55
	 */
57
	 */
56
	Integer getIntegerSymbol();
58
	BigInteger getIntegerSymbol();
57
59
58
	/**
60
	/**
59
	 * Sets the value of the '{@link org.eclipse.ocl.expressions.IntegerLiteralExp#getIntegerSymbol <em>Integer Symbol</em>}' attribute.
61
	 * Sets the value of the '{@link org.eclipse.ocl.expressions.IntegerLiteralExp#getIntegerSymbol <em>Integer Symbol</em>}' attribute.
60
	 * <!-- begin-user-doc -->
62
	 * <!-- begin-user-doc -->
63
	 * @since 3.0
61
	 * <!-- end-user-doc -->
64
	 * <!-- end-user-doc -->
62
	 * @param value the new value of the '<em>Integer Symbol</em>' attribute.
65
	 * @param value the new value of the '<em>Integer Symbol</em>' attribute.
63
	 * @see #getIntegerSymbol()
66
	 * @see #getIntegerSymbol()
64
	 * @generated
67
	 * @generated
65
	 */
68
	 */
66
	void setIntegerSymbol(Integer value);
69
	void setIntegerSymbol(BigInteger value);
67
70
68
	/**
71
	/**
69
	 * <!-- begin-user-doc -->
72
	 * <!-- begin-user-doc -->
Lines 79-82 Link Here
79
	boolean checkIntegerType(DiagnosticChain diagnostics,
82
	boolean checkIntegerType(DiagnosticChain diagnostics,
80
			Map<Object, Object> context);
83
			Map<Object, Object> context);
81
84
85
	/**
86
	 * <!-- begin-user-doc -->
87
	 * <!-- end-user-doc -->
88
	 * @model valueRequired="true" valueOrdered="false"
89
	 * @generated
90
	 */
91
	void setIntegerSymbol(Integer value);
92
82
} // IntegerLiteralExp
93
} // IntegerLiteralExp
(-)src/org/eclipse/ocl/expressions/RealLiteralExp.java (-3 / +14 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.math.BigDecimal;
20
import java.util.Map;
21
import java.util.Map;
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
Lines 46-69 Link Here
46
	 * If the meaning of the '<em>Real Symbol</em>' attribute isn't clear,
47
	 * If the meaning of the '<em>Real Symbol</em>' attribute isn't clear,
47
	 * there really should be more of a description here...
48
	 * there really should be more of a description here...
48
	 * </p>
49
	 * </p>
50
	 * @since 3.0
49
	 * <!-- end-user-doc -->
51
	 * <!-- end-user-doc -->
50
	 * @return the value of the '<em>Real Symbol</em>' attribute.
52
	 * @return the value of the '<em>Real Symbol</em>' attribute.
51
	 * @see #setRealSymbol(Double)
53
	 * @see #setRealSymbol(BigDecimal)
52
	 * @see org.eclipse.ocl.expressions.ExpressionsPackage#getRealLiteralExp_RealSymbol()
54
	 * @see org.eclipse.ocl.expressions.ExpressionsPackage#getRealLiteralExp_RealSymbol()
53
	 * @model
55
	 * @model
54
	 * @generated
56
	 * @generated
55
	 */
57
	 */
56
	Double getRealSymbol();
58
	BigDecimal getRealSymbol();
57
59
58
	/**
60
	/**
59
	 * Sets the value of the '{@link org.eclipse.ocl.expressions.RealLiteralExp#getRealSymbol <em>Real Symbol</em>}' attribute.
61
	 * Sets the value of the '{@link org.eclipse.ocl.expressions.RealLiteralExp#getRealSymbol <em>Real Symbol</em>}' attribute.
60
	 * <!-- begin-user-doc -->
62
	 * <!-- begin-user-doc -->
63
	 * @since 3.0
61
	 * <!-- end-user-doc -->
64
	 * <!-- end-user-doc -->
62
	 * @param value the new value of the '<em>Real Symbol</em>' attribute.
65
	 * @param value the new value of the '<em>Real Symbol</em>' attribute.
63
	 * @see #getRealSymbol()
66
	 * @see #getRealSymbol()
64
	 * @generated
67
	 * @generated
65
	 */
68
	 */
66
	void setRealSymbol(Double value);
69
	void setRealSymbol(BigDecimal value);
67
70
68
	/**
71
	/**
69
	 * <!-- begin-user-doc -->
72
	 * <!-- begin-user-doc -->
Lines 79-82 Link Here
79
	boolean checkRealType(DiagnosticChain diagnostics,
82
	boolean checkRealType(DiagnosticChain diagnostics,
80
			Map<Object, Object> context);
83
			Map<Object, Object> context);
81
84
85
	/**
86
	 * <!-- begin-user-doc -->
87
	 * <!-- end-user-doc -->
88
	 * @model valueRequired="true" valueOrdered="false"
89
	 * @generated
90
	 */
91
	void setRealSymbol(Double value);
92
82
} // RealLiteralExp
93
} // RealLiteralExp
(-)src/org/eclipse/ocl/expressions/UnlimitedNaturalLiteralExp.java (-15 / +36 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.math.BigInteger;
20
import java.util.Map;
21
import java.util.Map;
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
Lines 28-34 Link Here
28
 * <p>
29
 * <p>
29
 * The following features are supported:
30
 * The following features are supported:
30
 * <ul>
31
 * <ul>
31
 *   <li>{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#getIntegerSymbol <em>Integer Symbol</em>}</li>
32
 *   <li>{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#getUnlimitedNaturalSymbol <em>Unlimited Natural Symbol</em>}</li>
32
 *   <li>{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#isUnlimited <em>Unlimited</em>}</li>
33
 *   <li>{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#isUnlimited <em>Unlimited</em>}</li>
33
 * </ul>
34
 * </ul>
34
 * </p>
35
 * </p>
Lines 40-73 Link Here
40
public interface UnlimitedNaturalLiteralExp<C>
41
public interface UnlimitedNaturalLiteralExp<C>
41
		extends NumericLiteralExp<C> {
42
		extends NumericLiteralExp<C> {
42
43
43
	/** Java value denoting the OCL unlimited value. */
44
	int UNLIMITED = -1;
45
46
	/**
44
	/**
47
	 * Returns the value of the '<em><b>Integer Symbol</b></em>' attribute.
45
	 * Returns the value of the '<em><b>Unlimited Natural Symbol</b></em>' attribute.
48
	 * <!-- begin-user-doc -->
46
	 * <!-- begin-user-doc -->
49
	 * <p>
47
	 * <p>
50
	 * If the meaning of the '<em>Integer Symbol</em>' attribute isn't clear,
48
	 * If the meaning of the '<em>Unlimited Natural Symbol</em>' attribute isn't clear,
51
	 * there really should be more of a description here...
49
	 * there really should be more of a description here...
52
	 * </p>
50
	 * </p>
51
	 * @since 3.0
53
	 * <!-- end-user-doc -->
52
	 * <!-- end-user-doc -->
54
	 * @return the value of the '<em>Integer Symbol</em>' attribute.
53
	 * @return the value of the '<em>Unlimited Natural Symbol</em>' attribute.
55
	 * @see #setIntegerSymbol(Integer)
54
	 * @see #setUnlimitedNaturalSymbol(BigInteger)
56
	 * @see org.eclipse.ocl.expressions.ExpressionsPackage#getUnlimitedNaturalLiteralExp_IntegerSymbol()
55
	 * @see org.eclipse.ocl.expressions.ExpressionsPackage#getUnlimitedNaturalLiteralExp_UnlimitedNaturalSymbol()
57
	 * @model
56
	 * @model extendedMetaData="name=''"
58
	 * @generated
57
	 * @generated
59
	 */
58
	 */
60
	Integer getIntegerSymbol();
59
	BigInteger getUnlimitedNaturalSymbol();
61
60
62
	/**
61
	/**
63
	 * Sets the value of the '{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#getIntegerSymbol <em>Integer Symbol</em>}' attribute.
62
	 * Sets the value of the '{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#getUnlimitedNaturalSymbol <em>Unlimited Natural Symbol</em>}' attribute.
64
	 * <!-- begin-user-doc -->
63
	 * <!-- begin-user-doc -->
64
	 * @since 3.0
65
	 * <!-- end-user-doc -->
65
	 * <!-- end-user-doc -->
66
	 * @param value the new value of the '<em>Integer Symbol</em>' attribute.
66
	 * @param value the new value of the '<em>Unlimited Natural Symbol</em>' attribute.
67
	 * @see #getIntegerSymbol()
67
	 * @see #getUnlimitedNaturalSymbol()
68
	 * @generated
68
	 * @generated
69
	 */
69
	 */
70
	void setIntegerSymbol(Integer value);
70
	void setUnlimitedNaturalSymbol(BigInteger value);
71
72
	/** Java value denoting the OCL unlimited value. */
73
	BigInteger UNLIMITED = BigInteger.valueOf(-1);
71
74
72
	/**
75
	/**
73
	 * Returns the value of the '<em><b>Unlimited</b></em>' attribute.
76
	 * Returns the value of the '<em><b>Unlimited</b></em>' attribute.
Lines 98-101 Link Here
98
	boolean checkNaturalType(DiagnosticChain diagnostics,
101
	boolean checkNaturalType(DiagnosticChain diagnostics,
99
			Map<Object, Object> context);
102
			Map<Object, Object> context);
100
103
104
	/**
105
	 * <!-- begin-user-doc -->
106
	 * @deprecated use setUnlimitedNaturalSymbol
107
	 * <!-- end-user-doc -->
108
	 * @model valueRequired="true" valueOrdered="false"
109
	 * @generated
110
	 */
111
	void setIntegerSymbol(Integer value);
112
113
	/**
114
	 * <!-- begin-user-doc -->
115
	 * @since 3.0
116
	 * <!-- end-user-doc -->
117
	 * @model valueRequired="true" valueOrdered="false"
118
	 * @generated
119
	 */
120
	void setUnlimitedNaturalSymbol(Integer value);
121
101
} // UnlimitedNaturalLiteralExp
122
} // UnlimitedNaturalLiteralExp
(-)src/org/eclipse/ocl/expressions/impl/ExpressionsPackageImpl.java (-8 / +37 lines)
Lines 13-19 Link Here
13
 * 
13
 * 
14
 * </copyright>
14
 * </copyright>
15
 *
15
 *
16
 * $Id: ExpressionsPackageImpl.java,v 1.12 2010/01/14 12:44:33 ewillink Exp $
16
 * $Id: ExpressionsPackageImpl.java,v 1.11 2009/05/26 20:06:35 aigdalov Exp $
17
 */
17
 */
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
Lines 26-31 Link Here
26
import org.eclipse.emf.ecore.EReference;
26
import org.eclipse.emf.ecore.EReference;
27
import org.eclipse.emf.ecore.ETypeParameter;
27
import org.eclipse.emf.ecore.ETypeParameter;
28
import org.eclipse.emf.ecore.EValidator;
28
import org.eclipse.emf.ecore.EValidator;
29
import org.eclipse.emf.ecore.EcorePackage;
29
import org.eclipse.emf.ecore.impl.EPackageImpl;
30
import org.eclipse.emf.ecore.impl.EPackageImpl;
30
import org.eclipse.emf.ecore.resource.Resource;
31
import org.eclipse.emf.ecore.resource.Resource;
31
import org.eclipse.ocl.Environment;
32
import org.eclipse.ocl.Environment;
Lines 413-418 Link Here
413
414
414
		isInited = true;
415
		isInited = true;
415
416
417
		// Initialize simple dependencies
418
		EcorePackage.eINSTANCE.eClass();
419
416
		// Obtain or create and register interdependencies
420
		// Obtain or create and register interdependencies
417
		TypesPackageImpl theTypesPackage = (TypesPackageImpl) (EPackage.Registry.INSTANCE
421
		TypesPackageImpl theTypesPackage = (TypesPackageImpl) (EPackage.Registry.INSTANCE
418
			.getEPackage(TypesPackage.eNS_URI) instanceof TypesPackageImpl
422
			.getEPackage(TypesPackage.eNS_URI) instanceof TypesPackageImpl
Lines 710-716 Link Here
710
	 * <!-- end-user-doc -->
714
	 * <!-- end-user-doc -->
711
	 * @generated
715
	 * @generated
712
	 */
716
	 */
713
	public EAttribute getUnlimitedNaturalLiteralExp_IntegerSymbol() {
717
	public EAttribute getUnlimitedNaturalLiteralExp_UnlimitedNaturalSymbol() {
714
		return (EAttribute) unlimitedNaturalLiteralExpEClass
718
		return (EAttribute) unlimitedNaturalLiteralExpEClass
715
			.getEStructuralFeatures().get(0);
719
			.getEStructuralFeatures().get(0);
716
	}
720
	}
Lines 1266-1272 Link Here
1266
1270
1267
		unlimitedNaturalLiteralExpEClass = createEClass(UNLIMITED_NATURAL_LITERAL_EXP);
1271
		unlimitedNaturalLiteralExpEClass = createEClass(UNLIMITED_NATURAL_LITERAL_EXP);
1268
		createEAttribute(unlimitedNaturalLiteralExpEClass,
1272
		createEAttribute(unlimitedNaturalLiteralExpEClass,
1269
			UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL);
1273
			UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL);
1270
		createEAttribute(unlimitedNaturalLiteralExpEClass,
1274
		createEAttribute(unlimitedNaturalLiteralExpEClass,
1271
			UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED);
1275
			UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED);
1272
1276
Lines 1383-1388 Link Here
1383
		// Obtain other dependent packages
1387
		// Obtain other dependent packages
1384
		UtilitiesPackage theUtilitiesPackage = (UtilitiesPackage) EPackage.Registry.INSTANCE
1388
		UtilitiesPackage theUtilitiesPackage = (UtilitiesPackage) EPackage.Registry.INSTANCE
1385
			.getEPackage(UtilitiesPackage.eNS_URI);
1389
			.getEPackage(UtilitiesPackage.eNS_URI);
1390
		EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE
1391
			.getEPackage(EcorePackage.eNS_URI);
1386
1392
1387
		// Create type parameters
1393
		// Create type parameters
1388
		ETypeParameter associationClassCallExpEClass_C = addETypeParameter(
1394
		ETypeParameter associationClassCallExpEClass_C = addETypeParameter(
Lines 1951-1957 Link Here
1951
			"IntegerLiteralExp", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
1957
			"IntegerLiteralExp", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
1952
		initEAttribute(
1958
		initEAttribute(
1953
			getIntegerLiteralExp_IntegerSymbol(),
1959
			getIntegerLiteralExp_IntegerSymbol(),
1954
			ecorePackage.getEIntegerObject(),
1960
			theEcorePackage.getEBigInteger(),
1955
			"integerSymbol", null, 0, 1, IntegerLiteralExp.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
1961
			"integerSymbol", null, 0, 1, IntegerLiteralExp.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
1956
1962
1957
		op = addEOperation(integerLiteralExpEClass, ecorePackage.getEBoolean(),
1963
		op = addEOperation(integerLiteralExpEClass, ecorePackage.getEBoolean(),
Lines 1965-1970 Link Here
1965
		g1.getETypeArguments().add(g2);
1971
		g1.getETypeArguments().add(g2);
1966
		addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
1972
		addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
1967
1973
1974
		op = addEOperation(integerLiteralExpEClass, null,
1975
			"setIntegerSymbol", 1, 1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$
1976
		addEParameter(op, theEcorePackage.getEIntegerObject(),
1977
			"value", 1, 1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$
1978
1968
		initEClass(
1979
		initEClass(
1969
			numericLiteralExpEClass,
1980
			numericLiteralExpEClass,
1970
			NumericLiteralExp.class,
1981
			NumericLiteralExp.class,
Lines 1975-1983 Link Here
1975
			UnlimitedNaturalLiteralExp.class,
1986
			UnlimitedNaturalLiteralExp.class,
1976
			"UnlimitedNaturalLiteralExp", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
1987
			"UnlimitedNaturalLiteralExp", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
1977
		initEAttribute(
1988
		initEAttribute(
1978
			getUnlimitedNaturalLiteralExp_IntegerSymbol(),
1989
			getUnlimitedNaturalLiteralExp_UnlimitedNaturalSymbol(),
1979
			ecorePackage.getEIntegerObject(),
1990
			theEcorePackage.getEBigInteger(),
1980
			"integerSymbol", null, 0, 1, UnlimitedNaturalLiteralExp.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
1991
			"unlimitedNaturalSymbol", null, 0, 1, UnlimitedNaturalLiteralExp.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
1981
		initEAttribute(
1992
		initEAttribute(
1982
			getUnlimitedNaturalLiteralExp_Unlimited(),
1993
			getUnlimitedNaturalLiteralExp_Unlimited(),
1983
			ecorePackage.getEBoolean(),
1994
			ecorePackage.getEBoolean(),
Lines 1994-1999 Link Here
1994
		g1.getETypeArguments().add(g2);
2005
		g1.getETypeArguments().add(g2);
1995
		addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
2006
		addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
1996
2007
2008
		op = addEOperation(unlimitedNaturalLiteralExpEClass, null,
2009
			"setIntegerSymbol", 1, 1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$
2010
		addEParameter(op, theEcorePackage.getEIntegerObject(),
2011
			"value", 1, 1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$
2012
2013
		op = addEOperation(unlimitedNaturalLiteralExpEClass, null,
2014
			"setUnlimitedNaturalSymbol", 1, 1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$
2015
		addEParameter(op, theEcorePackage.getEIntegerObject(),
2016
			"value", 1, 1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$
2017
1997
		initEClass(
2018
		initEClass(
1998
			invalidLiteralExpEClass,
2019
			invalidLiteralExpEClass,
1999
			InvalidLiteralExp.class,
2020
			InvalidLiteralExp.class,
Lines 2378-2384 Link Here
2378
			"RealLiteralExp", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2399
			"RealLiteralExp", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2379
		initEAttribute(
2400
		initEAttribute(
2380
			getRealLiteralExp_RealSymbol(),
2401
			getRealLiteralExp_RealSymbol(),
2381
			ecorePackage.getEDoubleObject(),
2402
			theEcorePackage.getEBigDecimal(),
2382
			"realSymbol", null, 0, 1, RealLiteralExp.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
2403
			"realSymbol", null, 0, 1, RealLiteralExp.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
2383
2404
2384
		op = addEOperation(realLiteralExpEClass, ecorePackage.getEBoolean(),
2405
		op = addEOperation(realLiteralExpEClass, ecorePackage.getEBoolean(),
Lines 2392-2397 Link Here
2392
		g1.getETypeArguments().add(g2);
2413
		g1.getETypeArguments().add(g2);
2393
		addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
2414
		addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
2394
2415
2416
		op = addEOperation(realLiteralExpEClass, null,
2417
			"setRealSymbol", 1, 1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$
2418
		addEParameter(op, theEcorePackage.getEDoubleObject(),
2419
			"value", 1, 1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$
2420
2395
		initEClass(
2421
		initEClass(
2396
			stateExpEClass,
2422
			stateExpEClass,
2397
			StateExp.class,
2423
			StateExp.class,
Lines 2557-2562 Link Here
2557
		addAnnotation(oclExpressionEClass, source, new String[]{
2583
		addAnnotation(oclExpressionEClass, source, new String[]{
2558
			"name", "OclExpression" //$NON-NLS-1$ //$NON-NLS-2$
2584
			"name", "OclExpression" //$NON-NLS-1$ //$NON-NLS-2$
2559
		});
2585
		});
2586
		addAnnotation(getUnlimitedNaturalLiteralExp_UnlimitedNaturalSymbol(),
2587
			source, new String[]{"name", "" //$NON-NLS-1$ //$NON-NLS-2$
2588
			});
2560
	}
2589
	}
2561
2590
2562
} //ExpressionsPackageImpl
2591
} //ExpressionsPackageImpl
(-)src/org/eclipse/ocl/expressions/impl/IntegerLiteralExpImpl.java (-6 / +18 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.math.BigInteger;
20
import java.util.Map;
21
import java.util.Map;
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
Lines 52-58 Link Here
52
	 * @generated
53
	 * @generated
53
	 * @ordered
54
	 * @ordered
54
	 */
55
	 */
55
	protected static final Integer INTEGER_SYMBOL_EDEFAULT = null;
56
	protected static final BigInteger INTEGER_SYMBOL_EDEFAULT = null;
56
57
57
	/**
58
	/**
58
	 * The cached value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
59
	 * The cached value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
Lines 62-68 Link Here
62
	 * @generated
63
	 * @generated
63
	 * @ordered
64
	 * @ordered
64
	 */
65
	 */
65
	protected Integer integerSymbol = INTEGER_SYMBOL_EDEFAULT;
66
	protected BigInteger integerSymbol = INTEGER_SYMBOL_EDEFAULT;
66
67
67
	/**
68
	/**
68
	 * <!-- begin-user-doc -->
69
	 * <!-- begin-user-doc -->
Lines 85-104 Link Here
85
86
86
	/**
87
	/**
87
	 * <!-- begin-user-doc -->
88
	 * <!-- begin-user-doc -->
89
	 * @since 3.0
88
	 * <!-- end-user-doc -->
90
	 * <!-- end-user-doc -->
89
	 * @generated
91
	 * @generated
90
	 */
92
	 */
91
	public Integer getIntegerSymbol() {
93
	public BigInteger getIntegerSymbol() {
92
		return integerSymbol;
94
		return integerSymbol;
93
	}
95
	}
94
96
95
	/**
97
	/**
96
	 * <!-- begin-user-doc -->
98
	 * <!-- begin-user-doc -->
99
	 * @since 3.0
97
	 * <!-- end-user-doc -->
100
	 * <!-- end-user-doc -->
98
	 * @generated
101
	 * @generated
99
	 */
102
	 */
100
	public void setIntegerSymbol(Integer newIntegerSymbol) {
103
	public void setIntegerSymbol(BigInteger newIntegerSymbol) {
101
		Integer oldIntegerSymbol = integerSymbol;
104
		BigInteger oldIntegerSymbol = integerSymbol;
102
		integerSymbol = newIntegerSymbol;
105
		integerSymbol = newIntegerSymbol;
103
		if (eNotificationRequired())
106
		if (eNotificationRequired())
104
			eNotify(new ENotificationImpl(this, Notification.SET,
107
			eNotify(new ENotificationImpl(this, Notification.SET,
Lines 109-114 Link Here
109
	/**
112
	/**
110
	 * <!-- begin-user-doc -->
113
	 * <!-- begin-user-doc -->
111
	 * <!-- end-user-doc -->
114
	 * <!-- end-user-doc -->
115
	 * @generated NOT
116
	 */
117
	public void setIntegerSymbol(Integer value) {
118
		setIntegerSymbol(BigInteger.valueOf(value));
119
	}
120
121
	/**
122
	 * <!-- begin-user-doc -->
123
	 * <!-- end-user-doc -->
112
	 * @generated
124
	 * @generated
113
	 */
125
	 */
114
	public boolean checkIntegerType(DiagnosticChain diagnostics,
126
	public boolean checkIntegerType(DiagnosticChain diagnostics,
Lines 140-146 Link Here
140
	public void eSet(int featureID, Object newValue) {
152
	public void eSet(int featureID, Object newValue) {
141
		switch (featureID) {
153
		switch (featureID) {
142
			case ExpressionsPackage.INTEGER_LITERAL_EXP__INTEGER_SYMBOL :
154
			case ExpressionsPackage.INTEGER_LITERAL_EXP__INTEGER_SYMBOL :
143
				setIntegerSymbol((Integer) newValue);
155
				setIntegerSymbol((BigInteger) newValue);
144
				return;
156
				return;
145
		}
157
		}
146
		super.eSet(featureID, newValue);
158
		super.eSet(featureID, newValue);
(-)src/org/eclipse/ocl/expressions/impl/RealLiteralExpImpl.java (-6 / +19 lines)
Lines 17-23 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.math.BigDecimal;
20
import java.util.Map;
21
import java.util.Map;
22
21
import org.eclipse.emf.common.notify.Notification;
23
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.ecore.EClass;
25
import org.eclipse.emf.ecore.EClass;
Lines 52-58 Link Here
52
	 * @generated
54
	 * @generated
53
	 * @ordered
55
	 * @ordered
54
	 */
56
	 */
55
	protected static final Double REAL_SYMBOL_EDEFAULT = null;
57
	protected static final BigDecimal REAL_SYMBOL_EDEFAULT = null;
56
58
57
	/**
59
	/**
58
	 * The cached value of the '{@link #getRealSymbol() <em>Real Symbol</em>}' attribute.
60
	 * The cached value of the '{@link #getRealSymbol() <em>Real Symbol</em>}' attribute.
Lines 62-68 Link Here
62
	 * @generated
64
	 * @generated
63
	 * @ordered
65
	 * @ordered
64
	 */
66
	 */
65
	protected Double realSymbol = REAL_SYMBOL_EDEFAULT;
67
	protected BigDecimal realSymbol = REAL_SYMBOL_EDEFAULT;
66
68
67
	/**
69
	/**
68
	 * <!-- begin-user-doc -->
70
	 * <!-- begin-user-doc -->
Lines 85-104 Link Here
85
87
86
	/**
88
	/**
87
	 * <!-- begin-user-doc -->
89
	 * <!-- begin-user-doc -->
90
	 * @since 3.0
88
	 * <!-- end-user-doc -->
91
	 * <!-- end-user-doc -->
89
	 * @generated
92
	 * @generated
90
	 */
93
	 */
91
	public Double getRealSymbol() {
94
	public BigDecimal getRealSymbol() {
92
		return realSymbol;
95
		return realSymbol;
93
	}
96
	}
94
97
95
	/**
98
	/**
96
	 * <!-- begin-user-doc -->
99
	 * <!-- begin-user-doc -->
100
	 * @since 3.0
97
	 * <!-- end-user-doc -->
101
	 * <!-- end-user-doc -->
98
	 * @generated
102
	 * @generated
99
	 */
103
	 */
100
	public void setRealSymbol(Double newRealSymbol) {
104
	public void setRealSymbol(BigDecimal newRealSymbol) {
101
		Double oldRealSymbol = realSymbol;
105
		BigDecimal oldRealSymbol = realSymbol;
102
		realSymbol = newRealSymbol;
106
		realSymbol = newRealSymbol;
103
		if (eNotificationRequired())
107
		if (eNotificationRequired())
104
			eNotify(new ENotificationImpl(this, Notification.SET,
108
			eNotify(new ENotificationImpl(this, Notification.SET,
Lines 120-125 Link Here
120
	/**
124
	/**
121
	 * <!-- begin-user-doc -->
125
	 * <!-- begin-user-doc -->
122
	 * <!-- end-user-doc -->
126
	 * <!-- end-user-doc -->
127
	 * @generated NOT
128
	 */
129
	public void setRealSymbol(Double value) {
130
		setRealSymbol(new BigDecimal(value));
131
	}
132
133
	/**
134
	 * <!-- begin-user-doc -->
135
	 * <!-- end-user-doc -->
123
	 * @generated
136
	 * @generated
124
	 */
137
	 */
125
	@Override
138
	@Override
Lines 140-146 Link Here
140
	public void eSet(int featureID, Object newValue) {
153
	public void eSet(int featureID, Object newValue) {
141
		switch (featureID) {
154
		switch (featureID) {
142
			case ExpressionsPackage.REAL_LITERAL_EXP__REAL_SYMBOL :
155
			case ExpressionsPackage.REAL_LITERAL_EXP__REAL_SYMBOL :
143
				setRealSymbol((Double) newValue);
156
				setRealSymbol((BigDecimal) newValue);
144
				return;
157
				return;
145
		}
158
		}
146
		super.eSet(featureID, newValue);
159
		super.eSet(featureID, newValue);
(-)src/org/eclipse/ocl/expressions/impl/UnlimitedNaturalLiteralExpImpl.java (-25 / +52 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.math.BigInteger;
20
import java.util.Map;
21
import java.util.Map;
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
23
Lines 37-43 Link Here
37
 * <p>
38
 * <p>
38
 * The following features are implemented:
39
 * The following features are implemented:
39
 * <ul>
40
 * <ul>
40
 *   <li>{@link org.eclipse.ocl.expressions.impl.UnlimitedNaturalLiteralExpImpl#getIntegerSymbol <em>Integer Symbol</em>}</li>
41
 *   <li>{@link org.eclipse.ocl.expressions.impl.UnlimitedNaturalLiteralExpImpl#getUnlimitedNaturalSymbol <em>Unlimited Natural Symbol</em>}</li>
41
 *   <li>{@link org.eclipse.ocl.expressions.impl.UnlimitedNaturalLiteralExpImpl#isUnlimited <em>Unlimited</em>}</li>
42
 *   <li>{@link org.eclipse.ocl.expressions.impl.UnlimitedNaturalLiteralExpImpl#isUnlimited <em>Unlimited</em>}</li>
42
 * </ul>
43
 * </ul>
43
 * </p>
44
 * </p>
Lines 49-72 Link Here
49
		implements UnlimitedNaturalLiteralExp<C> {
50
		implements UnlimitedNaturalLiteralExp<C> {
50
51
51
	/**
52
	/**
52
	 * The default value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
53
	 * The default value of the '{@link #getUnlimitedNaturalSymbol() <em>Unlimited Natural Symbol</em>}' attribute.
53
	 * <!-- begin-user-doc -->
54
	 * <!-- begin-user-doc -->
55
	 * @since 3.0
54
	 * <!-- end-user-doc -->
56
	 * <!-- end-user-doc -->
55
	 * @see #getIntegerSymbol()
57
	 * @see #getUnlimitedNaturalSymbol()
56
	 * @generated
58
	 * @generated
57
	 * @ordered
59
	 * @ordered
58
	 */
60
	 */
59
	protected static final Integer INTEGER_SYMBOL_EDEFAULT = null;
61
	protected static final BigInteger UNLIMITED_NATURAL_SYMBOL_EDEFAULT = null;
60
62
61
	/**
63
	/**
62
	 * The cached value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
64
	 * The cached value of the '{@link #getUnlimitedNaturalSymbol() <em>Unlimited Natural Symbol</em>}' attribute.
63
	 * <!-- begin-user-doc -->
65
	 * <!-- begin-user-doc -->
66
	 * @since 3.0
64
	 * <!-- end-user-doc -->
67
	 * <!-- end-user-doc -->
65
	 * @see #getIntegerSymbol()
68
	 * @see #getUnlimitedNaturalSymbol()
66
	 * @generated
69
	 * @generated
67
	 * @ordered
70
	 * @ordered
68
	 */
71
	 */
69
	protected Integer integerSymbol = INTEGER_SYMBOL_EDEFAULT;
72
	protected BigInteger unlimitedNaturalSymbol = UNLIMITED_NATURAL_SYMBOL_EDEFAULT;
70
73
71
	/**
74
	/**
72
	 * The default value of the '{@link #isUnlimited() <em>Unlimited</em>}' attribute.
75
	 * The default value of the '{@link #isUnlimited() <em>Unlimited</em>}' attribute.
Lines 99-125 Link Here
99
102
100
	/**
103
	/**
101
	 * <!-- begin-user-doc -->
104
	 * <!-- begin-user-doc -->
105
	 * @since 3.0
102
	 * <!-- end-user-doc -->
106
	 * <!-- end-user-doc -->
103
	 * @generated
107
	 * @generated
104
	 */
108
	 */
105
	public Integer getIntegerSymbol() {
109
	public BigInteger getUnlimitedNaturalSymbol() {
106
		return integerSymbol;
110
		return unlimitedNaturalSymbol;
107
	}
111
	}
108
112
109
	/**
113
	/**
110
	 * <!-- begin-user-doc -->
114
	 * <!-- begin-user-doc -->
115
	 * @since 3.0
111
	 * <!-- end-user-doc -->
116
	 * <!-- end-user-doc -->
112
	 * @generated
117
	 * @generated
113
	 */
118
	 */
114
	public void setIntegerSymbol(Integer newIntegerSymbol) {
119
	public void setUnlimitedNaturalSymbol(BigInteger newUnlimitedNaturalSymbol) {
115
		Integer oldIntegerSymbol = integerSymbol;
120
		BigInteger oldUnlimitedNaturalSymbol = unlimitedNaturalSymbol;
116
		integerSymbol = newIntegerSymbol;
121
		unlimitedNaturalSymbol = newUnlimitedNaturalSymbol;
117
		if (eNotificationRequired())
122
		if (eNotificationRequired())
118
			eNotify(new ENotificationImpl(
123
			eNotify(new ENotificationImpl(
119
				this,
124
				this,
120
				Notification.SET,
125
				Notification.SET,
121
				ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL,
126
				ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL,
122
				oldIntegerSymbol, integerSymbol));
127
				oldUnlimitedNaturalSymbol, unlimitedNaturalSymbol));
123
	}
128
	}
124
129
125
	/**
130
	/**
Lines 128-134 Link Here
128
	 * @generated NOT
133
	 * @generated NOT
129
	 */
134
	 */
130
	public boolean isUnlimited() {
135
	public boolean isUnlimited() {
131
		return getIntegerSymbol() == UNLIMITED;
136
		return (unlimitedNaturalSymbol == null)
137
			|| (unlimitedNaturalSymbol == UNLIMITED);
132
	}
138
	}
133
139
134
	/**
140
	/**
Lines 144-157 Link Here
144
150
145
	/**
151
	/**
146
	 * <!-- begin-user-doc -->
152
	 * <!-- begin-user-doc -->
153
	 * @deprecated use setUnlimitedNaturalSymbol
154
	 * <!-- end-user-doc -->
155
	 * @generated NOT
156
	 */
157
	public void setIntegerSymbol(Integer value) {
158
		setUnlimitedNaturalSymbol(value);
159
	}
160
161
	/**
162
	 * <!-- begin-user-doc -->
163
	 * @since 3.0
164
	 * <!-- end-user-doc -->
165
	 * @generated NOT
166
	 */
167
	public void setUnlimitedNaturalSymbol(Integer value) {
168
		setUnlimitedNaturalSymbol(BigInteger.valueOf(value));
169
	}
170
171
	/**
172
	 * <!-- begin-user-doc -->
147
	 * <!-- end-user-doc -->
173
	 * <!-- end-user-doc -->
148
	 * @generated
174
	 * @generated
149
	 */
175
	 */
150
	@Override
176
	@Override
151
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
177
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
152
		switch (featureID) {
178
		switch (featureID) {
153
			case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
179
			case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
154
				return getIntegerSymbol();
180
				return getUnlimitedNaturalSymbol();
155
			case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
181
			case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
156
				return isUnlimited();
182
				return isUnlimited();
157
		}
183
		}
Lines 166-173 Link Here
166
	@Override
192
	@Override
167
	public void eSet(int featureID, Object newValue) {
193
	public void eSet(int featureID, Object newValue) {
168
		switch (featureID) {
194
		switch (featureID) {
169
			case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
195
			case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
170
				setIntegerSymbol((Integer) newValue);
196
				setUnlimitedNaturalSymbol((BigInteger) newValue);
171
				return;
197
				return;
172
		}
198
		}
173
		super.eSet(featureID, newValue);
199
		super.eSet(featureID, newValue);
Lines 181-188 Link Here
181
	@Override
207
	@Override
182
	public void eUnset(int featureID) {
208
	public void eUnset(int featureID) {
183
		switch (featureID) {
209
		switch (featureID) {
184
			case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
210
			case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
185
				setIntegerSymbol(INTEGER_SYMBOL_EDEFAULT);
211
				setUnlimitedNaturalSymbol(UNLIMITED_NATURAL_SYMBOL_EDEFAULT);
186
				return;
212
				return;
187
		}
213
		}
188
		super.eUnset(featureID);
214
		super.eUnset(featureID);
Lines 196-205 Link Here
196
	@Override
222
	@Override
197
	public boolean eIsSet(int featureID) {
223
	public boolean eIsSet(int featureID) {
198
		switch (featureID) {
224
		switch (featureID) {
199
			case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
225
			case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
200
				return INTEGER_SYMBOL_EDEFAULT == null
226
				return UNLIMITED_NATURAL_SYMBOL_EDEFAULT == null
201
					? integerSymbol != null
227
					? unlimitedNaturalSymbol != null
202
					: !INTEGER_SYMBOL_EDEFAULT.equals(integerSymbol);
228
					: !UNLIMITED_NATURAL_SYMBOL_EDEFAULT
229
						.equals(unlimitedNaturalSymbol);
203
			case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
230
			case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
204
				return isUnlimited() != UNLIMITED_EDEFAULT;
231
				return isUnlimited() != UNLIMITED_EDEFAULT;
205
		}
232
		}
(-)src/org/eclipse/ocl/expressions/operations/IntegerLiteralExpOperations.java (+13 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.expressions.operations;
18
package org.eclipse.ocl.expressions.operations;
19
19
20
import java.math.BigInteger;
20
import java.util.Map;
21
import java.util.Map;
21
22
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.BasicDiagnostic;
Lines 39-44 Link Here
39
 * The following operations are supported:
40
 * The following operations are supported:
40
 * <ul>
41
 * <ul>
41
 *   <li>{@link org.eclipse.ocl.expressions.IntegerLiteralExp#checkIntegerType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Check Integer Type</em>}</li>
42
 *   <li>{@link org.eclipse.ocl.expressions.IntegerLiteralExp#checkIntegerType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Check Integer Type</em>}</li>
43
 *   <li>{@link org.eclipse.ocl.expressions.IntegerLiteralExp#setIntegerSymbol(java.lang.Integer) <em>Set Integer Symbol</em>}</li>
42
 * </ul>
44
 * </ul>
43
 * </p>
45
 * </p>
44
 *
46
 *
Lines 94-97 Link Here
94
		return result;
96
		return result;
95
	}
97
	}
96
98
99
	/**
100
	 * <!-- begin-user-doc -->
101
	 * @since 3.0
102
	 * <!-- end-user-doc -->
103
	 * @generated NOT
104
	 */
105
	public static <C> void setIntegerSymbol(
106
			IntegerLiteralExp<C> integerLiteralExp, Integer value) {
107
		integerLiteralExp.setIntegerSymbol(BigInteger.valueOf(value));
108
	}
109
97
} // IntegerLiteralExpOperations
110
} // IntegerLiteralExpOperations
(-)src/org/eclipse/ocl/expressions/operations/RealLiteralExpOperations.java (-2 / +13 lines)
Lines 17-31 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.expressions.operations;
18
package org.eclipse.ocl.expressions.operations;
19
19
20
import java.math.BigDecimal;
20
import java.util.Map;
21
import java.util.Map;
21
22
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
26
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.RealLiteralExp;
27
import org.eclipse.ocl.expressions.RealLiteralExp;
28
29
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
28
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
30
import org.eclipse.ocl.internal.l10n.OCLMessages;
29
import org.eclipse.ocl.internal.l10n.OCLMessages;
31
import org.eclipse.ocl.util.OCLUtil;
30
import org.eclipse.ocl.util.OCLUtil;
Lines 39-44 Link Here
39
 * The following operations are supported:
38
 * The following operations are supported:
40
 * <ul>
39
 * <ul>
41
 *   <li>{@link org.eclipse.ocl.expressions.RealLiteralExp#checkRealType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Check Real Type</em>}</li>
40
 *   <li>{@link org.eclipse.ocl.expressions.RealLiteralExp#checkRealType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Check Real Type</em>}</li>
41
 *   <li>{@link org.eclipse.ocl.expressions.RealLiteralExp#setRealSymbol(java.lang.Double) <em>Set Real Symbol</em>}</li>
42
 * </ul>
42
 * </ul>
43
 * </p>
43
 * </p>
44
 *
44
 *
Lines 93-96 Link Here
93
		return result;
93
		return result;
94
	}
94
	}
95
95
96
	/**
97
	 * <!-- begin-user-doc -->
98
	 * @since 3.0
99
	 * <!-- end-user-doc -->
100
	 * @generated NOT
101
	 */
102
	public static <C> void setRealSymbol(RealLiteralExp<C> realLiteralExp,
103
			Double value) {
104
		realLiteralExp.setRealSymbol(new BigDecimal(value));
105
	}
106
96
} // RealLiteralExpOperations
107
} // RealLiteralExpOperations
(-)src/org/eclipse/ocl/expressions/operations/UnlimitedNaturalLiteralExpOperations.java (+27 lines)
Lines 39-44 Link Here
39
 * The following operations are supported:
39
 * The following operations are supported:
40
 * <ul>
40
 * <ul>
41
 *   <li>{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#checkNaturalType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Check Natural Type</em>}</li>
41
 *   <li>{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#checkNaturalType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Check Natural Type</em>}</li>
42
 *   <li>{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#setIntegerSymbol(java.lang.Integer) <em>Set Integer Symbol</em>}</li>
43
 *   <li>{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#setUnlimitedNaturalSymbol(java.lang.Integer) <em>Set Unlimited Natural Symbol</em>}</li>
42
 * </ul>
44
 * </ul>
43
 * </p>
45
 * </p>
44
 *
46
 *
Lines 96-99 Link Here
96
		return result;
98
		return result;
97
	}
99
	}
98
100
101
	/**
102
	 * <!-- begin-user-doc -->
103
	 * @since 3.0
104
	 * <!-- end-user-doc -->
105
	 * @generated NOT
106
	 */
107
	public static <C> void setIntegerSymbol(
108
			UnlimitedNaturalLiteralExp<C> unlimitedNaturalLiteralExp,
109
			Integer value) {
110
		unlimitedNaturalLiteralExp.setUnlimitedNaturalSymbol(value);
111
	}
112
113
	/**
114
	 * <!-- begin-user-doc -->
115
	 * @since 3.0
116
	 * <!-- end-user-doc -->
117
	 * @generated NOT
118
	 */
119
	public static <C> void setUnlimitedNaturalSymbol(
120
			UnlimitedNaturalLiteralExp<C> unlimitedNaturalLiteralExp,
121
			Integer setUnlimitedNaturalSymbol) {
122
		unlimitedNaturalLiteralExp
123
			.setUnlimitedNaturalSymbol(setUnlimitedNaturalSymbol);
124
	}
125
99
} // UnlimitedNaturalLiteralExpOperations
126
} // UnlimitedNaturalLiteralExpOperations
(-)src/org/eclipse/ocl/internal/evaluation/NumberUtil.java (-28 / +14 lines)
Lines 63-70 Link Here
63
                result = number;
63
                result = number;
64
            }
64
            }
65
        } else if (number instanceof BigInteger) {
65
        } else if (number instanceof BigInteger) {
66
            if (isInteger((BigInteger) number)) {
66
        	if (isInteger((BigInteger) number)) {
67
                result = number.intValue();
67
                result = number.intValue();
68
            } else if (isLong((BigInteger) number)) {
69
                result = number.longValue();
68
            } else {
70
            } else {
69
                // do nothing, NFE will occur
71
                // do nothing, NFE will occur
70
                result = number;
72
                result = number;
Lines 103-109 Link Here
103
    private static boolean isLong(BigInteger number) {
105
    private static boolean isLong(BigInteger number) {
104
        long i = number.longValue();
106
        long i = number.longValue();
105
        BigInteger b = new BigInteger(String.valueOf(i));
107
        BigInteger b = new BigInteger(String.valueOf(i));
106
        
108
      
107
        return number.equals(b);
109
        return number.equals(b);
108
    }
110
    }
109
111
Lines 123-158 Link Here
123
     * 
125
     * 
124
     * @param number a number to coerce to <tt>Long</tt> or <tt>Double</tt>
126
     * @param number a number to coerce to <tt>Long</tt> or <tt>Double</tt>
125
     * @return the coerced number, or the original number, in case of overflow
127
     * @return the coerced number, or the original number, in case of overflow
128
     * 
129
     * @deprecated use ObjectUtil.normalize
126
     */
130
     */
127
    public static Number higherPrecisionNumber(Number number) { 
131
    public static Number higherPrecisionNumber(Number number) { 
128
        Number result;
132
        if ((number instanceof BigInteger) || (number instanceof BigDecimal)) {
129
        
133
        	return number;
130
        if ((number instanceof Integer) || (number instanceof Byte) ||
134
        } else if ((number instanceof Integer) || (number instanceof Byte) ||
131
                (number instanceof Short)) {
135
                (number instanceof Short) || (number instanceof Long)) {
132
            result = number.longValue();
136
            return BigInteger.valueOf(number.longValue());
133
        } else if (number instanceof Long) {
137
        } else if ((number instanceof Double) || (number instanceof Float)) {
134
            result = number;
138
            return new BigDecimal(number.doubleValue());
135
        } else if (number instanceof BigInteger) {
136
            if (isLong((BigInteger) number)) {
137
                result = number.longValue();
138
            } else {
139
                // do nothing, NFE will occur
140
                result = number;
141
            }
142
        } else if (number instanceof Float) {
143
            result = number.doubleValue();
144
        } else if (number instanceof BigDecimal) {
145
            if (isDouble((BigDecimal) number)) {
146
                result = number.doubleValue();
147
            } else {
148
                // do nothing, NFE will occur
149
                result = number;
150
            }
151
        } else {
139
        } else {
152
            // some odd-ball number we've never heard of.  NFE will occur
140
            // some odd-ball number we've never heard of.  NFE will occur
153
            result = number;
141
            return number;
154
        }
142
        }
155
        
156
        return result;
157
    }
143
    }
158
}
144
}
(-)src/org/eclipse/ocl/parser/AbstractOCLAnalyzer.java (-2 / +2 lines)
Lines 2937-2944 Link Here
2937
		UnlimitedNaturalLiteralExp<C> astNode = oclFactory
2937
		UnlimitedNaturalLiteralExp<C> astNode = oclFactory
2938
			.createUnlimitedNaturalLiteralExp();
2938
			.createUnlimitedNaturalLiteralExp();
2939
		initASTMapping(env, astNode, unlimitedNaturalLiteralExpCS);
2939
		initASTMapping(env, astNode, unlimitedNaturalLiteralExpCS);
2940
		astNode.setIntegerSymbol(unlimitedNaturalLiteralExpCS
2940
		astNode.setUnlimitedNaturalSymbol(unlimitedNaturalLiteralExpCS
2941
			.getIntegerSymbol());
2941
			.getUnlimitedNaturalSymbol());
2942
		astNode.setType(env.getOCLStandardLibrary().getUnlimitedNatural());
2942
		astNode.setType(env.getOCLStandardLibrary().getUnlimitedNatural());
2943
		TRACE(
2943
		TRACE(
2944
			"unlimitedNaturalLiteralExpCS", "UnlimitedNatural: " + unlimitedNaturalLiteralExpCS.getSymbol());//$NON-NLS-2$//$NON-NLS-1$
2944
			"unlimitedNaturalLiteralExpCS", "UnlimitedNatural: " + unlimitedNaturalLiteralExpCS.getSymbol());//$NON-NLS-2$//$NON-NLS-1$
(-)src/org/eclipse/ocl/parser/AbstractOCLParser.java (-4 / +7 lines)
Lines 20-25 Link Here
20
 */
20
 */
21
package org.eclipse.ocl.parser;
21
package org.eclipse.ocl.parser;
22
22
23
import java.math.BigDecimal;
23
import java.util.HashSet;
24
import java.util.HashSet;
24
import java.util.Set;
25
import java.util.Set;
25
26
Lines 80-91 Link Here
80
import org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS;
81
import org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS;
81
import org.eclipse.ocl.cst.VariableCS;
82
import org.eclipse.ocl.cst.VariableCS;
82
import org.eclipse.ocl.cst.VariableExpCS;
83
import org.eclipse.ocl.cst.VariableExpCS;
84
import org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp;
83
import org.eclipse.ocl.internal.l10n.OCLMessages;
85
import org.eclipse.ocl.internal.l10n.OCLMessages;
84
import org.eclipse.ocl.lpg.AbstractLexer;
86
import org.eclipse.ocl.lpg.AbstractLexer;
85
import org.eclipse.ocl.lpg.AbstractParser;
87
import org.eclipse.ocl.lpg.AbstractParser;
86
import org.eclipse.ocl.lpg.BasicEnvironment;
88
import org.eclipse.ocl.lpg.BasicEnvironment;
87
import org.eclipse.ocl.lpg.ProblemHandler;
89
import org.eclipse.ocl.lpg.ProblemHandler;
88
import org.eclipse.ocl.options.ProblemOption;
90
import org.eclipse.ocl.options.ProblemOption;
91
import org.eclipse.ocl.util.ObjectUtil;
89
92
90
public abstract class AbstractOCLParser
93
public abstract class AbstractOCLParser
91
		extends AbstractParser {
94
		extends AbstractParser {
Lines 491-497 Link Here
491
		IntegerLiteralExpCS result = CSTFactory.eINSTANCE
494
		IntegerLiteralExpCS result = CSTFactory.eINSTANCE
492
			.createIntegerLiteralExpCS();
495
			.createIntegerLiteralExpCS();
493
		result.setSymbol(string);
496
		result.setSymbol(string);
494
		result.setIntegerSymbol(Integer.valueOf(string));
497
		result.setIntegerSymbol(ObjectUtil.createBigInteger(string));
495
		return result;
498
		return result;
496
	}
499
	}
497
500
Lines 502-510 Link Here
502
			.createUnlimitedNaturalLiteralExpCS();
505
			.createUnlimitedNaturalLiteralExpCS();
503
		result.setSymbol(string);
506
		result.setSymbol(string);
504
		if ("*".equals(string)) {
507
		if ("*".equals(string)) {
505
			result.setIntegerSymbol(-1);
508
			result.setUnlimitedNaturalSymbol(UnlimitedNaturalLiteralExp.UNLIMITED);
506
		} else {
509
		} else {
507
			result.setIntegerSymbol(Integer.valueOf(string));
510
			result.setUnlimitedNaturalSymbol(ObjectUtil.createBigInteger(string));
508
		}
511
		}
509
		return result;
512
		return result;
510
	}
513
	}
Lines 512-518 Link Here
512
	protected RealLiteralExpCS createRealLiteralExpCS(String string) {
515
	protected RealLiteralExpCS createRealLiteralExpCS(String string) {
513
		RealLiteralExpCS result = CSTFactory.eINSTANCE.createRealLiteralExpCS();
516
		RealLiteralExpCS result = CSTFactory.eINSTANCE.createRealLiteralExpCS();
514
		result.setSymbol(string);
517
		result.setSymbol(string);
515
		result.setRealSymbol(Double.valueOf(string));
518
		result.setRealSymbol(new BigDecimal(string));
516
		return result;
519
		return result;
517
	}
520
	}
518
521
(-)src/org/eclipse/ocl/types/impl/TypesPackageImpl.java (-1 / +5 lines)
Lines 13-19 Link Here
13
 * 
13
 * 
14
 * </copyright>
14
 * </copyright>
15
 *
15
 *
16
 * $Id: TypesPackageImpl.java,v 1.12 2010/01/14 12:44:33 ewillink Exp $
16
 * $Id: TypesPackageImpl.java,v 1.11 2009/12/06 18:12:59 ewillink Exp $
17
 */
17
 */
18
package org.eclipse.ocl.types.impl;
18
package org.eclipse.ocl.types.impl;
19
19
Lines 25-30 Link Here
25
import org.eclipse.emf.ecore.EReference;
25
import org.eclipse.emf.ecore.EReference;
26
import org.eclipse.emf.ecore.ETypeParameter;
26
import org.eclipse.emf.ecore.ETypeParameter;
27
import org.eclipse.emf.ecore.EValidator;
27
import org.eclipse.emf.ecore.EValidator;
28
import org.eclipse.emf.ecore.EcorePackage;
28
import org.eclipse.emf.ecore.impl.EPackageImpl;
29
import org.eclipse.emf.ecore.impl.EPackageImpl;
29
import org.eclipse.ocl.expressions.ExpressionsPackage;
30
import org.eclipse.ocl.expressions.ExpressionsPackage;
30
import org.eclipse.ocl.expressions.impl.ExpressionsPackageImpl;
31
import org.eclipse.ocl.expressions.impl.ExpressionsPackageImpl;
Lines 207-212 Link Here
207
208
208
		isInited = true;
209
		isInited = true;
209
210
211
		// Initialize simple dependencies
212
		EcorePackage.eINSTANCE.eClass();
213
210
		// Obtain or create and register interdependencies
214
		// Obtain or create and register interdependencies
211
		UtilitiesPackageImpl theUtilitiesPackage = (UtilitiesPackageImpl) (EPackage.Registry.INSTANCE
215
		UtilitiesPackageImpl theUtilitiesPackage = (UtilitiesPackageImpl) (EPackage.Registry.INSTANCE
212
			.getEPackage(UtilitiesPackage.eNS_URI) instanceof UtilitiesPackageImpl
216
			.getEPackage(UtilitiesPackage.eNS_URI) instanceof UtilitiesPackageImpl
(-)src/org/eclipse/ocl/util/CollectionUtil.java (+14 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.util;
18
package org.eclipse.ocl.util;
19
19
20
import java.math.BigDecimal;
21
import java.math.BigInteger;
20
import java.util.ArrayList;
22
import java.util.ArrayList;
21
import java.util.Collection;
23
import java.util.Collection;
22
import java.util.Collections;
24
import java.util.Collections;
Lines 182-193 Link Here
182
                currVal += ((Integer) it.next()).intValue();
184
                currVal += ((Integer) it.next()).intValue();
183
            }
185
            }
184
            return new Integer(currVal);
186
            return new Integer(currVal);
187
        } else if (object instanceof BigInteger) {
188
        	BigInteger currVal = BigInteger.valueOf(0);
189
            for (it = self.iterator(); it.hasNext();) {
190
                currVal = currVal.add((BigInteger) it.next());
191
            }
192
            return currVal;
185
        } else if (object instanceof Double) {
193
        } else if (object instanceof Double) {
186
            double currVal = 0.0;
194
            double currVal = 0.0;
187
            for (it = self.iterator(); it.hasNext();) {
195
            for (it = self.iterator(); it.hasNext();) {
188
                currVal += ((Double) it.next()).doubleValue();
196
                currVal += ((Double) it.next()).doubleValue();
189
            }
197
            }
190
            return new Double(currVal);
198
            return new Double(currVal);
199
        } else if (object instanceof BigDecimal) {
200
        	BigDecimal currVal = BigDecimal.ZERO;
201
            for (it = self.iterator(); it.hasNext();) {
202
                currVal = currVal.add((BigDecimal) it.next());
203
            }
204
            return currVal;
191
        } else {
205
        } else {
192
            IllegalArgumentException error = new IllegalArgumentException(
206
            IllegalArgumentException error = new IllegalArgumentException(
193
            		OCLMessages.SumOperator_ERROR_);
207
            		OCLMessages.SumOperator_ERROR_);
(-)src/org/eclipse/ocl/util/ObjectUtil.java (-19 / +87 lines)
Lines 16-21 Link Here
16
 */
16
 */
17
package org.eclipse.ocl.util;
17
package org.eclipse.ocl.util;
18
18
19
import java.math.BigDecimal;
20
import java.math.BigInteger;
19
import java.util.Collection;
21
import java.util.Collection;
20
import java.util.Iterator;
22
import java.util.Iterator;
21
23
Lines 23-29 Link Here
23
import org.eclipse.emf.ecore.EEnumLiteral;
25
import org.eclipse.emf.ecore.EEnumLiteral;
24
import org.eclipse.emf.ecore.EObject;
26
import org.eclipse.emf.ecore.EObject;
25
import org.eclipse.emf.ecore.util.EcoreUtil;
27
import org.eclipse.emf.ecore.util.EcoreUtil;
26
import org.eclipse.ocl.internal.evaluation.NumberUtil;
28
import org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp;
27
29
28
/**
30
/**
29
 * Certain generic utility operations on objects.
31
 * Certain generic utility operations on objects.
Lines 32-37 Link Here
32
 */
34
 */
33
public class ObjectUtil {
35
public class ObjectUtil {
34
36
37
	private static final String maxLongValue = Long.toString(Long.MAX_VALUE);
38
	private static final int maxLongSize = maxLongValue.length();
39
35
	/**
40
	/**
36
     * Computes the equivalence of two objects, accounting for primitive numeric
41
     * Computes the equivalence of two objects, accounting for primitive numeric
37
     * values that OCL considers equal but Java does not.  This is also safe
42
     * values that OCL considers equal but Java does not.  This is also safe
Lines 51-72 Link Here
51
56
52
		// primitive types
57
		// primitive types
53
		if (isPrimitive(anObject) || isPrimitive(anotherObject)) {
58
		if (isPrimitive(anObject) || isPrimitive(anotherObject)) {
54
		    if (anObject instanceof Integer) {
59
		    if (anObject instanceof Number && anotherObject instanceof Number) {
55
		        anObject = NumberUtil.higherPrecisionNumber((Integer) anObject);
60
		        anObject = ObjectUtil.normalise(anObject);
56
		    }
61
                anotherObject = ObjectUtil.normalise(anotherObject);
57
            if (anotherObject instanceof Integer) {
62
				if (anObject instanceof BigInteger) {
58
                anotherObject = NumberUtil.higherPrecisionNumber((Integer) anotherObject);
63
					if (anotherObject instanceof BigInteger) {
59
            }
64
		                return anObject.equals(anotherObject);
60
		    
65
					}
61
			if (anObject instanceof Long && anotherObject instanceof Long) {
66
					anObject = new BigDecimal((BigInteger) anObject);
62
                return ((Long) anObject).longValue() == ((Long) anotherObject).longValue();
67
				}
63
            } else if (anObject instanceof Long && anotherObject instanceof Double) {
68
				else if (anotherObject instanceof BigInteger) {
64
                return ((Long) anObject).doubleValue() == ((Double) anotherObject).doubleValue();
69
					anotherObject = new BigDecimal((BigInteger) anotherObject);
65
            } else if (anObject instanceof Double && anotherObject instanceof Long) {
70
				}
66
                return ((Double) anObject).doubleValue() == ((Long) anotherObject).doubleValue();
71
				BigDecimal delta = ((BigDecimal) anObject).subtract((BigDecimal) anotherObject);
67
            } else if (anObject instanceof Double && anotherObject instanceof Double) {
72
				return delta.signum() == 0;
68
                return ((Double) anObject).doubleValue() == ((Double) anotherObject).doubleValue();
73
			} else if (anObject instanceof UnlimitedNaturalLiteralExp<?> && anotherObject instanceof UnlimitedNaturalLiteralExp<?>) {
69
            } else if (anObject instanceof String && anotherObject instanceof String) {
74
                return ((UnlimitedNaturalLiteralExp<?>)anObject).isUnlimited() && ((UnlimitedNaturalLiteralExp<?>)anotherObject).isUnlimited();
75
			} else if (anObject instanceof String && anotherObject instanceof String) {
70
                return anObject.equals(anotherObject);
76
                return anObject.equals(anotherObject);
71
            } else if (anObject instanceof Boolean && anotherObject instanceof Boolean) {
77
            } else if (anObject instanceof Boolean && anotherObject instanceof Boolean) {
72
                return ((Boolean) anObject).booleanValue() == ((Boolean) anotherObject).booleanValue();
78
                return ((Boolean) anObject).booleanValue() == ((Boolean) anotherObject).booleanValue();
Lines 109-114 Link Here
109
                return 37 * ((Long) anObject).intValue();
115
                return 37 * ((Long) anObject).intValue();
110
            } else if (anObject instanceof Double) {
116
            } else if (anObject instanceof Double) {
111
                return 37 * ((Double) anObject).intValue();
117
                return 37 * ((Double) anObject).intValue();
118
            } else if (anObject instanceof BigDecimal) {
119
                return 37 * ((BigDecimal) anObject).intValue();
120
            } else if (anObject instanceof BigInteger) {
121
                return 37 * ((BigInteger) anObject).intValue();
112
            } else if (anObject instanceof String) {
122
            } else if (anObject instanceof String) {
113
                return anObject.hashCode();
123
                return anObject.hashCode();
114
            } else if (anObject instanceof Boolean) {
124
            } else if (anObject instanceof Boolean) {
Lines 133-140 Link Here
133
     * @return whether it is an OCL primitive value
143
     * @return whether it is an OCL primitive value
134
     */
144
     */
135
	public static boolean isPrimitive(Object o) {
145
	public static boolean isPrimitive(Object o) {
136
		return o instanceof Integer || o instanceof Long || o instanceof String
146
		return o instanceof Integer || o instanceof Long || o instanceof BigInteger
137
			|| o instanceof Boolean || o instanceof Double;
147
			|| o instanceof String || o instanceof Boolean
148
			|| o instanceof Double || o instanceof BigDecimal || o instanceof UnlimitedNaturalLiteralExp<?>;
149
	}
150
	
151
	/**
152
	 * Creates a BigInteger representation for aValue.
153
	 * @param aValue the string representation of a (non-negative) integer number
154
	 * @return the numeric representation
155
	 * @throws NumberFormatException if representation cannot be created
156
	 * @since 3.0
157
	 */
158
	public static BigInteger createBigInteger(String aValue) {
159
		int len = aValue.length();
160
		if ((len < maxLongSize) || ((len == maxLongSize) && (maxLongValue.compareTo(aValue) >= 0))) {
161
			return BigInteger.valueOf(Long.parseLong(aValue));
162
		}
163
		else {
164
			return new BigInteger(aValue);
165
		}
166
	}
167
	
168
	/**
169
	 * Creates a BigInteger or BigDecimal representation for aValue.
170
	 * @param aValue the string representation of a (non-negative) integer number
171
	 * @return the numeric representation
172
	 * @throws NumberFormatException if representation cannot be created
173
	 * @since 3.0
174
	 */
175
	@SuppressWarnings("nls")
176
	public static Number createNumber(String aValue) {
177
		if (aValue.contains(".") || aValue.contains("e") || aValue.contains("E")) {
178
			return new BigDecimal(aValue);
179
		} else {
180
			return ObjectUtil.createBigInteger(aValue);
181
		}
138
	}
182
	}
139
183
140
	/**
184
	/**
Lines 161-164 Link Here
161
	        }
205
	        }
162
	    }
206
	    }
163
	}
207
	}
208
209
    /**
210
     * <p>
211
     * Normalises the given object converting numbers to either <tt>BigDecimal</tt> or <tt>BigInteger</tt> precision.
212
     * </p>
213
     * 
214
     * @param object to normalise
215
     * @return the normalised object
216
     *
217
	 * @since 3.0
218
	 */
219
	public static Object normalise(Object object) {
220
		if (object instanceof Number) {
221
	        if ((object instanceof BigInteger) || (object instanceof BigDecimal)) {
222
	        	return object;
223
	        } else if ((object instanceof Byte) || (object instanceof Short) ||
224
	                (object instanceof Integer) || (object instanceof Long)) {
225
	            return BigInteger.valueOf(((Number)object).longValue());
226
	        } else if ((object instanceof Float) || (object instanceof Double)) {
227
	            return new BigDecimal(((Number)object).doubleValue());
228
	        }
229
	    }
230
        return object;
231
	}
164
}
232
}
(-)src/org/eclipse/ocl/util/ToStringVisitor.java (-2 / +2 lines)
Lines 372-379 Link Here
372
            return "*"; //$NON-NLS-1$
372
            return "*"; //$NON-NLS-1$
373
        }
373
        }
374
        
374
        
375
        return (unl.getIntegerSymbol() == null)? NULL_PLACEHOLDER
375
        return (unl.getUnlimitedNaturalSymbol() == null)? NULL_PLACEHOLDER
376
                : unl.getIntegerSymbol().toString();
376
                : unl.getUnlimitedNaturalSymbol().toString();
377
    }
377
    }
378
    
378
    
379
379
(-)src/org/eclipse/ocl/utilities/impl/UtilitiesFactoryImpl.java (-2 / +24 lines)
Lines 16-27 Link Here
16
package org.eclipse.ocl.utilities.impl;
16
package org.eclipse.ocl.utilities.impl;
17
17
18
import org.eclipse.emf.ecore.EClass;
18
import org.eclipse.emf.ecore.EClass;
19
import org.eclipse.emf.ecore.EDataType;
19
import org.eclipse.emf.ecore.EObject;
20
import org.eclipse.emf.ecore.EObject;
20
import org.eclipse.emf.ecore.EPackage;
21
import org.eclipse.emf.ecore.EPackage;
21
import org.eclipse.emf.ecore.impl.EFactoryImpl;
22
import org.eclipse.emf.ecore.impl.EFactoryImpl;
22
import org.eclipse.emf.ecore.plugin.EcorePlugin;
23
import org.eclipse.emf.ecore.plugin.EcorePlugin;
23
24
import org.eclipse.ocl.util.ObjectUtil;
24
//import org.eclipse.ocl.utilities.*;
25
import org.eclipse.ocl.utilities.UtilitiesFactory;
25
import org.eclipse.ocl.utilities.UtilitiesFactory;
26
import org.eclipse.ocl.utilities.UtilitiesPackage;
26
import org.eclipse.ocl.utilities.UtilitiesPackage;
27
27
Lines 80-85 Link Here
80
80
81
	/**
81
	/**
82
	 * <!-- begin-user-doc -->
82
	 * <!-- begin-user-doc -->
83
	 * @since 3.0
84
	 * <!-- end-user-doc -->
85
	 * @generated NOT
86
	 */
87
	public Number createNumberFromString(EDataType eDataType,
88
			String initialValue) {
89
		return ObjectUtil.createNumber(initialValue);
90
	}
91
92
	/**
93
	 * <!-- begin-user-doc -->
94
	 * @since 3.0
95
	 * <!-- end-user-doc -->
96
	 * @generated NOT
97
	 */
98
	public String convertNumberToString(EDataType eDataType,
99
			Object instanceValue) {
100
		return instanceValue.toString();
101
	}
102
103
	/**
104
	 * <!-- begin-user-doc -->
83
	 * <!-- end-user-doc -->
105
	 * <!-- end-user-doc -->
84
	 * @generated
106
	 * @generated
85
	 */
107
	 */
(-)src/org/eclipse/ocl/utilities/impl/UtilitiesPackageImpl.java (-1 / +5 lines)
Lines 12-18 Link Here
12
 * 
12
 * 
13
 * </copyright>
13
 * </copyright>
14
 *
14
 *
15
 * $Id: UtilitiesPackageImpl.java,v 1.12 2010/01/14 12:44:33 ewillink Exp $
15
 * $Id: UtilitiesPackageImpl.java,v 1.11 2009/12/06 18:13:35 ewillink Exp $
16
 */
16
 */
17
package org.eclipse.ocl.utilities.impl;
17
package org.eclipse.ocl.utilities.impl;
18
18
Lines 23-28 Link Here
23
import org.eclipse.emf.ecore.EPackage;
23
import org.eclipse.emf.ecore.EPackage;
24
import org.eclipse.emf.ecore.EReference;
24
import org.eclipse.emf.ecore.EReference;
25
import org.eclipse.emf.ecore.ETypeParameter;
25
import org.eclipse.emf.ecore.ETypeParameter;
26
import org.eclipse.emf.ecore.EcorePackage;
26
import org.eclipse.emf.ecore.impl.EPackageImpl;
27
import org.eclipse.emf.ecore.impl.EPackageImpl;
27
import org.eclipse.ocl.expressions.ExpressionsPackage;
28
import org.eclipse.ocl.expressions.ExpressionsPackage;
28
import org.eclipse.ocl.expressions.impl.ExpressionsPackageImpl;
29
import org.eclipse.ocl.expressions.impl.ExpressionsPackageImpl;
Lines 156-161 Link Here
156
157
157
		isInited = true;
158
		isInited = true;
158
159
160
		// Initialize simple dependencies
161
		EcorePackage.eINSTANCE.eClass();
162
159
		// Obtain or create and register interdependencies
163
		// Obtain or create and register interdependencies
160
		TypesPackageImpl theTypesPackage = (TypesPackageImpl) (EPackage.Registry.INSTANCE
164
		TypesPackageImpl theTypesPackage = (TypesPackageImpl) (EPackage.Registry.INSTANCE
161
			.getEPackage(TypesPackage.eNS_URI) instanceof TypesPackageImpl
165
			.getEPackage(TypesPackage.eNS_URI) instanceof TypesPackageImpl
(-)model/oclstdlib.ecore (-2 / +2 lines)
Lines 153-159 Link Here
153
        <eParameters name="b" eType="#/0/Boolean"/>
153
        <eParameters name="b" eType="#/0/Boolean"/>
154
      </eOperations>
154
      </eOperations>
155
    </eClassifiers>
155
    </eClassifiers>
156
    <eClassifiers xsi:type="ocl.ecore:PrimitiveType" name="Integer" instanceClassName="java.lang.Integer"/>
156
    <eClassifiers xsi:type="ocl.ecore:PrimitiveType" name="Integer" instanceClassName="java.math.BigInteger"/>
157
    <eClassifiers xsi:type="ecore:EClass" name="Integer_Class">
157
    <eClassifiers xsi:type="ecore:EClass" name="Integer_Class">
158
      <eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL" references="#/0/Integer"/>
158
      <eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL" references="#/0/Integer"/>
159
      <eOperations name="=" eType="#/0/Boolean">
159
      <eOperations name="=" eType="#/0/Boolean">
Lines 307-313 Link Here
307
        <eParameters name="n" eType="#/0/UnlimitedNatural"/>
307
        <eParameters name="n" eType="#/0/UnlimitedNatural"/>
308
      </eOperations>
308
      </eOperations>
309
    </eClassifiers>
309
    </eClassifiers>
310
    <eClassifiers xsi:type="ocl.ecore:PrimitiveType" name="Real" instanceClassName="java.lang.Double"/>
310
    <eClassifiers xsi:type="ocl.ecore:PrimitiveType" name="Real" instanceClassName="java.math.BigDecimal"/>
311
    <eClassifiers xsi:type="ecore:EClass" name="Real_Class">
311
    <eClassifiers xsi:type="ecore:EClass" name="Real_Class">
312
      <eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL" references="#/0/Real"/>
312
      <eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL" references="#/0/Real"/>
313
      <eOperations name="=" eType="#/0/Boolean">
313
      <eOperations name="=" eType="#/0/Boolean">
(-)src/org/eclipse/ocl/ecore/EcorePackage.java (-4 / +3 lines)
Lines 5765-5779 Link Here
5765
	int UNLIMITED_NATURAL_LITERAL_EXP__END_POSITION = NUMERIC_LITERAL_EXP__END_POSITION;
5765
	int UNLIMITED_NATURAL_LITERAL_EXP__END_POSITION = NUMERIC_LITERAL_EXP__END_POSITION;
5766
5766
5767
	/**
5767
	/**
5768
	 * The feature id for the '<em><b>Integer Symbol</b></em>' attribute.
5768
	 * The feature id for the '<em><b>Unlimited Natural Symbol</b></em>' attribute.
5769
	 * <!-- begin-user-doc -->
5769
	 * <!-- begin-user-doc -->
5770
	 * This value may change when the model code is regenerated.
5770
	 * @since 3.0
5771
	 * It is subject to change without notice.
5772
	 * <!-- end-user-doc -->
5771
	 * <!-- end-user-doc -->
5773
	 * @generated
5772
	 * @generated
5774
	 * @ordered
5773
	 * @ordered
5775
	 */
5774
	 */
5776
	int UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL = NUMERIC_LITERAL_EXP_FEATURE_COUNT + 0;
5775
	int UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL = NUMERIC_LITERAL_EXP_FEATURE_COUNT + 0;
5777
5776
5778
	/**
5777
	/**
5779
	 * The feature id for the '<em><b>Unlimited</b></em>' attribute.
5778
	 * The feature id for the '<em><b>Unlimited</b></em>' attribute.
(-)src/org/eclipse/ocl/ecore/impl/EcorePackageImpl.java (-1 lines)
Lines 517-523 Link Here
517
		isInited = true;
517
		isInited = true;
518
518
519
		// Initialize simple dependencies
519
		// Initialize simple dependencies
520
		org.eclipse.emf.ecore.EcorePackage.eINSTANCE.eClass();
521
		TypesPackage.eINSTANCE.eClass();
520
		TypesPackage.eINSTANCE.eClass();
522
		UtilitiesPackage.eINSTANCE.eClass();
521
		UtilitiesPackage.eINSTANCE.eClass();
523
		ExpressionsPackage.eINSTANCE.eClass();
522
		ExpressionsPackage.eINSTANCE.eClass();
(-)src/org/eclipse/ocl/ecore/impl/IntegerLiteralExpImpl.java (-6 / +18 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.ecore.impl;
18
package org.eclipse.ocl.ecore.impl;
19
19
20
import java.math.BigInteger;
20
import java.util.Map;
21
import java.util.Map;
21
22
22
import org.eclipse.emf.common.notify.Notification;
23
import org.eclipse.emf.common.notify.Notification;
Lines 63-69 Link Here
63
	 * @generated
64
	 * @generated
64
	 * @ordered
65
	 * @ordered
65
	 */
66
	 */
66
	protected static final Integer INTEGER_SYMBOL_EDEFAULT = null;
67
	protected static final BigInteger INTEGER_SYMBOL_EDEFAULT = null;
67
68
68
	/**
69
	/**
69
	 * The cached value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
70
	 * The cached value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
Lines 73-79 Link Here
73
	 * @generated
74
	 * @generated
74
	 * @ordered
75
	 * @ordered
75
	 */
76
	 */
76
	protected Integer integerSymbol = INTEGER_SYMBOL_EDEFAULT;
77
	protected BigInteger integerSymbol = INTEGER_SYMBOL_EDEFAULT;
77
78
78
	/**
79
	/**
79
	 * <!-- begin-user-doc -->
80
	 * <!-- begin-user-doc -->
Lines 96-115 Link Here
96
97
97
	/**
98
	/**
98
	 * <!-- begin-user-doc -->
99
	 * <!-- begin-user-doc -->
100
	 * @since 3.0
99
	 * <!-- end-user-doc -->
101
	 * <!-- end-user-doc -->
100
	 * @generated
102
	 * @generated
101
	 */
103
	 */
102
	public Integer getIntegerSymbol() {
104
	public BigInteger getIntegerSymbol() {
103
		return integerSymbol;
105
		return integerSymbol;
104
	}
106
	}
105
107
106
	/**
108
	/**
107
	 * <!-- begin-user-doc -->
109
	 * <!-- begin-user-doc -->
110
	 * @since 3.0
108
	 * <!-- end-user-doc -->
111
	 * <!-- end-user-doc -->
109
	 * @generated
112
	 * @generated
110
	 */
113
	 */
111
	public void setIntegerSymbol(Integer newIntegerSymbol) {
114
	public void setIntegerSymbol(BigInteger newIntegerSymbol) {
112
		Integer oldIntegerSymbol = integerSymbol;
115
		BigInteger oldIntegerSymbol = integerSymbol;
113
		integerSymbol = newIntegerSymbol;
116
		integerSymbol = newIntegerSymbol;
114
		if (eNotificationRequired())
117
		if (eNotificationRequired())
115
			eNotify(new ENotificationImpl(this, Notification.SET,
118
			eNotify(new ENotificationImpl(this, Notification.SET,
Lines 131-136 Link Here
131
	/**
134
	/**
132
	 * <!-- begin-user-doc -->
135
	 * <!-- begin-user-doc -->
133
	 * <!-- end-user-doc -->
136
	 * <!-- end-user-doc -->
137
	 * @generated NOT
138
	 */
139
	public void setIntegerSymbol(Integer value) {
140
		setIntegerSymbol(BigInteger.valueOf(value));
141
	}
142
143
	/**
144
	 * <!-- begin-user-doc -->
145
	 * <!-- end-user-doc -->
134
	 * @generated
146
	 * @generated
135
	 */
147
	 */
136
	@Override
148
	@Override
Lines 151-157 Link Here
151
	public void eSet(int featureID, Object newValue) {
163
	public void eSet(int featureID, Object newValue) {
152
		switch (featureID) {
164
		switch (featureID) {
153
			case EcorePackage.INTEGER_LITERAL_EXP__INTEGER_SYMBOL :
165
			case EcorePackage.INTEGER_LITERAL_EXP__INTEGER_SYMBOL :
154
				setIntegerSymbol((Integer) newValue);
166
				setIntegerSymbol((BigInteger) newValue);
155
				return;
167
				return;
156
		}
168
		}
157
		super.eSet(featureID, newValue);
169
		super.eSet(featureID, newValue);
(-)src/org/eclipse/ocl/ecore/impl/RealLiteralExpImpl.java (-14 / +18 lines)
Lines 17-40 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.ecore.impl;
18
package org.eclipse.ocl.ecore.impl;
19
19
20
import java.math.BigDecimal;
20
import java.util.Map;
21
import java.util.Map;
21
22
22
import org.eclipse.emf.common.notify.Notification;
23
import org.eclipse.emf.common.notify.Notification;
23
24
//import org.eclipse.emf.common.util.BasicDiagnostic;
25
//import org.eclipse.emf.common.util.Diagnostic;
26
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
27
import org.eclipse.emf.ecore.EClass;
25
import org.eclipse.emf.ecore.EClass;
28
import org.eclipse.emf.ecore.EClassifier;
26
import org.eclipse.emf.ecore.EClassifier;
29
import org.eclipse.emf.ecore.impl.ENotificationImpl;
27
import org.eclipse.emf.ecore.impl.ENotificationImpl;
30
31
//import org.eclipse.emf.ecore.plugin.EcorePlugin;
32
//import org.eclipse.emf.ecore.util.EObjectValidator;
33
import org.eclipse.ocl.ecore.EcorePackage;
28
import org.eclipse.ocl.ecore.EcorePackage;
34
import org.eclipse.ocl.ecore.RealLiteralExp;
29
import org.eclipse.ocl.ecore.RealLiteralExp;
35
import org.eclipse.ocl.expressions.ExpressionsPackage;
30
import org.eclipse.ocl.expressions.ExpressionsPackage;
36
37
//import org.eclipse.ocl.expressions.util.ExpressionsValidator;
38
import org.eclipse.ocl.expressions.operations.RealLiteralExpOperations;
31
import org.eclipse.ocl.expressions.operations.RealLiteralExpOperations;
39
import org.eclipse.ocl.utilities.Visitor;
32
import org.eclipse.ocl.utilities.Visitor;
40
33
Lines 63-69 Link Here
63
	 * @generated
56
	 * @generated
64
	 * @ordered
57
	 * @ordered
65
	 */
58
	 */
66
	protected static final Double REAL_SYMBOL_EDEFAULT = null;
59
	protected static final BigDecimal REAL_SYMBOL_EDEFAULT = null;
67
60
68
	/**
61
	/**
69
	 * The cached value of the '{@link #getRealSymbol() <em>Real Symbol</em>}' attribute.
62
	 * The cached value of the '{@link #getRealSymbol() <em>Real Symbol</em>}' attribute.
Lines 73-79 Link Here
73
	 * @generated
66
	 * @generated
74
	 * @ordered
67
	 * @ordered
75
	 */
68
	 */
76
	protected Double realSymbol = REAL_SYMBOL_EDEFAULT;
69
	protected BigDecimal realSymbol = REAL_SYMBOL_EDEFAULT;
77
70
78
	/**
71
	/**
79
	 * <!-- begin-user-doc -->
72
	 * <!-- begin-user-doc -->
Lines 106-125 Link Here
106
99
107
	/**
100
	/**
108
	 * <!-- begin-user-doc -->
101
	 * <!-- begin-user-doc -->
102
	 * @since 3.0
109
	 * <!-- end-user-doc -->
103
	 * <!-- end-user-doc -->
110
	 * @generated
104
	 * @generated
111
	 */
105
	 */
112
	public Double getRealSymbol() {
106
	public BigDecimal getRealSymbol() {
113
		return realSymbol;
107
		return realSymbol;
114
	}
108
	}
115
109
116
	/**
110
	/**
117
	 * <!-- begin-user-doc -->
111
	 * <!-- begin-user-doc -->
112
	 * @since 3.0
118
	 * <!-- end-user-doc -->
113
	 * <!-- end-user-doc -->
119
	 * @generated
114
	 * @generated
120
	 */
115
	 */
121
	public void setRealSymbol(Double newRealSymbol) {
116
	public void setRealSymbol(BigDecimal newRealSymbol) {
122
		Double oldRealSymbol = realSymbol;
117
		BigDecimal oldRealSymbol = realSymbol;
123
		realSymbol = newRealSymbol;
118
		realSymbol = newRealSymbol;
124
		if (eNotificationRequired())
119
		if (eNotificationRequired())
125
			eNotify(new ENotificationImpl(this, Notification.SET,
120
			eNotify(new ENotificationImpl(this, Notification.SET,
Lines 141-146 Link Here
141
	/**
136
	/**
142
	 * <!-- begin-user-doc -->
137
	 * <!-- begin-user-doc -->
143
	 * <!-- end-user-doc -->
138
	 * <!-- end-user-doc -->
139
	 * @generated NOT
140
	 */
141
	public void setRealSymbol(Double value) {
142
		setRealSymbol(new BigDecimal(value));
143
	}
144
145
	/**
146
	 * <!-- begin-user-doc -->
147
	 * <!-- end-user-doc -->
144
	 * @generated
148
	 * @generated
145
	 */
149
	 */
146
	@Override
150
	@Override
Lines 161-167 Link Here
161
	public void eSet(int featureID, Object newValue) {
165
	public void eSet(int featureID, Object newValue) {
162
		switch (featureID) {
166
		switch (featureID) {
163
			case EcorePackage.REAL_LITERAL_EXP__REAL_SYMBOL :
167
			case EcorePackage.REAL_LITERAL_EXP__REAL_SYMBOL :
164
				setRealSymbol((Double) newValue);
168
				setRealSymbol((BigDecimal) newValue);
165
				return;
169
				return;
166
		}
170
		}
167
		super.eSet(featureID, newValue);
171
		super.eSet(featureID, newValue);
(-)src/org/eclipse/ocl/ecore/impl/UnlimitedNaturalLiteralExpImpl.java (-30 / +62 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.ecore.impl;
18
package org.eclipse.ocl.ecore.impl;
19
19
20
import java.math.BigInteger;
20
import java.util.Map;
21
import java.util.Map;
21
22
22
import org.eclipse.emf.common.notify.Notification;
23
import org.eclipse.emf.common.notify.Notification;
Lines 45-51 Link Here
45
 * <p>
46
 * <p>
46
 * The following features are implemented:
47
 * The following features are implemented:
47
 * <ul>
48
 * <ul>
48
 *   <li>{@link org.eclipse.ocl.ecore.impl.UnlimitedNaturalLiteralExpImpl#getIntegerSymbol <em>Integer Symbol</em>}</li>
49
 *   <li>{@link org.eclipse.ocl.ecore.impl.UnlimitedNaturalLiteralExpImpl#getUnlimitedNaturalSymbol <em>Unlimited Natural Symbol</em>}</li>
49
 *   <li>{@link org.eclipse.ocl.ecore.impl.UnlimitedNaturalLiteralExpImpl#isUnlimited <em>Unlimited</em>}</li>
50
 *   <li>{@link org.eclipse.ocl.ecore.impl.UnlimitedNaturalLiteralExpImpl#isUnlimited <em>Unlimited</em>}</li>
50
 * </ul>
51
 * </ul>
51
 * </p>
52
 * </p>
Lines 57-80 Link Here
57
		implements UnlimitedNaturalLiteralExp {
58
		implements UnlimitedNaturalLiteralExp {
58
59
59
	/**
60
	/**
60
	 * The default value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
61
	 * The default value of the '{@link #getUnlimitedNaturalSymbol() <em>Unlimited Natural Symbol</em>}' attribute.
61
	 * <!-- begin-user-doc -->
62
	 * <!-- begin-user-doc -->
63
	 * @since 3.0
62
	 * <!-- end-user-doc -->
64
	 * <!-- end-user-doc -->
63
	 * @see #getIntegerSymbol()
65
	 * @see #getUnlimitedNaturalSymbol()
64
	 * @generated
66
	 * @generated
65
	 * @ordered
67
	 * @ordered
66
	 */
68
	 */
67
	protected static final Integer INTEGER_SYMBOL_EDEFAULT = null;
69
	protected static final BigInteger UNLIMITED_NATURAL_SYMBOL_EDEFAULT = null;
68
70
69
	/**
71
	/**
70
	 * The cached value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
72
	 * The cached value of the '{@link #getUnlimitedNaturalSymbol() <em>Unlimited Natural Symbol</em>}' attribute.
71
	 * <!-- begin-user-doc -->
73
	 * <!-- begin-user-doc -->
74
	 * @since 3.0
72
	 * <!-- end-user-doc -->
75
	 * <!-- end-user-doc -->
73
	 * @see #getIntegerSymbol()
76
	 * @see #getUnlimitedNaturalSymbol()
74
	 * @generated
77
	 * @generated
75
	 * @ordered
78
	 * @ordered
76
	 */
79
	 */
77
	protected Integer integerSymbol = INTEGER_SYMBOL_EDEFAULT;
80
	protected BigInteger unlimitedNaturalSymbol = UNLIMITED_NATURAL_SYMBOL_EDEFAULT;
78
81
79
	/**
82
	/**
80
	 * The default value of the '{@link #isUnlimited() <em>Unlimited</em>}' attribute.
83
	 * The default value of the '{@link #isUnlimited() <em>Unlimited</em>}' attribute.
Lines 107-140 Link Here
107
110
108
	/**
111
	/**
109
	 * <!-- begin-user-doc -->
112
	 * <!-- begin-user-doc -->
113
	 * @since 3.0
110
	 * <!-- end-user-doc -->
114
	 * <!-- end-user-doc -->
111
	 * @generated
115
	 * @generated
112
	 */
116
	 */
113
	public Integer getIntegerSymbol() {
117
	public BigInteger getUnlimitedNaturalSymbol() {
114
		return integerSymbol;
118
		return unlimitedNaturalSymbol;
115
	}
119
	}
116
120
117
	/**
121
	/**
118
	 * <!-- begin-user-doc -->
122
	 * <!-- begin-user-doc -->
123
	 * @since 3.0
119
	 * <!-- end-user-doc -->
124
	 * <!-- end-user-doc -->
120
	 * @generated
125
	 * @generated
121
	 */
126
	 */
122
	public void setIntegerSymbol(Integer newIntegerSymbol) {
127
	public void setUnlimitedNaturalSymbol(BigInteger newUnlimitedNaturalSymbol) {
123
		Integer oldIntegerSymbol = integerSymbol;
128
		BigInteger oldUnlimitedNaturalSymbol = unlimitedNaturalSymbol;
124
		integerSymbol = newIntegerSymbol;
129
		unlimitedNaturalSymbol = newUnlimitedNaturalSymbol;
125
		if (eNotificationRequired())
130
		if (eNotificationRequired())
126
			eNotify(new ENotificationImpl(this, Notification.SET,
131
			eNotify(new ENotificationImpl(
127
				EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL,
132
				this,
128
				oldIntegerSymbol, integerSymbol));
133
				Notification.SET,
134
				EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL,
135
				oldUnlimitedNaturalSymbol, unlimitedNaturalSymbol));
129
	}
136
	}
130
137
131
	/**
138
	/**
132
	 * <!-- begin-user-doc -->
139
	 * <!-- begin-user-doc -->
140
	 * @since 3.0
133
	 * <!-- end-user-doc -->
141
	 * <!-- end-user-doc -->
134
	 * @generated NOT
142
	 * @generated NOT
135
	 */
143
	 */
136
	public boolean isUnlimited() {
144
	public boolean isUnlimited() {
137
		return getIntegerSymbol() == UNLIMITED;
145
		return (unlimitedNaturalSymbol == null)
146
			|| (unlimitedNaturalSymbol == UNLIMITED);
138
	}
147
	}
139
148
140
	/**
149
	/**
Lines 150-163 Link Here
150
159
151
	/**
160
	/**
152
	 * <!-- begin-user-doc -->
161
	 * <!-- begin-user-doc -->
162
	 * @deprecated use setUnlimitedNaturalSymbol
163
	 * <!-- end-user-doc -->
164
	 * @generated
165
	 */
166
	public void setIntegerSymbol(Integer value) {
167
		// TODO: implement this method
168
		// Ensure that you remove @generated or mark it @generated NOT
169
		throw new UnsupportedOperationException();
170
	}
171
172
	/**
173
	 * <!-- begin-user-doc -->
174
	 * @since 3.0
175
	 * <!-- end-user-doc -->
176
	 * @generated NOT
177
	 */
178
	public void setUnlimitedNaturalSymbol(Integer value) {
179
		setUnlimitedNaturalSymbol(BigInteger.valueOf(value));
180
	}
181
182
	/**
183
	 * <!-- begin-user-doc -->
153
	 * <!-- end-user-doc -->
184
	 * <!-- end-user-doc -->
154
	 * @generated
185
	 * @generated
155
	 */
186
	 */
156
	@Override
187
	@Override
157
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
188
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
158
		switch (featureID) {
189
		switch (featureID) {
159
			case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
190
			case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
160
				return getIntegerSymbol();
191
				return getUnlimitedNaturalSymbol();
161
			case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
192
			case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
162
				return isUnlimited();
193
				return isUnlimited();
163
		}
194
		}
Lines 172-179 Link Here
172
	@Override
203
	@Override
173
	public void eSet(int featureID, Object newValue) {
204
	public void eSet(int featureID, Object newValue) {
174
		switch (featureID) {
205
		switch (featureID) {
175
			case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
206
			case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
176
				setIntegerSymbol((Integer) newValue);
207
				setUnlimitedNaturalSymbol((BigInteger) newValue);
177
				return;
208
				return;
178
		}
209
		}
179
		super.eSet(featureID, newValue);
210
		super.eSet(featureID, newValue);
Lines 187-194 Link Here
187
	@Override
218
	@Override
188
	public void eUnset(int featureID) {
219
	public void eUnset(int featureID) {
189
		switch (featureID) {
220
		switch (featureID) {
190
			case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
221
			case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
191
				setIntegerSymbol(INTEGER_SYMBOL_EDEFAULT);
222
				setUnlimitedNaturalSymbol(UNLIMITED_NATURAL_SYMBOL_EDEFAULT);
192
				return;
223
				return;
193
		}
224
		}
194
		super.eUnset(featureID);
225
		super.eUnset(featureID);
Lines 202-211 Link Here
202
	@Override
233
	@Override
203
	public boolean eIsSet(int featureID) {
234
	public boolean eIsSet(int featureID) {
204
		switch (featureID) {
235
		switch (featureID) {
205
			case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
236
			case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
206
				return INTEGER_SYMBOL_EDEFAULT == null
237
				return UNLIMITED_NATURAL_SYMBOL_EDEFAULT == null
207
					? integerSymbol != null
238
					? unlimitedNaturalSymbol != null
208
					: !INTEGER_SYMBOL_EDEFAULT.equals(integerSymbol);
239
					: !UNLIMITED_NATURAL_SYMBOL_EDEFAULT
240
						.equals(unlimitedNaturalSymbol);
209
			case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
241
			case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
210
				return isUnlimited() != UNLIMITED_EDEFAULT;
242
				return isUnlimited() != UNLIMITED_EDEFAULT;
211
		}
243
		}
Lines 221-228 Link Here
221
	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
253
	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
222
		if (baseClass == org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp.class) {
254
		if (baseClass == org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp.class) {
223
			switch (derivedFeatureID) {
255
			switch (derivedFeatureID) {
224
				case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
256
				case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
225
					return ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL;
257
					return ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL;
226
				case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
258
				case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
227
					return ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED;
259
					return ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED;
228
				default :
260
				default :
Lines 241-248 Link Here
241
	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
273
	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
242
		if (baseClass == org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp.class) {
274
		if (baseClass == org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp.class) {
243
			switch (baseFeatureID) {
275
			switch (baseFeatureID) {
244
				case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
276
				case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
245
					return EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL;
277
					return EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL;
246
				case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
278
				case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
247
					return EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED;
279
					return EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED;
248
				default :
280
				default :
(-)src/org/eclipse/ocl/ecore/internal/OCLStandardLibraryImpl.java (-2 / +4 lines)
Lines 18-23 Link Here
18
18
19
package org.eclipse.ocl.ecore.internal;
19
package org.eclipse.ocl.ecore.internal;
20
20
21
import java.math.BigDecimal;
22
import java.math.BigInteger;
21
import java.util.Collection;
23
import java.util.Collection;
22
import java.util.List;
24
import java.util.List;
23
25
Lines 321-328 Link Here
321
		
323
		
322
		OCL_BOOLEAN.setInstanceClass(Boolean.class);
324
		OCL_BOOLEAN.setInstanceClass(Boolean.class);
323
		OCL_STRING.setInstanceClass(String.class);
325
		OCL_STRING.setInstanceClass(String.class);
324
		OCL_INTEGER.setInstanceClass(Integer.class);
326
		OCL_INTEGER.setInstanceClass(BigInteger.class);
325
		OCL_REAL.setInstanceClass(Double.class);
327
		OCL_REAL.setInstanceClass(BigDecimal.class);
326
		
328
		
327
		register(OCL_ANY).getEOperations().addAll(
329
		register(OCL_ANY).getEOperations().addAll(
328
            OCLStandardLibraryUtil.createAnyTypeOperations(env));
330
            OCLStandardLibraryUtil.createAnyTypeOperations(env));
(-)src/org/eclipse/ocl/ecore/provider/UnlimitedNaturalLiteralExpItemProvider.java (-7 / +7 lines)
Lines 68-95 Link Here
68
		if (itemPropertyDescriptors == null) {
68
		if (itemPropertyDescriptors == null) {
69
			super.getPropertyDescriptors(object);
69
			super.getPropertyDescriptors(object);
70
70
71
			addIntegerSymbolPropertyDescriptor(object);
71
			addUnlimitedNaturalSymbolPropertyDescriptor(object);
72
			addUnlimitedPropertyDescriptor(object);
72
			addUnlimitedPropertyDescriptor(object);
73
		}
73
		}
74
		return itemPropertyDescriptors;
74
		return itemPropertyDescriptors;
75
	}
75
	}
76
76
77
	/**
77
	/**
78
	 * This adds a property descriptor for the Integer Symbol feature.
78
	 * This adds a property descriptor for the Unlimited Natural Symbol feature.
79
	 * <!-- begin-user-doc -->
79
	 * <!-- begin-user-doc -->
80
	 * <!-- end-user-doc -->
80
	 * <!-- end-user-doc -->
81
	 * @generated
81
	 * @generated
82
	 */
82
	 */
83
	protected void addIntegerSymbolPropertyDescriptor(Object object) {
83
	protected void addUnlimitedNaturalSymbolPropertyDescriptor(Object object) {
84
		itemPropertyDescriptors
84
		itemPropertyDescriptors
85
				.add(createItemPropertyDescriptor(
85
				.add(createItemPropertyDescriptor(
86
						((ComposeableAdapterFactory) adapterFactory)
86
						((ComposeableAdapterFactory) adapterFactory)
87
								.getRootAdapterFactory(),
87
								.getRootAdapterFactory(),
88
						getResourceLocator(),
88
						getResourceLocator(),
89
						getString("_UI_UnlimitedNaturalLiteralExp_integerSymbol_feature"), //$NON-NLS-1$
89
						getString("_UI_UnlimitedNaturalLiteralExp_unlimitedNaturalSymbol_feature"), //$NON-NLS-1$
90
						getString(
90
						getString(
91
								"_UI_PropertyDescriptor_description", "_UI_UnlimitedNaturalLiteralExp_integerSymbol_feature", "_UI_UnlimitedNaturalLiteralExp_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
91
								"_UI_PropertyDescriptor_description", "_UI_UnlimitedNaturalLiteralExp_unlimitedNaturalSymbol_feature", "_UI_UnlimitedNaturalLiteralExp_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
92
						ExpressionsPackage.Literals.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL,
92
						ExpressionsPackage.Literals.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL,
93
						true, false, false,
93
						true, false, false,
94
						ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
94
						ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
95
	}
95
	}
Lines 161-167 Link Here
161
		updateChildren(notification);
161
		updateChildren(notification);
162
162
163
		switch (notification.getFeatureID(UnlimitedNaturalLiteralExp.class)) {
163
		switch (notification.getFeatureID(UnlimitedNaturalLiteralExp.class)) {
164
		case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL:
164
		case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL:
165
		case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED:
165
		case EcorePackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED:
166
			fireNotifyChanged(new ViewerNotification(notification, notification
166
			fireNotifyChanged(new ViewerNotification(notification, notification
167
					.getNotifier(), false, true));
167
					.getNotifier(), false, true));
(-)src/org/eclipse/ocl/ecore/tests/CollectionsTest.java (-11 / +12 lines)
Lines 19-24 Link Here
19
19
20
package org.eclipse.ocl.ecore.tests;
20
package org.eclipse.ocl.ecore.tests;
21
21
22
import java.math.BigInteger;
22
import java.util.Arrays;
23
import java.util.Arrays;
23
import java.util.Collection;
24
import java.util.Collection;
24
import java.util.List;
25
import java.util.List;
Lines 867-904 Link Here
867
868
868
		try {
869
		try {
869
			Collection<?> result = (Collection<?>) evaluate(helper,
870
			Collection<?> result = (Collection<?>) evaluate(helper,
870
				new Integer(1), "Sequence{1 .. 10}");
871
				Integer.valueOf(1), "Sequence{1 .. 10}");
871
872
872
			for (int i = 1; i <= 10; i++) {
873
			for (int i = 1; i <= 10; i++) {
873
				assertTrue(result.contains(new Integer(i)));
874
				assertTrue(result.contains(BigInteger.valueOf(i)));
874
			}
875
			}
875
876
876
			result = (Collection<?>) evaluate(helper, new Integer(1),
877
			result = (Collection<?>) evaluate(helper, new Integer(1),
877
				"Sequence{1, (2+1)..(3+4), 10}");
878
				"Sequence{1, (2+1)..(3+4), 10}");
878
879
879
			assertTrue(result.contains(new Integer(1)));
880
			assertTrue(result.contains(BigInteger.valueOf(1)));
880
			for (int i = 3; i <= 7; i++) {
881
			for (int i = 3; i <= 7; i++) {
881
				assertTrue(result.contains(new Integer(i)));
882
				assertTrue(result.contains(BigInteger.valueOf(i)));
882
			}
883
			}
883
			assertTrue(result.contains(new Integer(10)));
884
			assertTrue(result.contains(BigInteger.valueOf(10)));
884
885
885
			// try the first expression without spaces (needed a grammar change)
886
			// try the first expression without spaces (needed a grammar change)
886
			result = (Collection<?>) evaluate(helper, new Integer(1),
887
			result = (Collection<?>) evaluate(helper, Integer.valueOf(1),
887
				"Sequence{1..10}");
888
				"Sequence{1..10}");
888
889
889
			for (int i = 1; i <= 10; i++) {
890
			for (int i = 1; i <= 10; i++) {
890
				assertTrue(result.contains(new Integer(i)));
891
				assertTrue(result.contains(BigInteger.valueOf(i)));
891
			}
892
			}
892
893
893
			// and a negation, too (the same grammar change)
894
			// and a negation, too (the same grammar change)
894
			result = (Collection<?>) evaluate(helper, new Integer(1),
895
			result = (Collection<?>) evaluate(helper, Integer.valueOf(1),
895
				"Sequence{-20, -10..-1, 1}");
896
				"Sequence{-20, -10..-1, 1}");
896
897
897
			assertTrue(result.contains(new Integer(-20)));
898
			assertTrue(result.contains(BigInteger.valueOf(-20)));
898
			for (int i = -10; i <= -1; i++) {
899
			for (int i = -10; i <= -1; i++) {
899
				assertTrue(result.contains(new Integer(i)));
900
				assertTrue(result.contains(BigInteger.valueOf(i)));
900
			}
901
			}
901
			assertTrue(result.contains(new Integer(1)));
902
			assertTrue(result.contains(BigInteger.valueOf(1)));
902
		} catch (Exception e) {
903
		} catch (Exception e) {
903
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
904
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
904
		}
905
		}
(-)src/org/eclipse/ocl/ecore/tests/ComparisonTest.java (-24 / +29 lines)
Lines 382-397 Link Here
382
		helper.setContext(thingType);
382
		helper.setContext(thingType);
383
		
383
		
384
		try {
384
		try {
385
			assertEquals(new Integer(1), evaluate(helper, thing, "3 - 2"));
385
			assertEquals(1, evaluate(helper, thing, "3 - 2"));
386
			assertEquals(new Integer(3), evaluate(helper, thing, "1 + 2"));
386
			assertEquals(3, evaluate(helper, thing, "1 + 2"));
387
			assertEquals(new Double(2.0), evaluate(helper, thing, "6 / 3"));
387
			assertEquals(2.0, evaluate(helper, thing, "6 / 3"));
388
			assertEquals(new Integer(6), evaluate(helper, thing, "2 * 3"));
388
			assertEquals(6, evaluate(helper, thing, "2 * 3"));
389
			assertEquals(new Integer(-1), evaluate(helper, thing, "- 1"));
389
			assertEquals(-1, evaluate(helper, thing, "- 1"));
390
			assertEquals(new Integer(3), evaluate(helper, thing, "(2 - 5).abs()"));
390
			assertEquals(3, evaluate(helper, thing, "(2 - 5).abs()"));
391
			assertEquals(new Integer(3), evaluate(helper, thing, "3.max(2)"));
391
			assertEquals(3, evaluate(helper, thing, "3.max(2)"));
392
			assertEquals(new Integer(2), evaluate(helper, thing, "3.min(2)"));
392
			assertEquals(2, evaluate(helper, thing, "3.min(2)"));
393
			assertEquals(new Integer(3), evaluate(helper, thing, "7.div(2)"));
393
			assertEquals(3, evaluate(helper, thing, "7.div(2)"));
394
			assertEquals(new Integer(1), evaluate(helper, thing, "7.mod(2)"));
394
			assertEquals(1, evaluate(helper, thing, "7.mod(2)"));
395
		} catch (Exception e) {
395
		} catch (Exception e) {
396
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
396
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
397
		}
397
		}
Lines 404-417 Link Here
404
		helper.setContext(thingType);
404
		helper.setContext(thingType);
405
		
405
		
406
		try {
406
		try {
407
			assertEquals(new Double(1.0), evaluate(helper, thing, "3.0 - 2.0"));
407
			assertEquals(1.0, evaluate(helper, thing, "3.0 - 2.0"));
408
			assertEquals(new Double(3.0), evaluate(helper, thing, "1.0 + 2.0"));
408
			assertEquals(3.0, evaluate(helper, thing, "1.0 + 2.0"));
409
			assertEquals(new Double(2.0), evaluate(helper, thing, "6.0 / 3.0"));
409
			assertEquals(2.0, evaluate(helper, thing, "6.0 / 3.0"));
410
			assertEquals(new Double(6.0), evaluate(helper, thing, "2.0 * 3.0"));
410
			assertEquals(6.0, evaluate(helper, thing, "2.0 * 3.0"));
411
			assertEquals(new Double(-1.0), evaluate(helper, thing, "- 1.0"));
411
			assertEquals(-1.0, evaluate(helper, thing, "- 1.0"));
412
			assertEquals(new Double(3.0), evaluate(helper, thing, "(2.0 - 5.0).abs()"));
412
			assertEquals(3.0, evaluate(helper, thing, "(2.0 - 5.0).abs()"));
413
			assertEquals(new Double(3.0), evaluate(helper, thing, "3.0.max(2.0)"));
413
			assertEquals(3.0, evaluate(helper, thing, "3.0.max(2.0)"));
414
			assertEquals(new Double(2.0), evaluate(helper, thing, "3.0.min(2.0)"));
414
			assertEquals(2.0, evaluate(helper, thing, "3.0.min(2.0)"));
415
		} catch (Exception e) {
415
		} catch (Exception e) {
416
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
416
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
417
		}
417
		}
Lines 425-436 Link Here
425
		helper.setContext(thingType);
425
		helper.setContext(thingType);
426
		
426
		
427
		try {
427
		try {
428
			assertEquals(new Double(1.0), evaluate(helper, thing, "3 - 2.0"));
428
			assertEquals(1.0, evaluate(helper, thing, "3 - 2.0"));
429
			assertEquals(new Double(3.0), evaluate(helper, thing, "1 + 2.0"));
429
			assertEquals(3.0, evaluate(helper, thing, "1 + 2.0"));
430
			assertEquals(new Double(2.0), evaluate(helper, thing, "6 / 3.0"));
430
			assertEquals(2.0, evaluate(helper, thing, "6 / 3.0"));
431
			assertEquals(new Double(6.0), evaluate(helper, thing, "2 * 3.0"));
431
			assertEquals(6.0, evaluate(helper, thing, "2 * 3.0"));
432
			assertEquals(new Double(3.0), evaluate(helper, thing, "3.max(2.0)"));
432
			assertEquals(3.0, evaluate(helper, thing, "3.max(2.0)"));
433
			assertEquals(new Double(2.0), evaluate(helper, thing, "3.min(2.0)"));
433
			assertEquals(2.0, evaluate(helper, thing, "3.min(2.0)"));
434
			assertEquals(2, evaluate(helper, thing, "2.oclAsType(Integer)"));
435
			assertEquals(2, evaluate(helper, thing, "2.0.oclAsType(Integer)"));
436
			assertInvalid(evaluate(helper, thing, "2.5.oclAsType(Integer)"));
437
			assertEquals(3.0, evaluate(helper, thing, "3.oclAsType(Real)"));
438
			assertEquals(3.0, evaluate(helper, thing, "3.0.oclAsType(Real)"));
434
		} catch (Exception e) {
439
		} catch (Exception e) {
435
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
440
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
436
		}
441
		}
(-)src/org/eclipse/ocl/ecore/tests/ExpressionsValidatorTest.java (-1 / +1 lines)
Lines 880-886 Link Here
880
	
880
	
881
	public void test_UnlimitedNaturalLiteralExp_checkNaturalType() {
881
	public void test_UnlimitedNaturalLiteralExp_checkNaturalType() {
882
		UnlimitedNaturalLiteralExp ul = factory.createUnlimitedNaturalLiteralExp();
882
		UnlimitedNaturalLiteralExp ul = factory.createUnlimitedNaturalLiteralExp();
883
		ul.setIntegerSymbol(42);
883
		ul.setUnlimitedNaturalSymbol(42);
884
		ul.setType(apple);
884
		ul.setType(apple);
885
		
885
		
886
		assertProblem(ul, ExpressionsValidator.UNLIMITED_NATURAL_LITERAL_EXP__NATURAL_TYPE);
886
		assertProblem(ul, ExpressionsValidator.UNLIMITED_NATURAL_LITERAL_EXP__NATURAL_TYPE);
(-)src/org/eclipse/ocl/ecore/tests/PrimitiveTypesTest.java (-1 / +2 lines)
Lines 65-71 Link Here
65
			.getUnlimitedNatural(), expression.getType());
65
			.getUnlimitedNatural(), expression.getType());
66
66
67
		Object result = evaluate(expression);
67
		Object result = evaluate(expression);
68
		assertEquals(UnlimitedNaturalLiteralExp.UNLIMITED, result);
68
		assertTrue(((UnlimitedNaturalLiteralExp<?>)result).isUnlimited());
69
	}
69
	}
70
70
71
	/**
71
	/**
Lines 149-154 Link Here
149
		helper.setContext(getOCLStandardLibrary().getUnlimitedNatural());
149
		helper.setContext(getOCLStandardLibrary().getUnlimitedNatural());
150
150
151
		try {
151
		try {
152
			assertInvalid(evaluate(helper, 1, "-*"));
152
			assertInvalid(evaluate(helper, 1, "*.round()"));
153
			assertInvalid(evaluate(helper, 1, "*.round()"));
153
			assertInvalid(evaluate(helper, 1, "*.floor()"));
154
			assertInvalid(evaluate(helper, 1, "*.floor()"));
154
			assertInvalid(evaluate(helper, 1, "*.abs()"));
155
			assertInvalid(evaluate(helper, 1, "*.abs()"));
(-)src/org/eclipse/ocl/ecore/tests/RegressionTest.java (-8 / +9 lines)
Lines 18-23 Link Here
18
18
19
package org.eclipse.ocl.ecore.tests;
19
package org.eclipse.ocl.ecore.tests;
20
20
21
import java.math.BigInteger;
21
import java.util.Collections;
22
import java.util.Collections;
22
import java.util.Iterator;
23
import java.util.Iterator;
23
import java.util.List;
24
import java.util.List;
Lines 1075-1089 Link Here
1075
		// got as many product tuples as required (2 x 3)
1076
		// got as many product tuples as required (2 x 3)
1076
		assertEquals(6, product.size());
1077
		assertEquals(6, product.size());
1077
		
1078
		
1078
		Map<String, Set<Integer>> expectedTuples =
1079
		Map<String, Set<BigInteger>> expectedTuples =
1079
			new java.util.HashMap<String, Set<Integer>>();
1080
			new java.util.HashMap<String, Set<BigInteger>>();
1080
		Set<Integer> values = new java.util.HashSet<Integer>();
1081
		Set<BigInteger> values = new java.util.HashSet<BigInteger>();
1081
		values.add(1);
1082
		values.add(BigInteger.valueOf(1));
1082
		values.add(2);
1083
		values.add(BigInteger.valueOf(2));
1083
		values.add(3);
1084
		values.add(BigInteger.valueOf(3));
1084
		
1085
		
1085
		expectedTuples.put("foo", new java.util.HashSet<Integer>(values));
1086
		expectedTuples.put("foo", new java.util.HashSet<BigInteger>(values));
1086
		expectedTuples.put("bar", new java.util.HashSet<Integer>(values));
1087
		expectedTuples.put("bar", new java.util.HashSet<BigInteger>(values));
1087
		
1088
		
1088
		for (Tuple<EOperation, EStructuralFeature> tuple : product) {
1089
		for (Tuple<EOperation, EStructuralFeature> tuple : product) {
1089
			values = expectedTuples.get(tuple.getValue("first"));
1090
			values = expectedTuples.get(tuple.getValue("first"));
(-)src/org/eclipse/ocl/ecore/tests/SerializationTest.java (+33 lines)
Lines 20-25 Link Here
20
20
21
import java.io.ByteArrayInputStream;
21
import java.io.ByteArrayInputStream;
22
import java.io.ByteArrayOutputStream;
22
import java.io.ByteArrayOutputStream;
23
import java.math.BigInteger;
23
import java.util.Collections;
24
import java.util.Collections;
24
import java.util.Iterator;
25
import java.util.Iterator;
25
import java.util.List;
26
import java.util.List;
Lines 94-99 Link Here
94
	}
95
	}
95
	
96
	
96
	/**
97
	/**
98
	 * Tests the serialization of an expression that uses OCL integer values.
99
	 */
100
	public void test_integerTypeSerialization() {
101
		OCLExpression<EClassifier> expr = parseExpression(
102
				EcorePackage.Literals.EPACKAGE,
103
				BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.valueOf(1)) + " > " + Long.MAX_VALUE + " - " + Integer.MAX_VALUE);
104
105
		String toStringForm = expr.toString();
106
		String serialForm = serialize(expr);
107
		
108
		expr = loadExpression(serialForm);
109
		validate(expr);  // ensure that it is structurally valid
110
		assertEquals(toStringForm, expr.toString());  // should "look" the same
111
	}
112
	
113
	/**
114
	 * Tests the serialization of an expression that uses OCL real values.
115
	 */
116
	public void test_realTypeSerialization() {
117
		OCLExpression<EClassifier> expr = parseExpression(
118
				EcorePackage.Literals.EPACKAGE,
119
				"12345678901234567890.123456789e44 > 1.234");
120
121
		String toStringForm = expr.toString();
122
		String serialForm = serialize(expr);
123
		
124
		expr = loadExpression(serialForm);
125
		validate(expr);  // ensure that it is structurally valid
126
		assertEquals(toStringForm, expr.toString());  // should "look" the same
127
	}
128
	
129
	/**
97
	 * Tests the serialization of an expression that uses collections of
130
	 * Tests the serialization of an expression that uses collections of
98
	 * primitive types.
131
	 * primitive types.
99
	 */
132
	 */
(-)plugin.properties (-1 / +1 lines)
Lines 116-122 Link Here
116
_UI_IfExp_thenExpression_feature = Then Expression
116
_UI_IfExp_thenExpression_feature = Then Expression
117
_UI_IfExp_elseExpression_feature = Else Expression
117
_UI_IfExp_elseExpression_feature = Else Expression
118
_UI_IntegerLiteralExp_integerSymbol_feature = Integer Symbol
118
_UI_IntegerLiteralExp_integerSymbol_feature = Integer Symbol
119
_UI_UnlimitedNaturalLiteralExp_integerSymbol_feature = Integer Symbol
119
_UI_UnlimitedNaturalLiteralExp_unlimitedNaturalSymbol_feature = Unlimited Natural Symbol
120
_UI_UnlimitedNaturalLiteralExp_unlimited_feature = Unlimited
120
_UI_UnlimitedNaturalLiteralExp_unlimited_feature = Unlimited
121
_UI_IterateExp_result_feature = Result
121
_UI_IterateExp_result_feature = Result
122
_UI_LoopExp_body_feature = Body
122
_UI_LoopExp_body_feature = Body
(-)src/org/eclipse/ocl/edit/OCLEditPlugin.java (-1 / +2 lines)
Lines 19-24 Link Here
19
import org.eclipse.emf.common.EMFPlugin;
19
import org.eclipse.emf.common.EMFPlugin;
20
20
21
import org.eclipse.emf.common.util.ResourceLocator;
21
import org.eclipse.emf.common.util.ResourceLocator;
22
import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
22
23
23
/**
24
/**
24
 * This is the central singleton for the OCL edit plugin.
25
 * This is the central singleton for the OCL edit plugin.
Lines 50-56 Link Here
50
	 * @generated
51
	 * @generated
51
	 */
52
	 */
52
	public OCLEditPlugin() {
53
	public OCLEditPlugin() {
53
		super(new ResourceLocator[] {});
54
		super(new ResourceLocator[] { EcoreEditPlugin.INSTANCE, });
54
	}
55
	}
55
56
56
	/**
57
	/**
(-)src/org/eclipse/ocl/expressions/provider/MessageExpItemProvider.java (+126 lines)
Lines 24-29 Link Here
24
24
25
import org.eclipse.emf.ecore.EStructuralFeature;
25
import org.eclipse.emf.ecore.EStructuralFeature;
26
26
27
import org.eclipse.emf.ecore.EcoreFactory;
28
import org.eclipse.emf.ecore.EcorePackage;
27
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
29
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
28
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
30
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
29
import org.eclipse.emf.edit.provider.IItemLabelProvider;
31
import org.eclipse.emf.edit.provider.IItemLabelProvider;
Lines 573-578 Link Here
573
				TypesFactory.eINSTANCE.createVoidType()));
575
				TypesFactory.eINSTANCE.createVoidType()));
574
576
575
		newChildDescriptors.add(createChildParameter(
577
		newChildDescriptors.add(createChildParameter(
578
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
579
				EcoreFactory.eINSTANCE.createEAttribute()));
580
581
		newChildDescriptors.add(createChildParameter(
582
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
583
				EcoreFactory.eINSTANCE.createEAnnotation()));
584
585
		newChildDescriptors.add(createChildParameter(
586
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
587
				EcoreFactory.eINSTANCE.createEClass()));
588
589
		newChildDescriptors.add(createChildParameter(
590
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
591
				EcoreFactory.eINSTANCE.createEDataType()));
592
593
		newChildDescriptors.add(createChildParameter(
594
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
595
				EcoreFactory.eINSTANCE.createEEnum()));
596
597
		newChildDescriptors.add(createChildParameter(
598
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
599
				EcoreFactory.eINSTANCE.createEEnumLiteral()));
600
601
		newChildDescriptors.add(createChildParameter(
602
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
603
				EcoreFactory.eINSTANCE.createEFactory()));
604
605
		newChildDescriptors.add(createChildParameter(
606
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
607
				EcoreFactory.eINSTANCE.createEObject()));
608
609
		newChildDescriptors.add(createChildParameter(
610
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
611
				EcoreFactory.eINSTANCE.createEOperation()));
612
613
		newChildDescriptors.add(createChildParameter(
614
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
615
				EcoreFactory.eINSTANCE.createEPackage()));
616
617
		newChildDescriptors.add(createChildParameter(
618
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
619
				EcoreFactory.eINSTANCE.createEParameter()));
620
621
		newChildDescriptors.add(createChildParameter(
622
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
623
				EcoreFactory.eINSTANCE.createEReference()));
624
625
		newChildDescriptors
626
				.add(createChildParameter(
627
						ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
628
						EcoreFactory.eINSTANCE
629
								.create(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY)));
630
631
		newChildDescriptors.add(createChildParameter(
632
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
633
				EcoreFactory.eINSTANCE.createEGenericType()));
634
635
		newChildDescriptors.add(createChildParameter(
636
				ExpressionsPackage.Literals.MESSAGE_EXP__CALLED_OPERATION,
637
				EcoreFactory.eINSTANCE.createETypeParameter()));
638
639
		newChildDescriptors.add(createChildParameter(
576
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
640
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
577
				ExpressionsFactory.eINSTANCE.createAssociationClassCallExp()));
641
				ExpressionsFactory.eINSTANCE.createAssociationClassCallExp()));
578
642
Lines 733-738 Link Here
733
		newChildDescriptors.add(createChildParameter(
797
		newChildDescriptors.add(createChildParameter(
734
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
798
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
735
				TypesFactory.eINSTANCE.createVoidType()));
799
				TypesFactory.eINSTANCE.createVoidType()));
800
801
		newChildDescriptors.add(createChildParameter(
802
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
803
				EcoreFactory.eINSTANCE.createEAttribute()));
804
805
		newChildDescriptors.add(createChildParameter(
806
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
807
				EcoreFactory.eINSTANCE.createEAnnotation()));
808
809
		newChildDescriptors.add(createChildParameter(
810
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
811
				EcoreFactory.eINSTANCE.createEClass()));
812
813
		newChildDescriptors.add(createChildParameter(
814
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
815
				EcoreFactory.eINSTANCE.createEDataType()));
816
817
		newChildDescriptors.add(createChildParameter(
818
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
819
				EcoreFactory.eINSTANCE.createEEnum()));
820
821
		newChildDescriptors.add(createChildParameter(
822
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
823
				EcoreFactory.eINSTANCE.createEEnumLiteral()));
824
825
		newChildDescriptors.add(createChildParameter(
826
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
827
				EcoreFactory.eINSTANCE.createEFactory()));
828
829
		newChildDescriptors.add(createChildParameter(
830
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
831
				EcoreFactory.eINSTANCE.createEObject()));
832
833
		newChildDescriptors.add(createChildParameter(
834
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
835
				EcoreFactory.eINSTANCE.createEOperation()));
836
837
		newChildDescriptors.add(createChildParameter(
838
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
839
				EcoreFactory.eINSTANCE.createEPackage()));
840
841
		newChildDescriptors.add(createChildParameter(
842
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
843
				EcoreFactory.eINSTANCE.createEParameter()));
844
845
		newChildDescriptors.add(createChildParameter(
846
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
847
				EcoreFactory.eINSTANCE.createEReference()));
848
849
		newChildDescriptors
850
				.add(createChildParameter(
851
						ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
852
						EcoreFactory.eINSTANCE
853
								.create(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY)));
854
855
		newChildDescriptors.add(createChildParameter(
856
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
857
				EcoreFactory.eINSTANCE.createEGenericType()));
858
859
		newChildDescriptors.add(createChildParameter(
860
				ExpressionsPackage.Literals.MESSAGE_EXP__SENT_SIGNAL,
861
				EcoreFactory.eINSTANCE.createETypeParameter()));
736
	}
862
	}
737
863
738
	/**
864
	/**
(-)src/org/eclipse/ocl/expressions/provider/TupleLiteralPartItemProvider.java (+64 lines)
Lines 26-31 Link Here
26
26
27
import org.eclipse.emf.ecore.EStructuralFeature;
27
import org.eclipse.emf.ecore.EStructuralFeature;
28
28
29
import org.eclipse.emf.ecore.EcoreFactory;
30
import org.eclipse.emf.ecore.EcorePackage;
29
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
31
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
30
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
32
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
31
import org.eclipse.emf.edit.provider.IItemLabelProvider;
33
import org.eclipse.emf.edit.provider.IItemLabelProvider;
Lines 524-529 Link Here
524
		newChildDescriptors.add(createChildParameter(
526
		newChildDescriptors.add(createChildParameter(
525
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
527
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
526
				TypesFactory.eINSTANCE.createVoidType()));
528
				TypesFactory.eINSTANCE.createVoidType()));
529
530
		newChildDescriptors.add(createChildParameter(
531
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
532
				EcoreFactory.eINSTANCE.createEAttribute()));
533
534
		newChildDescriptors.add(createChildParameter(
535
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
536
				EcoreFactory.eINSTANCE.createEAnnotation()));
537
538
		newChildDescriptors.add(createChildParameter(
539
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
540
				EcoreFactory.eINSTANCE.createEClass()));
541
542
		newChildDescriptors.add(createChildParameter(
543
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
544
				EcoreFactory.eINSTANCE.createEDataType()));
545
546
		newChildDescriptors.add(createChildParameter(
547
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
548
				EcoreFactory.eINSTANCE.createEEnum()));
549
550
		newChildDescriptors.add(createChildParameter(
551
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
552
				EcoreFactory.eINSTANCE.createEEnumLiteral()));
553
554
		newChildDescriptors.add(createChildParameter(
555
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
556
				EcoreFactory.eINSTANCE.createEFactory()));
557
558
		newChildDescriptors.add(createChildParameter(
559
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
560
				EcoreFactory.eINSTANCE.createEObject()));
561
562
		newChildDescriptors.add(createChildParameter(
563
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
564
				EcoreFactory.eINSTANCE.createEOperation()));
565
566
		newChildDescriptors.add(createChildParameter(
567
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
568
				EcoreFactory.eINSTANCE.createEPackage()));
569
570
		newChildDescriptors.add(createChildParameter(
571
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
572
				EcoreFactory.eINSTANCE.createEParameter()));
573
574
		newChildDescriptors.add(createChildParameter(
575
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
576
				EcoreFactory.eINSTANCE.createEReference()));
577
578
		newChildDescriptors
579
				.add(createChildParameter(
580
						ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
581
						EcoreFactory.eINSTANCE
582
								.create(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY)));
583
584
		newChildDescriptors.add(createChildParameter(
585
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
586
				EcoreFactory.eINSTANCE.createEGenericType()));
587
588
		newChildDescriptors.add(createChildParameter(
589
				ExpressionsPackage.Literals.TUPLE_LITERAL_PART__ATTRIBUTE,
590
				EcoreFactory.eINSTANCE.createETypeParameter()));
527
	}
591
	}
528
592
529
	/**
593
	/**
(-)src/org/eclipse/ocl/expressions/provider/UnlimitedNaturalLiteralExpItemProvider.java (-7 / +7 lines)
Lines 66-93 Link Here
66
		if (itemPropertyDescriptors == null) {
66
		if (itemPropertyDescriptors == null) {
67
			super.getPropertyDescriptors(object);
67
			super.getPropertyDescriptors(object);
68
68
69
			addIntegerSymbolPropertyDescriptor(object);
69
			addUnlimitedNaturalSymbolPropertyDescriptor(object);
70
			addUnlimitedPropertyDescriptor(object);
70
			addUnlimitedPropertyDescriptor(object);
71
		}
71
		}
72
		return itemPropertyDescriptors;
72
		return itemPropertyDescriptors;
73
	}
73
	}
74
74
75
	/**
75
	/**
76
	 * This adds a property descriptor for the Integer Symbol feature.
76
	 * This adds a property descriptor for the Unlimited Natural Symbol feature.
77
	 * <!-- begin-user-doc -->
77
	 * <!-- begin-user-doc -->
78
	 * <!-- end-user-doc -->
78
	 * <!-- end-user-doc -->
79
	 * @generated
79
	 * @generated
80
	 */
80
	 */
81
	protected void addIntegerSymbolPropertyDescriptor(Object object) {
81
	protected void addUnlimitedNaturalSymbolPropertyDescriptor(Object object) {
82
		itemPropertyDescriptors
82
		itemPropertyDescriptors
83
				.add(createItemPropertyDescriptor(
83
				.add(createItemPropertyDescriptor(
84
						((ComposeableAdapterFactory) adapterFactory)
84
						((ComposeableAdapterFactory) adapterFactory)
85
								.getRootAdapterFactory(),
85
								.getRootAdapterFactory(),
86
						getResourceLocator(),
86
						getResourceLocator(),
87
						getString("_UI_UnlimitedNaturalLiteralExp_integerSymbol_feature"), //$NON-NLS-1$
87
						getString("_UI_UnlimitedNaturalLiteralExp_unlimitedNaturalSymbol_feature"), //$NON-NLS-1$
88
						getString(
88
						getString(
89
								"_UI_PropertyDescriptor_description", "_UI_UnlimitedNaturalLiteralExp_integerSymbol_feature", "_UI_UnlimitedNaturalLiteralExp_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
89
								"_UI_PropertyDescriptor_description", "_UI_UnlimitedNaturalLiteralExp_unlimitedNaturalSymbol_feature", "_UI_UnlimitedNaturalLiteralExp_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
90
						ExpressionsPackage.Literals.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL,
90
						ExpressionsPackage.Literals.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL,
91
						true, false, false,
91
						true, false, false,
92
						ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
92
						ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
93
	}
93
	}
Lines 158-164 Link Here
158
		updateChildren(notification);
158
		updateChildren(notification);
159
159
160
		switch (notification.getFeatureID(UnlimitedNaturalLiteralExp.class)) {
160
		switch (notification.getFeatureID(UnlimitedNaturalLiteralExp.class)) {
161
		case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL:
161
		case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL:
162
		case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED:
162
		case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED:
163
			fireNotifyChanged(new ViewerNotification(notification, notification
163
			fireNotifyChanged(new ViewerNotification(notification, notification
164
					.getNotifier(), false, true));
164
					.getNotifier(), false, true));
(-)src/org/eclipse/ocl/tests/GenericIteratorsTest.java (-3 / +4 lines)
Lines 18-23 Link Here
18
18
19
package org.eclipse.ocl.tests;
19
package org.eclipse.ocl.tests;
20
20
21
import java.math.BigInteger;
21
import java.util.Arrays;
22
import java.util.Arrays;
22
import java.util.Collection;
23
import java.util.Collection;
23
import java.util.Collections;
24
import java.util.Collections;
Lines 550-558 Link Here
550
551
551
        // in the case of a null value, null is allowed in a collection, so
552
        // in the case of a null value, null is allowed in a collection, so
552
        // it does not result in invalid
553
        // it does not result in invalid
553
    	Set<Integer> e1 = Collections.singleton(new Integer(1));
554
    	Set<BigInteger> e1 = Collections.singleton(BigInteger.valueOf(1));
554
    	Set<Integer> e2 = null;
555
    	Set<BigInteger> e2 = null;
555
    	Set<Integer> e3 = Collections.singleton(new Integer(3));
556
    	Set<BigInteger> e3 = Collections.singleton(BigInteger.valueOf(3));
556
        @SuppressWarnings("unchecked")
557
        @SuppressWarnings("unchecked")
557
		Collection<? extends Object> expected = createBag(e1, e2, e3);
558
		Collection<? extends Object> expected = createBag(e1, e2, e3);
558
        assertQueryEquals(EcorePackage.eINSTANCE, expected,
559
        assertQueryEquals(EcorePackage.eINSTANCE, expected,
(-)src/org/eclipse/ocl/uml/UMLEvaluationEnvironment.java (-1 / +2 lines)
Lines 49-54 Link Here
49
import org.eclipse.ocl.uml.util.OCLUMLUtil;
49
import org.eclipse.ocl.uml.util.OCLUMLUtil;
50
import org.eclipse.ocl.util.CollectionUtil;
50
import org.eclipse.ocl.util.CollectionUtil;
51
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
51
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
52
import org.eclipse.ocl.util.ObjectUtil;
52
import org.eclipse.ocl.util.Tuple;
53
import org.eclipse.ocl.util.Tuple;
53
import org.eclipse.ocl.utilities.PredefinedType;
54
import org.eclipse.ocl.utilities.PredefinedType;
54
import org.eclipse.uml2.common.util.UML2Util;
55
import org.eclipse.uml2.common.util.UML2Util;
Lines 787-793 Link Here
787
788
788
            if (index >= 0) {
789
            if (index >= 0) {
789
                Object actualValue = getValue(slot);
790
                Object actualValue = getValue(slot);
790
791
                actualValue = ObjectUtil.normalise(actualValue);
791
                if (UML2Util.safeEquals(actualValue, values.get(index))) {
792
                if (UML2Util.safeEquals(actualValue, values.get(index))) {
792
                    found++;
793
                    found++;
793
                }
794
                }
(-)src/org/eclipse/ocl/uml/UMLPackage.java (-4 / +3 lines)
Lines 9617-9631 Link Here
9617
	int UNLIMITED_NATURAL_LITERAL_EXP__END_POSITION = NUMERIC_LITERAL_EXP__END_POSITION;
9617
	int UNLIMITED_NATURAL_LITERAL_EXP__END_POSITION = NUMERIC_LITERAL_EXP__END_POSITION;
9618
9618
9619
	/**
9619
	/**
9620
	 * The feature id for the '<em><b>Integer Symbol</b></em>' attribute.
9620
	 * The feature id for the '<em><b>Unlimited Natural Symbol</b></em>' attribute.
9621
	 * <!-- begin-user-doc -->
9621
	 * <!-- begin-user-doc -->
9622
	 * This value may change when the model code is regenerated.
9622
	 * @since 3.0
9623
	 * It is subject to change without notice.
9624
	 * <!-- end-user-doc -->
9623
	 * <!-- end-user-doc -->
9625
	 * @generated
9624
	 * @generated
9626
	 * @ordered
9625
	 * @ordered
9627
	 */
9626
	 */
9628
	int UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL = NUMERIC_LITERAL_EXP_FEATURE_COUNT + 0;
9627
	int UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL = NUMERIC_LITERAL_EXP_FEATURE_COUNT + 0;
9629
9628
9630
	/**
9629
	/**
9631
	 * The feature id for the '<em><b>Unlimited</b></em>' attribute.
9630
	 * The feature id for the '<em><b>Unlimited</b></em>' attribute.
(-)src/org/eclipse/ocl/uml/impl/IntegerLiteralExpImpl.java (-6 / +18 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.uml.impl;
18
package org.eclipse.ocl.uml.impl;
19
19
20
import java.math.BigInteger;
20
import java.util.Map;
21
import java.util.Map;
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
Lines 55-61 Link Here
55
	 * @generated
56
	 * @generated
56
	 * @ordered
57
	 * @ordered
57
	 */
58
	 */
58
	protected static final Integer INTEGER_SYMBOL_EDEFAULT = null;
59
	protected static final BigInteger INTEGER_SYMBOL_EDEFAULT = null;
59
60
60
	/**
61
	/**
61
	 * The cached value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
62
	 * The cached value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
Lines 65-71 Link Here
65
	 * @generated
66
	 * @generated
66
	 * @ordered
67
	 * @ordered
67
	 */
68
	 */
68
	protected Integer integerSymbol = INTEGER_SYMBOL_EDEFAULT;
69
	protected BigInteger integerSymbol = INTEGER_SYMBOL_EDEFAULT;
69
70
70
	/**
71
	/**
71
	 * <!-- begin-user-doc -->
72
	 * <!-- begin-user-doc -->
Lines 88-107 Link Here
88
89
89
	/**
90
	/**
90
	 * <!-- begin-user-doc -->
91
	 * <!-- begin-user-doc -->
92
	 * @since 3.0
91
	 * <!-- end-user-doc -->
93
	 * <!-- end-user-doc -->
92
	 * @generated
94
	 * @generated
93
	 */
95
	 */
94
	public Integer getIntegerSymbol() {
96
	public BigInteger getIntegerSymbol() {
95
		return integerSymbol;
97
		return integerSymbol;
96
	}
98
	}
97
99
98
	/**
100
	/**
99
	 * <!-- begin-user-doc -->
101
	 * <!-- begin-user-doc -->
102
	 * @since 3.0
100
	 * <!-- end-user-doc -->
103
	 * <!-- end-user-doc -->
101
	 * @generated
104
	 * @generated
102
	 */
105
	 */
103
	public void setIntegerSymbol(Integer newIntegerSymbol) {
106
	public void setIntegerSymbol(BigInteger newIntegerSymbol) {
104
		Integer oldIntegerSymbol = integerSymbol;
107
		BigInteger oldIntegerSymbol = integerSymbol;
105
		integerSymbol = newIntegerSymbol;
108
		integerSymbol = newIntegerSymbol;
106
		if (eNotificationRequired())
109
		if (eNotificationRequired())
107
			eNotify(new ENotificationImpl(this, Notification.SET,
110
			eNotify(new ENotificationImpl(this, Notification.SET,
Lines 123-128 Link Here
123
	/**
126
	/**
124
	 * <!-- begin-user-doc -->
127
	 * <!-- begin-user-doc -->
125
	 * <!-- end-user-doc -->
128
	 * <!-- end-user-doc -->
129
	 * @generated NOT
130
	 */
131
	public void setIntegerSymbol(Integer value) {
132
		setIntegerSymbol(BigInteger.valueOf(value));
133
	}
134
135
	/**
136
	 * <!-- begin-user-doc -->
137
	 * <!-- end-user-doc -->
126
	 * @generated
138
	 * @generated
127
	 */
139
	 */
128
	@Override
140
	@Override
Lines 143-149 Link Here
143
	public void eSet(int featureID, Object newValue) {
155
	public void eSet(int featureID, Object newValue) {
144
		switch (featureID) {
156
		switch (featureID) {
145
			case UMLPackage.INTEGER_LITERAL_EXP__INTEGER_SYMBOL :
157
			case UMLPackage.INTEGER_LITERAL_EXP__INTEGER_SYMBOL :
146
				setIntegerSymbol((Integer) newValue);
158
				setIntegerSymbol((BigInteger) newValue);
147
				return;
159
				return;
148
		}
160
		}
149
		super.eSet(featureID, newValue);
161
		super.eSet(featureID, newValue);
(-)src/org/eclipse/ocl/uml/impl/RealLiteralExpImpl.java (-6 / +19 lines)
Lines 17-23 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.uml.impl;
18
package org.eclipse.ocl.uml.impl;
19
19
20
import java.math.BigDecimal;
20
import java.util.Map;
21
import java.util.Map;
22
21
import org.eclipse.emf.common.notify.Notification;
23
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.ecore.EClass;
25
import org.eclipse.emf.ecore.EClass;
Lines 55-61 Link Here
55
	 * @generated
57
	 * @generated
56
	 * @ordered
58
	 * @ordered
57
	 */
59
	 */
58
	protected static final Double REAL_SYMBOL_EDEFAULT = null;
60
	protected static final BigDecimal REAL_SYMBOL_EDEFAULT = null;
59
61
60
	/**
62
	/**
61
	 * The cached value of the '{@link #getRealSymbol() <em>Real Symbol</em>}' attribute.
63
	 * The cached value of the '{@link #getRealSymbol() <em>Real Symbol</em>}' attribute.
Lines 65-71 Link Here
65
	 * @generated
67
	 * @generated
66
	 * @ordered
68
	 * @ordered
67
	 */
69
	 */
68
	protected Double realSymbol = REAL_SYMBOL_EDEFAULT;
70
	protected BigDecimal realSymbol = REAL_SYMBOL_EDEFAULT;
69
71
70
	/**
72
	/**
71
	 * <!-- begin-user-doc -->
73
	 * <!-- begin-user-doc -->
Lines 88-107 Link Here
88
90
89
	/**
91
	/**
90
	 * <!-- begin-user-doc -->
92
	 * <!-- begin-user-doc -->
93
	 * @since 3.0
91
	 * <!-- end-user-doc -->
94
	 * <!-- end-user-doc -->
92
	 * @generated
95
	 * @generated
93
	 */
96
	 */
94
	public Double getRealSymbol() {
97
	public BigDecimal getRealSymbol() {
95
		return realSymbol;
98
		return realSymbol;
96
	}
99
	}
97
100
98
	/**
101
	/**
99
	 * <!-- begin-user-doc -->
102
	 * <!-- begin-user-doc -->
103
	 * @since 3.0
100
	 * <!-- end-user-doc -->
104
	 * <!-- end-user-doc -->
101
	 * @generated
105
	 * @generated
102
	 */
106
	 */
103
	public void setRealSymbol(Double newRealSymbol) {
107
	public void setRealSymbol(BigDecimal newRealSymbol) {
104
		Double oldRealSymbol = realSymbol;
108
		BigDecimal oldRealSymbol = realSymbol;
105
		realSymbol = newRealSymbol;
109
		realSymbol = newRealSymbol;
106
		if (eNotificationRequired())
110
		if (eNotificationRequired())
107
			eNotify(new ENotificationImpl(this, Notification.SET,
111
			eNotify(new ENotificationImpl(this, Notification.SET,
Lines 123-128 Link Here
123
	/**
127
	/**
124
	 * <!-- begin-user-doc -->
128
	 * <!-- begin-user-doc -->
125
	 * <!-- end-user-doc -->
129
	 * <!-- end-user-doc -->
130
	 * @generated NOT
131
	 */
132
	public void setRealSymbol(Double value) {
133
		setRealSymbol(new BigDecimal(value));
134
	}
135
136
	/**
137
	 * <!-- begin-user-doc -->
138
	 * <!-- end-user-doc -->
126
	 * @generated
139
	 * @generated
127
	 */
140
	 */
128
	@Override
141
	@Override
Lines 143-149 Link Here
143
	public void eSet(int featureID, Object newValue) {
156
	public void eSet(int featureID, Object newValue) {
144
		switch (featureID) {
157
		switch (featureID) {
145
			case UMLPackage.REAL_LITERAL_EXP__REAL_SYMBOL :
158
			case UMLPackage.REAL_LITERAL_EXP__REAL_SYMBOL :
146
				setRealSymbol((Double) newValue);
159
				setRealSymbol((BigDecimal) newValue);
147
				return;
160
				return;
148
		}
161
		}
149
		super.eSet(featureID, newValue);
162
		super.eSet(featureID, newValue);
(-)src/org/eclipse/ocl/uml/impl/UnlimitedNaturalLiteralExpImpl.java (-30 / +59 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.uml.impl;
18
package org.eclipse.ocl.uml.impl;
19
19
20
import java.math.BigInteger;
20
import java.util.Map;
21
import java.util.Map;
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
Lines 36-42 Link Here
36
 * <p>
37
 * <p>
37
 * The following features are implemented:
38
 * The following features are implemented:
38
 * <ul>
39
 * <ul>
39
 *   <li>{@link org.eclipse.ocl.uml.impl.UnlimitedNaturalLiteralExpImpl#getIntegerSymbol <em>Integer Symbol</em>}</li>
40
 *   <li>{@link org.eclipse.ocl.uml.impl.UnlimitedNaturalLiteralExpImpl#getUnlimitedNaturalSymbol <em>Unlimited Natural Symbol</em>}</li>
40
 *   <li>{@link org.eclipse.ocl.uml.impl.UnlimitedNaturalLiteralExpImpl#isUnlimited <em>Unlimited</em>}</li>
41
 *   <li>{@link org.eclipse.ocl.uml.impl.UnlimitedNaturalLiteralExpImpl#isUnlimited <em>Unlimited</em>}</li>
41
 * </ul>
42
 * </ul>
42
 * </p>
43
 * </p>
Lines 49-72 Link Here
49
		implements UnlimitedNaturalLiteralExp {
50
		implements UnlimitedNaturalLiteralExp {
50
51
51
	/**
52
	/**
52
	 * The default value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
53
	 * The default value of the '{@link #getUnlimitedNaturalSymbol() <em>Unlimited Natural Symbol</em>}' attribute.
53
	 * <!-- begin-user-doc -->
54
	 * <!-- begin-user-doc -->
55
	 * @since 3.0
54
	 * <!-- end-user-doc -->
56
	 * <!-- end-user-doc -->
55
	 * @see #getIntegerSymbol()
57
	 * @see #getUnlimitedNaturalSymbol()
56
	 * @generated
58
	 * @generated
57
	 * @ordered
59
	 * @ordered
58
	 */
60
	 */
59
	protected static final Integer INTEGER_SYMBOL_EDEFAULT = null;
61
	protected static final BigInteger UNLIMITED_NATURAL_SYMBOL_EDEFAULT = null;
60
62
61
	/**
63
	/**
62
	 * The cached value of the '{@link #getIntegerSymbol() <em>Integer Symbol</em>}' attribute.
64
	 * The cached value of the '{@link #getUnlimitedNaturalSymbol() <em>Unlimited Natural Symbol</em>}' attribute.
63
	 * <!-- begin-user-doc -->
65
	 * <!-- begin-user-doc -->
66
	 * @since 3.0
64
	 * <!-- end-user-doc -->
67
	 * <!-- end-user-doc -->
65
	 * @see #getIntegerSymbol()
68
	 * @see #getUnlimitedNaturalSymbol()
66
	 * @generated
69
	 * @generated
67
	 * @ordered
70
	 * @ordered
68
	 */
71
	 */
69
	protected Integer integerSymbol = INTEGER_SYMBOL_EDEFAULT;
72
	protected BigInteger unlimitedNaturalSymbol = UNLIMITED_NATURAL_SYMBOL_EDEFAULT;
70
73
71
	/**
74
	/**
72
	 * The default value of the '{@link #isUnlimited() <em>Unlimited</em>}' attribute.
75
	 * The default value of the '{@link #isUnlimited() <em>Unlimited</em>}' attribute.
Lines 99-132 Link Here
99
102
100
	/**
103
	/**
101
	 * <!-- begin-user-doc -->
104
	 * <!-- begin-user-doc -->
105
	 * @since 3.0
102
	 * <!-- end-user-doc -->
106
	 * <!-- end-user-doc -->
103
	 * @generated
107
	 * @generated
104
	 */
108
	 */
105
	public Integer getIntegerSymbol() {
109
	public BigInteger getUnlimitedNaturalSymbol() {
106
		return integerSymbol;
110
		return unlimitedNaturalSymbol;
107
	}
111
	}
108
112
109
	/**
113
	/**
110
	 * <!-- begin-user-doc -->
114
	 * <!-- begin-user-doc -->
115
	 * @since 3.0
111
	 * <!-- end-user-doc -->
116
	 * <!-- end-user-doc -->
112
	 * @generated
117
	 * @generated
113
	 */
118
	 */
114
	public void setIntegerSymbol(Integer newIntegerSymbol) {
119
	public void setUnlimitedNaturalSymbol(BigInteger newUnlimitedNaturalSymbol) {
115
		Integer oldIntegerSymbol = integerSymbol;
120
		BigInteger oldUnlimitedNaturalSymbol = unlimitedNaturalSymbol;
116
		integerSymbol = newIntegerSymbol;
121
		unlimitedNaturalSymbol = newUnlimitedNaturalSymbol;
117
		if (eNotificationRequired())
122
		if (eNotificationRequired())
118
			eNotify(new ENotificationImpl(this, Notification.SET,
123
			eNotify(new ENotificationImpl(
119
				UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL,
124
				this,
120
				oldIntegerSymbol, integerSymbol));
125
				Notification.SET,
126
				UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL,
127
				oldUnlimitedNaturalSymbol, unlimitedNaturalSymbol));
121
	}
128
	}
122
129
123
	/**
130
	/**
124
	 * <!-- begin-user-doc -->
131
	 * <!-- begin-user-doc -->
132
	 * @since 3.0
125
	 * <!-- end-user-doc -->
133
	 * <!-- end-user-doc -->
126
	 * @generated NOT
134
	 * @generated NOT
127
	 */
135
	 */
128
	public boolean isUnlimited() {
136
	public boolean isUnlimited() {
129
		return getIntegerSymbol() == UNLIMITED;
137
		return (unlimitedNaturalSymbol == null)
138
			|| (unlimitedNaturalSymbol == UNLIMITED);
130
	}
139
	}
131
140
132
	/**
141
	/**
Lines 143-155 Link Here
143
	/**
152
	/**
144
	 * <!-- begin-user-doc -->
153
	 * <!-- begin-user-doc -->
145
	 * <!-- end-user-doc -->
154
	 * <!-- end-user-doc -->
155
	 * @generated NOT
156
	 */
157
	public void setIntegerSymbol(Integer value) {
158
		setUnlimitedNaturalSymbol(value);
159
	}
160
161
	/**
162
	 * <!-- begin-user-doc -->
163
	 * @since 3.0
164
	 * <!-- end-user-doc -->
165
	 * @generated NOT
166
	 */
167
	public void setUnlimitedNaturalSymbol(Integer value) {
168
		setUnlimitedNaturalSymbol(BigInteger.valueOf(value));
169
	}
170
171
	/**
172
	 * <!-- begin-user-doc -->
173
	 * <!-- end-user-doc -->
146
	 * @generated
174
	 * @generated
147
	 */
175
	 */
148
	@Override
176
	@Override
149
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
177
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
150
		switch (featureID) {
178
		switch (featureID) {
151
			case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
179
			case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
152
				return getIntegerSymbol();
180
				return getUnlimitedNaturalSymbol();
153
			case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
181
			case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
154
				return isUnlimited();
182
				return isUnlimited();
155
		}
183
		}
Lines 164-171 Link Here
164
	@Override
192
	@Override
165
	public void eSet(int featureID, Object newValue) {
193
	public void eSet(int featureID, Object newValue) {
166
		switch (featureID) {
194
		switch (featureID) {
167
			case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
195
			case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
168
				setIntegerSymbol((Integer) newValue);
196
				setUnlimitedNaturalSymbol((BigInteger) newValue);
169
				return;
197
				return;
170
		}
198
		}
171
		super.eSet(featureID, newValue);
199
		super.eSet(featureID, newValue);
Lines 179-186 Link Here
179
	@Override
207
	@Override
180
	public void eUnset(int featureID) {
208
	public void eUnset(int featureID) {
181
		switch (featureID) {
209
		switch (featureID) {
182
			case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
210
			case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
183
				setIntegerSymbol(INTEGER_SYMBOL_EDEFAULT);
211
				setUnlimitedNaturalSymbol(UNLIMITED_NATURAL_SYMBOL_EDEFAULT);
184
				return;
212
				return;
185
		}
213
		}
186
		super.eUnset(featureID);
214
		super.eUnset(featureID);
Lines 194-203 Link Here
194
	@Override
222
	@Override
195
	public boolean eIsSet(int featureID) {
223
	public boolean eIsSet(int featureID) {
196
		switch (featureID) {
224
		switch (featureID) {
197
			case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
225
			case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
198
				return INTEGER_SYMBOL_EDEFAULT == null
226
				return UNLIMITED_NATURAL_SYMBOL_EDEFAULT == null
199
					? integerSymbol != null
227
					? unlimitedNaturalSymbol != null
200
					: !INTEGER_SYMBOL_EDEFAULT.equals(integerSymbol);
228
					: !UNLIMITED_NATURAL_SYMBOL_EDEFAULT
229
						.equals(unlimitedNaturalSymbol);
201
			case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
230
			case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
202
				return isUnlimited() != UNLIMITED_EDEFAULT;
231
				return isUnlimited() != UNLIMITED_EDEFAULT;
203
		}
232
		}
Lines 213-220 Link Here
213
	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
242
	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
214
		if (baseClass == org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp.class) {
243
		if (baseClass == org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp.class) {
215
			switch (derivedFeatureID) {
244
			switch (derivedFeatureID) {
216
				case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
245
				case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
217
					return ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL;
246
					return ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL;
218
				case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
247
				case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
219
					return ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED;
248
					return ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED;
220
				default :
249
				default :
Lines 233-240 Link Here
233
	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
262
	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
234
		if (baseClass == org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp.class) {
263
		if (baseClass == org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp.class) {
235
			switch (baseFeatureID) {
264
			switch (baseFeatureID) {
236
				case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL :
265
				case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL :
237
					return UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL;
266
					return UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL;
238
				case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
267
				case ExpressionsPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED :
239
					return UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED;
268
					return UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED;
240
				default :
269
				default :
(-)src/org/eclipse/ocl/uml/provider/UnlimitedNaturalLiteralExpItemProvider.java (-7 / +7 lines)
Lines 68-95 Link Here
68
		if (itemPropertyDescriptors == null) {
68
		if (itemPropertyDescriptors == null) {
69
			super.getPropertyDescriptors(object);
69
			super.getPropertyDescriptors(object);
70
70
71
			addIntegerSymbolPropertyDescriptor(object);
71
			addUnlimitedNaturalSymbolPropertyDescriptor(object);
72
			addUnlimitedPropertyDescriptor(object);
72
			addUnlimitedPropertyDescriptor(object);
73
		}
73
		}
74
		return itemPropertyDescriptors;
74
		return itemPropertyDescriptors;
75
	}
75
	}
76
76
77
	/**
77
	/**
78
	 * This adds a property descriptor for the Integer Symbol feature.
78
	 * This adds a property descriptor for the Unlimited Natural Symbol feature.
79
	 * <!-- begin-user-doc -->
79
	 * <!-- begin-user-doc -->
80
	 * <!-- end-user-doc -->
80
	 * <!-- end-user-doc -->
81
	 * @generated
81
	 * @generated
82
	 */
82
	 */
83
	protected void addIntegerSymbolPropertyDescriptor(Object object) {
83
	protected void addUnlimitedNaturalSymbolPropertyDescriptor(Object object) {
84
		itemPropertyDescriptors
84
		itemPropertyDescriptors
85
				.add(createItemPropertyDescriptor(
85
				.add(createItemPropertyDescriptor(
86
						((ComposeableAdapterFactory) adapterFactory)
86
						((ComposeableAdapterFactory) adapterFactory)
87
								.getRootAdapterFactory(),
87
								.getRootAdapterFactory(),
88
						getResourceLocator(),
88
						getResourceLocator(),
89
						getString("_UI_UnlimitedNaturalLiteralExp_integerSymbol_feature"), //$NON-NLS-1$
89
						getString("_UI_UnlimitedNaturalLiteralExp_unlimitedNaturalSymbol_feature"), //$NON-NLS-1$
90
						getString(
90
						getString(
91
								"_UI_PropertyDescriptor_description", "_UI_UnlimitedNaturalLiteralExp_integerSymbol_feature", "_UI_UnlimitedNaturalLiteralExp_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
91
								"_UI_PropertyDescriptor_description", "_UI_UnlimitedNaturalLiteralExp_unlimitedNaturalSymbol_feature", "_UI_UnlimitedNaturalLiteralExp_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
92
						ExpressionsPackage.Literals.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL,
92
						ExpressionsPackage.Literals.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL,
93
						true, false, false,
93
						true, false, false,
94
						ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
94
						ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
95
	}
95
	}
Lines 161-167 Link Here
161
		updateChildren(notification);
161
		updateChildren(notification);
162
162
163
		switch (notification.getFeatureID(UnlimitedNaturalLiteralExp.class)) {
163
		switch (notification.getFeatureID(UnlimitedNaturalLiteralExp.class)) {
164
		case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__INTEGER_SYMBOL:
164
		case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED_NATURAL_SYMBOL:
165
		case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED:
165
		case UMLPackage.UNLIMITED_NATURAL_LITERAL_EXP__UNLIMITED:
166
			fireNotifyChanged(new ViewerNotification(notification, notification
166
			fireNotifyChanged(new ViewerNotification(notification, notification
167
					.getNotifier(), false, true));
167
					.getNotifier(), false, true));
(-)src/org/eclipse/ocl/uml/tests/CollectionsTest.java (-12 / +13 lines)
Lines 17-22 Link Here
17
17
18
package org.eclipse.ocl.uml.tests;
18
package org.eclipse.ocl.uml.tests;
19
19
20
import java.math.BigInteger;
20
import java.util.Arrays;
21
import java.util.Arrays;
21
import java.util.Collection;
22
import java.util.Collection;
22
import java.util.Collections;
23
import java.util.Collections;
Lines 686-723 Link Here
686
687
687
        try {
688
        try {
688
            Collection<?> result = (Collection<?>) evaluate(helper,
689
            Collection<?> result = (Collection<?>) evaluate(helper,
689
                new Integer(1), "Sequence{1 .. 10}");
690
            	Integer.valueOf(1), "Sequence{1 .. 10}");
690
691
691
            for (int i = 1; i <= 10; i++) {
692
            for (int i = 1; i <= 10; i++) {
692
                assertTrue(result.contains(new Integer(i)));
693
                assertTrue(result.contains(BigInteger.valueOf(i)));
693
            }
694
            }
694
695
695
            result = (Collection<?>) evaluate(helper, new Integer(1),
696
            result = (Collection<?>) evaluate(helper, Integer.valueOf(1),
696
                "Sequence{1, (2+1)..(3+4), 10}");
697
                "Sequence{1, (2+1)..(3+4), 10}");
697
698
698
            assertTrue(result.contains(new Integer(1)));
699
            assertTrue(result.contains(BigInteger.valueOf(1)));
699
            for (int i = 3; i <= 7; i++) {
700
            for (int i = 3; i <= 7; i++) {
700
                assertTrue(result.contains(new Integer(i)));
701
                assertTrue(result.contains(BigInteger.valueOf(i)));
701
            }
702
            }
702
            assertTrue(result.contains(new Integer(10)));
703
            assertTrue(result.contains(BigInteger.valueOf(10)));
703
704
704
            // try the first expression without spaces (needed a grammar change)
705
            // try the first expression without spaces (needed a grammar change)
705
            result = (Collection<?>) evaluate(helper, new Integer(1),
706
            result = (Collection<?>) evaluate(helper, Integer.valueOf(1),
706
                "Sequence{1..10}");
707
                "Sequence{1..10}");
707
708
708
            for (int i = 1; i <= 10; i++) {
709
            for (int i = 1; i <= 10; i++) {
709
                assertTrue(result.contains(new Integer(i)));
710
                assertTrue(result.contains(BigInteger.valueOf(i)));
710
            }
711
            }
711
712
712
            // and a negation, too (the same grammar change)
713
            // and a negation, too (the same grammar change)
713
            result = (Collection<?>) evaluate(helper, new Integer(1),
714
            result = (Collection<?>) evaluate(helper, Integer.valueOf(1),
714
                "Sequence{-20, -10..-1, 1}");
715
                "Sequence{-20, -10..-1, 1}");
715
716
716
            assertTrue(result.contains(new Integer(-20)));
717
            assertTrue(result.contains(BigInteger.valueOf(-20)));
717
            for (int i = -10; i <= -1; i++) {
718
            for (int i = -10; i <= -1; i++) {
718
                assertTrue(result.contains(new Integer(i)));
719
                assertTrue(result.contains(BigInteger.valueOf(i)));
719
            }
720
            }
720
            assertTrue(result.contains(new Integer(1)));
721
            assertTrue(result.contains(BigInteger.valueOf(1)));
721
        } catch (Exception e) {
722
        } catch (Exception e) {
722
            fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
723
            fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
723
        }
724
        }
(-)src/org/eclipse/ocl/uml/tests/ComparisonTest.java (-24 / +29 lines)
Lines 385-400 Link Here
385
		helper.setContext(thingType);
385
		helper.setContext(thingType);
386
		
386
		
387
		try {
387
		try {
388
			assertEquals(new Integer(1), evaluate(helper, thing, "3 - 2"));
388
			assertEquals(1, evaluate(helper, thing, "3 - 2"));
389
			assertEquals(new Integer(3), evaluate(helper, thing, "1 + 2"));
389
			assertEquals(3, evaluate(helper, thing, "1 + 2"));
390
			assertEquals(new Double(2.0), evaluate(helper, thing, "6 / 3"));
390
			assertEquals(2.0, evaluate(helper, thing, "6 / 3"));
391
			assertEquals(new Integer(6), evaluate(helper, thing, "2 * 3"));
391
			assertEquals(6, evaluate(helper, thing, "2 * 3"));
392
			assertEquals(new Integer(-1), evaluate(helper, thing, "- 1"));
392
			assertEquals(-1, evaluate(helper, thing, "- 1"));
393
			assertEquals(new Integer(3), evaluate(helper, thing, "(2 - 5).abs()"));
393
			assertEquals(3, evaluate(helper, thing, "(2 - 5).abs()"));
394
			assertEquals(new Integer(3), evaluate(helper, thing, "3.max(2)"));
394
			assertEquals(3, evaluate(helper, thing, "3.max(2)"));
395
			assertEquals(new Integer(2), evaluate(helper, thing, "3.min(2)"));
395
			assertEquals(2, evaluate(helper, thing, "3.min(2)"));
396
			assertEquals(new Integer(3), evaluate(helper, thing, "7.div(2)"));
396
			assertEquals(3, evaluate(helper, thing, "7.div(2)"));
397
			assertEquals(new Integer(1), evaluate(helper, thing, "7.mod(2)"));
397
			assertEquals(1, evaluate(helper, thing, "7.mod(2)"));
398
		} catch (Exception e) {
398
		} catch (Exception e) {
399
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
399
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
400
		}
400
		}
Lines 407-420 Link Here
407
		helper.setContext(thingType);
407
		helper.setContext(thingType);
408
		
408
		
409
		try {
409
		try {
410
			assertEquals(new Double(1.0), evaluate(helper, thing, "3.0 - 2.0"));
410
			assertEquals(1.0, evaluate(helper, thing, "3.0 - 2.0"));
411
			assertEquals(new Double(3.0), evaluate(helper, thing, "1.0 + 2.0"));
411
			assertEquals(3.0, evaluate(helper, thing, "1.0 + 2.0"));
412
			assertEquals(new Double(2.0), evaluate(helper, thing, "6.0 / 3.0"));
412
			assertEquals(2.0, evaluate(helper, thing, "6.0 / 3.0"));
413
			assertEquals(new Double(6.0), evaluate(helper, thing, "2.0 * 3.0"));
413
			assertEquals(6.0, evaluate(helper, thing, "2.0 * 3.0"));
414
			assertEquals(new Double(-1.0), evaluate(helper, thing, "- 1.0"));
414
			assertEquals(-1.0, evaluate(helper, thing, "- 1.0"));
415
			assertEquals(new Double(3.0), evaluate(helper, thing, "(2.0 - 5.0).abs()"));
415
			assertEquals(3.0, evaluate(helper, thing, "(2.0 - 5.0).abs()"));
416
			assertEquals(new Double(3.0), evaluate(helper, thing, "3.0.max(2.0)"));
416
			assertEquals(3.0, evaluate(helper, thing, "3.0.max(2.0)"));
417
			assertEquals(new Double(2.0), evaluate(helper, thing, "3.0.min(2.0)"));
417
			assertEquals(2.0, evaluate(helper, thing, "3.0.min(2.0)"));
418
		} catch (Exception e) {
418
		} catch (Exception e) {
419
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
419
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
420
		}
420
		}
Lines 428-439 Link Here
428
		helper.setContext(thingType);
428
		helper.setContext(thingType);
429
		
429
		
430
		try {
430
		try {
431
			assertEquals(new Double(1.0), evaluate(helper, thing, "3 - 2.0"));
431
			assertEquals(1.0, evaluate(helper, thing, "3 - 2.0"));
432
			assertEquals(new Double(3.0), evaluate(helper, thing, "1 + 2.0"));
432
			assertEquals(3.0, evaluate(helper, thing, "1 + 2.0"));
433
			assertEquals(new Double(2.0), evaluate(helper, thing, "6 / 3.0"));
433
			assertEquals(2.0, evaluate(helper, thing, "6 / 3.0"));
434
			assertEquals(new Double(6.0), evaluate(helper, thing, "2 * 3.0"));
434
			assertEquals(6.0, evaluate(helper, thing, "2 * 3.0"));
435
			assertEquals(new Double(3.0), evaluate(helper, thing, "3.max(2.0)"));
435
			assertEquals(3.0, evaluate(helper, thing, "3.max(2.0)"));
436
			assertEquals(new Double(2.0), evaluate(helper, thing, "3.min(2.0)"));
436
			assertEquals(2.0, evaluate(helper, thing, "3.min(2.0)"));
437
			assertEquals(2, evaluate(helper, thing, "2.oclAsType(Integer)"));
438
			assertEquals(2, evaluate(helper, thing, "2.0.oclAsType(Integer)"));
439
			assertInvalid(evaluate(helper, thing, "2.5.oclAsType(Integer)"));
440
			assertEquals(3.0, evaluate(helper, thing, "3.oclAsType(Real)"));
441
			assertEquals(3.0, evaluate(helper, thing, "3.0.oclAsType(Real)"));
437
		} catch (Exception e) {
442
		} catch (Exception e) {
438
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
443
			fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
439
		}
444
		}
(-)src/org/eclipse/ocl/uml/tests/ExpressionsValidatorTest.java (-1 / +1 lines)
Lines 849-855 Link Here
849
	
849
	
850
	public void test_UnlimitedNaturalLiteralExp_checkNaturalType() {
850
	public void test_UnlimitedNaturalLiteralExp_checkNaturalType() {
851
		UnlimitedNaturalLiteralExp ul = factory.createUnlimitedNaturalLiteralExp();
851
		UnlimitedNaturalLiteralExp ul = factory.createUnlimitedNaturalLiteralExp();
852
		ul.setIntegerSymbol(42);
852
		ul.setUnlimitedNaturalSymbol(42);
853
		ul.setType(apple);
853
		ul.setType(apple);
854
		
854
		
855
		assertProblem(ul, ExpressionsValidator.UNLIMITED_NATURAL_LITERAL_EXP__NATURAL_TYPE);
855
		assertProblem(ul, ExpressionsValidator.UNLIMITED_NATURAL_LITERAL_EXP__NATURAL_TYPE);
(-)src/org/eclipse/ocl/uml/tests/PrimitiveTypesTest.java (-1 / +2 lines)
Lines 57-63 Link Here
57
			.getUnlimitedNatural(), expression.getType());
57
			.getUnlimitedNatural(), expression.getType());
58
58
59
		Object result = evaluate(expression);
59
		Object result = evaluate(expression);
60
		assertEquals(UnlimitedNaturalLiteralExp.UNLIMITED, result);
60
		assertTrue(((UnlimitedNaturalLiteralExp<?>)result).isUnlimited());
61
	}
61
	}
62
62
63
	/**
63
	/**
Lines 141-146 Link Here
141
		helper.setContext(getOCLStandardLibrary().getUnlimitedNatural());
141
		helper.setContext(getOCLStandardLibrary().getUnlimitedNatural());
142
142
143
		try {
143
		try {
144
			assertInvalid(evaluate(helper, 1, "-*"));
144
			assertInvalid(evaluate(helper, 1, "*.round()"));
145
			assertInvalid(evaluate(helper, 1, "*.round()"));
145
			assertInvalid(evaluate(helper, 1, "*.floor()"));
146
			assertInvalid(evaluate(helper, 1, "*.floor()"));
146
			assertInvalid(evaluate(helper, 1, "*.abs()"));
147
			assertInvalid(evaluate(helper, 1, "*.abs()"));
(-)src/org/eclipse/ocl/uml/tests/RegressionTest.java (-8 / +9 lines)
Lines 18-23 Link Here
18
18
19
package org.eclipse.ocl.uml.tests;
19
package org.eclipse.ocl.uml.tests;
20
20
21
import java.math.BigInteger;
21
import java.util.Collections;
22
import java.util.Collections;
22
import java.util.List;
23
import java.util.List;
23
import java.util.Map;
24
import java.util.Map;
Lines 1015-1029 Link Here
1015
		// got as many product tuples as required (2 x 3)
1016
		// got as many product tuples as required (2 x 3)
1016
		assertEquals(6, product.size());
1017
		assertEquals(6, product.size());
1017
		
1018
		
1018
		Map<String, Set<Integer>> expectedTuples =
1019
		Map<String, Set<BigInteger>> expectedTuples =
1019
			new java.util.HashMap<String, Set<Integer>>();
1020
			new java.util.HashMap<String, Set<BigInteger>>();
1020
		Set<Integer> values = new java.util.HashSet<Integer>();
1021
		Set<BigInteger> values = new java.util.HashSet<BigInteger>();
1021
		values.add(1);
1022
		values.add(BigInteger.valueOf(1));
1022
		values.add(2);
1023
		values.add(BigInteger.valueOf(2));
1023
		values.add(3);
1024
		values.add(BigInteger.valueOf(3));
1024
		
1025
		
1025
		expectedTuples.put("foo", new java.util.HashSet<Integer>(values));
1026
		expectedTuples.put("foo", new java.util.HashSet<BigInteger>(values));
1026
		expectedTuples.put("bar", new java.util.HashSet<Integer>(values));
1027
		expectedTuples.put("bar", new java.util.HashSet<BigInteger>(values));
1027
		
1028
		
1028
		for (Tuple<Operation, Property> tuple : product) {
1029
		for (Tuple<Operation, Property> tuple : product) {
1029
			values = expectedTuples.get(tuple.getValue("first"));
1030
			values = expectedTuples.get(tuple.getValue("first"));
(-)src/org/eclipse/ocl/uml/tests/SerializationTest.java (+33 lines)
Lines 20-25 Link Here
20
20
21
import java.io.ByteArrayInputStream;
21
import java.io.ByteArrayInputStream;
22
import java.io.ByteArrayOutputStream;
22
import java.io.ByteArrayOutputStream;
23
import java.math.BigInteger;
23
import java.util.Collections;
24
import java.util.Collections;
24
import java.util.Iterator;
25
import java.util.Iterator;
25
import java.util.List;
26
import java.util.List;
Lines 92-97 Link Here
92
	}
93
	}
93
	
94
	
94
	/**
95
	/**
96
	 * Tests the serialization of an expression that uses OCL integer values.
97
	 */
98
	public void test_integerTypeSerialization() {
99
		OCLExpression<Classifier> expr = parseExpression(
100
				getMetaclass("Package"),
101
				BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.valueOf(1)) + " > " + Long.MAX_VALUE + " - " + Integer.MAX_VALUE);
102
103
		String toStringForm = expr.toString();
104
		String serialForm = serialize(expr);
105
		
106
		expr = loadExpression(serialForm);
107
		validate(expr);  // ensure that it is structurally valid
108
		assertEquals(toStringForm, expr.toString());  // should "look" the same
109
	}
110
	
111
	/**
112
	 * Tests the serialization of an expression that uses OCL real values.
113
	 */
114
	public void test_realTypeSerialization() {
115
		OCLExpression<Classifier> expr = parseExpression(
116
				getMetaclass("Package"),
117
				"12345678901234567890.123456789e44 > 1.234");
118
119
		String toStringForm = expr.toString();
120
		String serialForm = serialize(expr);
121
		
122
		expr = loadExpression(serialForm);
123
		validate(expr);  // ensure that it is structurally valid
124
		assertEquals(toStringForm, expr.toString());  // should "look" the same
125
	}
126
	
127
	/**
95
	 * Tests the serialization of an expression that uses collections of
128
	 * Tests the serialization of an expression that uses collections of
96
	 * primitive types.
129
	 * primitive types.
97
	 */
130
	 */

Return to bug 290605