forked from JavaTX/JavaCompilerCore
3c86eecf8b
new file: Iteration.jav modified: Pair.jav modified: ../../src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java modified: ../../src/test/java/AllgemeinTest.java
36 lines
458 B
Java
36 lines
458 B
Java
/*
|
|
class Pair<T, U> {
|
|
T x;
|
|
U y;
|
|
|
|
public Pair() { }
|
|
public Pair(T x, U y) {
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
|
|
public T fst () {
|
|
return x;
|
|
}
|
|
|
|
public U snd () {
|
|
return y;
|
|
}
|
|
}
|
|
*/
|
|
|
|
public class Iteration {
|
|
m1(x, y) {
|
|
var help;
|
|
help = m2(x, y);
|
|
var y2 = help.snd();
|
|
return new Pair<>(y2,x);
|
|
}
|
|
|
|
m2(x,y) {
|
|
var help = m1(x, y);
|
|
var x2 = help.fst();
|
|
return new Pair<>(y, x2);
|
|
}
|
|
}
|
|
|