From 50603f1e701fdefb93b73b7cb99e37747418e133 Mon Sep 17 00:00:00 2001 From: lukas-heiligenbrunner Date: Mon, 13 Apr 2020 14:36:06 +0200 Subject: [PATCH] added some final prefixes --- eu.heili/AndGate.java | 4 ++-- eu.heili/DigitalInput.java | 6 +++--- eu.heili/LogicGate.java | 8 ++++---- eu.heili/OrGate.java | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/eu.heili/AndGate.java b/eu.heili/AndGate.java index 63c0b7c..1fc995b 100644 --- a/eu.heili/AndGate.java +++ b/eu.heili/AndGate.java @@ -1,11 +1,11 @@ public class AndGate extends LogicGate { - public AndGate(int inputnr) { + public AndGate(final int inputnr) { super(inputnr); if (inputnr > 8) throw (new TooManyInputsException()); } - public AndGate(DigitalInput... inputvals) { + public AndGate(final DigitalInput... inputvals) { super(inputvals); } diff --git a/eu.heili/DigitalInput.java b/eu.heili/DigitalInput.java index 133b207..a7ff6c0 100644 --- a/eu.heili/DigitalInput.java +++ b/eu.heili/DigitalInput.java @@ -1,7 +1,7 @@ public class DigitalInput { private boolean value = false; - public DigitalInput(boolean value) { + public DigitalInput(final boolean value) { setValue(value); } @@ -9,11 +9,11 @@ public class DigitalInput { setValue(gate); } - public DigitalInput(int value) { + public DigitalInput(final int value) { setValue(value); } - public DigitalInput(char value) { + public DigitalInput(final char value) { setValue(value); } diff --git a/eu.heili/LogicGate.java b/eu.heili/LogicGate.java index 5f915f5..4e1f1e3 100644 --- a/eu.heili/LogicGate.java +++ b/eu.heili/LogicGate.java @@ -4,13 +4,13 @@ import java.util.Arrays; public abstract class LogicGate { private final ArrayList inputs = new ArrayList<>(); - public LogicGate(int inputnr) { + public LogicGate(final int inputnr) { for (int i = 0; i < inputnr; i++) { inputs.add(new DigitalInput()); // generate new objects for new inputs } } - public LogicGate(DigitalInput... inputvals) { + public LogicGate(final DigitalInput... inputvals) { inputs.addAll(Arrays.asList(inputvals)); } @@ -21,7 +21,7 @@ public abstract class LogicGate { */ public abstract boolean getOutput(); - public DigitalInput getInput(int nr) { + public DigitalInput getInput(final int nr) { if (nr >= getInputNumber()) throw (new InputOutOfBoundsException()); return inputs.get(nr); @@ -31,7 +31,7 @@ public abstract class LogicGate { return inputs.size(); } - public void addInput(DigitalInput in) { + public void addInput(final DigitalInput in) { inputs.add(in); } } diff --git a/eu.heili/OrGate.java b/eu.heili/OrGate.java index f21f0a6..c3b60d5 100644 --- a/eu.heili/OrGate.java +++ b/eu.heili/OrGate.java @@ -1,9 +1,9 @@ public class OrGate extends LogicGate { - public OrGate(int inputnr) { + public OrGate(final int inputnr) { super(inputnr); } - public OrGate(DigitalInput... inputvals) { + public OrGate(final DigitalInput... inputvals) { super(inputvals); }