init
This commit is contained in:
40
Enigma/Reflector.java
Normal file
40
Enigma/Reflector.java
Normal 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() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user