Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-10-09 12:45:06 +0000
committerEd Willink2016-10-30 11:37:17 +0000
commit42d12406c8517a62affc454fea29d6106b604d89 (patch)
tree31d077eaabc2103d2369713b89fbe905a564fc60 /plugins
parent1202cf4479dc5f2575608cba34d8236c9ed77d38 (diff)
downloadorg.eclipse.qvtd-42d12406c8517a62affc454fea29d6106b604d89.tar.gz
org.eclipse.qvtd-42d12406c8517a62affc454fea29d6106b604d89.tar.xz
org.eclipse.qvtd-42d12406c8517a62affc454fea29d6106b604d89.zip
[500962] Default interval is the first interval
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractInvocationManager.java2
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/InvocationManager.java1
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIntervalInternal.java1
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractInvocationManagerInternal.java28
4 files changed, 26 insertions, 6 deletions
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractInvocationManager.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractInvocationManager.java
index b3de231cc..75c302904 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractInvocationManager.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractInvocationManager.java
@@ -17,8 +17,6 @@ import org.eclipse.jdt.annotation.NonNull;
*/
public abstract class AbstractInvocationManager implements InvocationManager
{
- protected final boolean debugInvocations = AbstractTransformer.INVOCATIONS.isActive();
-
@Override
public <R> R accept(@NonNull ExecutionVisitor<R> visitor) {
return visitor.visitInvocationManager(this);
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/InvocationManager.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/InvocationManager.java
index 7ff9046c4..91995113b 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/InvocationManager.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/InvocationManager.java
@@ -21,6 +21,7 @@ import org.eclipse.jdt.annotation.NonNull;
*/
public interface InvocationManager extends ExecutionVisitable
{
+ @NonNull Interval createInterval();
boolean flush();
@NonNull Interval getDefaultInterval();
}
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIntervalInternal.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIntervalInternal.java
index 3b3c35287..48a84f48e 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIntervalInternal.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIntervalInternal.java
@@ -108,7 +108,6 @@ public abstract class AbstractIntervalInternal extends ConnectionLinkage impleme
}
}
-
@Override
public int getIndex() {
return intervalIndex;
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractInvocationManagerInternal.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractInvocationManagerInternal.java
index 1714fe31c..7b071490b 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractInvocationManagerInternal.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractInvocationManagerInternal.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.qvtd.runtime.internal.evaluation;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.qvtd.runtime.evaluation.AbstractInvocationManager;
import org.eclipse.qvtd.runtime.evaluation.Interval;
@@ -19,15 +22,34 @@ import org.eclipse.qvtd.runtime.evaluation.Interval;
*/
public class AbstractInvocationManagerInternal extends AbstractInvocationManager
{
- private final @NonNull Interval interval = new AbstractIntervalInternal(this, 0) {};
+ /**
+ * The distinct intervals of the schedule. Wherever possible work for earlier intervals is completed before that
+ * for later intervals.
+ */
+ private final @NonNull List<@NonNull Interval> intervals = new ArrayList<>();
+
+
+ private /*@LazyNonNull*/ Interval defaultInterval = null;
+
+ @Override
+ public @NonNull Interval createInterval() {
+ assert defaultInterval == null;
+ Interval interval = new AbstractIntervalInternal(this, intervals.size()) {};
+ intervals.add(interval);
+ return interval;
+ }
@Override
public boolean flush() {
- return interval.flush();
+ return getDefaultInterval().flush();
}
@Override
public @NonNull Interval getDefaultInterval() {
- return interval;
+ Interval defaultInterval2 = defaultInterval;
+ if (defaultInterval2 == null) {
+ defaultInterval2 = defaultInterval = createInterval();
+ }
+ return defaultInterval2;
}
} \ No newline at end of file

Back to the top