|
26 | 26 | public class Locus extends org.modeldriven.fuml.FumlObject { |
27 | 27 |
|
28 | 28 | public String identifier = Integer.toHexString(this.hashCode()); |
29 | | - public int nextValueId = 1; |
30 | 29 | public fUML.Semantics.Loci.LociL1.Executor executor = null; |
31 | 30 | public fUML.Semantics.Loci.LociL1.ExecutionFactory factory = null; |
32 | 31 | public fUML.Semantics.Classes.Kernel.ExtensionalValueList extensionalValues = new fUML.Semantics.Classes.Kernel.ExtensionalValueList(); |
@@ -76,13 +75,21 @@ public void add(fUML.Semantics.Classes.Kernel.ExtensionalValue value) { |
76 | 75 | // Add the given extensional value to this locus |
77 | 76 |
|
78 | 77 | value.locus = this; |
| 78 | + value.identifier = this.identifier + "#" + this.makeIdentifier(value); |
79 | 79 | this.extensionalValues.addValue(value); |
80 | 80 |
|
81 | | - IntegerValue integerValue = new IntegerValue(); |
82 | | - integerValue.value = this.nextValueId; |
83 | | - value.identifier = this.identifier + "#" + integerValue.toString(); |
84 | | - this.nextValueId = this.nextValueId + 1; |
85 | 81 | } // add |
| 82 | + |
| 83 | + public String makeIdentifier(fUML.Semantics.Classes.Kernel.ExtensionalValue value) { |
| 84 | + // Return an identifier for the given (newly created) extensional value. |
| 85 | + |
| 86 | + // [No normative specification. A conforming implementation may create an identifier |
| 87 | + // an identifier in any way such that all identifiers for extensional values created |
| 88 | + // at any one locus are unique.] |
| 89 | + |
| 90 | + // Non-normative Java implementation |
| 91 | + return Integer.toHexString(value.hashCode()); |
| 92 | + } // makeIdentifier |
86 | 93 |
|
87 | 94 | public void remove(fUML.Semantics.Classes.Kernel.ExtensionalValue value) { |
88 | 95 | // Remove the given extensional value from this locus. |
|
0 commit comments