From 05ec409ce96da92d430c4a8e58b08d46f42d667a Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Fri, 5 Jun 2015 17:30:46 +1000 Subject: More work on the stateful checker; still not perfect, but it's getting better --- .../zancanaro/javacheck/statem/CommandValue.java | 60 ---------------------- 1 file changed, 60 deletions(-) delete mode 100644 src/main/java/au/id/zancanaro/javacheck/statem/CommandValue.java (limited to 'src/main/java/au/id/zancanaro/javacheck/statem/CommandValue.java') diff --git a/src/main/java/au/id/zancanaro/javacheck/statem/CommandValue.java b/src/main/java/au/id/zancanaro/javacheck/statem/CommandValue.java deleted file mode 100644 index 0a1fb61..0000000 --- a/src/main/java/au/id/zancanaro/javacheck/statem/CommandValue.java +++ /dev/null @@ -1,60 +0,0 @@ -package au.id.zancanaro.javacheck.statem; - -import java.util.Map; -import java.util.NoSuchElementException; - -public abstract class CommandValue { - private final int id; - - public CommandValue(int id) { - this.id = id; - } - - public abstract boolean isAbstract(); - - public abstract T get(); - - public int getId() { - return id; - } - - static class AbstractValue extends CommandValue { - public AbstractValue(int id) { - super(id); - } - - @Override - public boolean isAbstract() { - return true; - } - - @Override - public T get() { - throw new NoSuchElementException("Abstract values cannot be supplied"); - } - } - - static class ConcreteValue extends CommandValue { - private final Map values; - - public ConcreteValue(int id, Map values) { - super(id); - this.values = values; - } - - @Override - public boolean isAbstract() { - return true; - } - - @Override - @SuppressWarnings("unchecked") - public T get() { - if (values.containsKey(getId())) { - return (T) values.get(getId()); - } else { - throw new NoSuchElementException("Concrete values cannot be supplied prior to being calculated"); - } - } - } -} -- cgit v1.2.3