Files
Prog_1/Enigma/Reflector.java
Felix Steghofer 3db4f94e6a init
2022-12-04 01:25:28 +01:00

40 lines
663 B
Java

/**
* 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() {
}
}