added lots of final statements

This commit is contained in:
lukas-heiligenbrunner 2020-04-14 11:29:26 +02:00
parent 8682ec5007
commit 2838795f32
7 changed files with 14 additions and 14 deletions

View File

@ -5,7 +5,7 @@ public class DigitalInput {
setValue(value); setValue(value);
} }
public DigitalInput(LogicGate gate) { public DigitalInput(final LogicGate gate) {
setValue(gate); setValue(gate);
} }

View File

@ -1,9 +1,9 @@
public class EnxorGate extends ExorGate { public class EnxorGate extends ExorGate {
public EnxorGate(int inputnr) { public EnxorGate(final int inputnr) {
super(inputnr); super(inputnr);
} }
public EnxorGate(DigitalInput... inputvals) { public EnxorGate(final DigitalInput... inputvals) {
super(inputvals); super(inputvals);
} }

View File

@ -1,11 +1,11 @@
public class ExorGate extends LogicGate { public class ExorGate extends LogicGate {
public ExorGate(int inputnr) { public ExorGate(final int inputnr) {
super(inputnr); super(inputnr);
if (inputnr > 2) if (inputnr > 2)
throw (new TooManyInputsException()); throw (new TooManyInputsException());
} }
public ExorGate(DigitalInput... inputvals) { public ExorGate(final DigitalInput... inputvals) {
super(inputvals); super(inputvals);
if (inputvals.length > 2) if (inputvals.length > 2)
throw (new TooManyInputsException()); throw (new TooManyInputsException());

View File

@ -35,8 +35,8 @@ public class Main {
/** bsp 1 **/ /** bsp 1 **/
boolean x = false; final boolean x = false;
boolean y = true; final boolean y = true;
LogicGate s = new OrGate( LogicGate s = new OrGate(
new DigitalInput(new AndGate( new DigitalInput(new AndGate(
@ -62,8 +62,8 @@ public class Main {
System.out.println("output of s: " + s.getOutput()); System.out.println("output of s: " + s.getOutput());
/** bsp. 2 **/ /** bsp. 2 **/
boolean xx = true; final boolean xx = true;
boolean yy = false; final boolean yy = false;
LogicGate ss = new ExorGate( LogicGate ss = new ExorGate(
new DigitalInput(xx), new DigitalInput(xx),

View File

@ -1,9 +1,9 @@
public class NandGate extends AndGate { public class NandGate extends AndGate {
public NandGate(int inputnr) { public NandGate(final int inputnr) {
super(inputnr); super(inputnr);
} }
public NandGate(DigitalInput... inputvals) { public NandGate(final DigitalInput... inputvals) {
super(inputvals); super(inputvals);
} }

View File

@ -1,9 +1,9 @@
public class NorGate extends OrGate { public class NorGate extends OrGate {
public NorGate(int inputnr) { public NorGate(final int inputnr) {
super(inputnr); super(inputnr);
} }
public NorGate(DigitalInput... inputvals) { public NorGate(final DigitalInput... inputvals) {
super(inputvals); super(inputvals);
} }

View File

@ -3,7 +3,7 @@ public class NotGate extends LogicGate {
super(1); super(1);
} }
public NotGate(DigitalInput inputval) { public NotGate(final DigitalInput inputval) {
super(inputval); super(inputval);
} }