Commit 024057fa authored by Daniel Lehmberg's avatar Daniel Lehmberg

cleaner ABC: subclasses have to throw themselves an Unupported Exception (like for getShape)

parent a9caddb3
Pipeline #60317 passed with stage
in 50 seconds
...@@ -8,9 +8,7 @@ public abstract class ScenarioElement { ...@@ -8,9 +8,7 @@ public abstract class ScenarioElement {
public abstract VShape getShape(); public abstract VShape getShape();
public void setShape(VShape newShape) { public abstract void setShape(VShape newShape);
throw new UnsupportedOperationException("This concrete scenario element does not support setting the shape.");
}
public abstract int getId(); public abstract int getId();
......
...@@ -28,6 +28,11 @@ public class Teleporter extends ScenarioElement { ...@@ -28,6 +28,11 @@ public class Teleporter extends ScenarioElement {
throw new UnsupportedOperationException("A teleporter does not have a shape."); throw new UnsupportedOperationException("A teleporter does not have a shape.");
} }
@Override
public void setShape(VShape newShape) {
throw new UnsupportedOperationException("A teleporter does not have a shape.");
}
@Override @Override
public int getId() { public int getId() {
return -1; return -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment