This commit is contained in:
Felix Steghofer
2022-12-04 01:25:28 +01:00
commit 3db4f94e6a
31 changed files with 2762 additions and 0 deletions

40
Enigma/Reflector.java Normal file
View File

@@ -0,0 +1,40 @@
/**
* Reflector for the Enigma.
*
*/
public class Reflector implements EnigmaComponent {
/**
* Permutation of the reflector.
*/
private int[] permu;
/**
* Permutation of reflector.
* @param permu Permutation
*/
Reflector(final int[] permu) {
this.permu = permu;
}
/**
* {@inheritDoc}
*/
public final int encode(final int i) {
return permu[i];
}
/**
* Method is not required in the reflector.<br />
* {@inheritDoc}
*/
public final int decode(final int i) {
return 0;
}
/**
* {@inheritDoc}
*/
public void tick() {
}
}