This commit is contained in:
Yadunand Prem 2022-10-04 15:57:49 +08:00
parent 26df644e0d
commit a99c9cefd2

View File

@ -24,18 +24,18 @@ class Lab5 {
} }
}; };
Immutator<Actually<Map<String, Map<String, String>>>, Map<String, Map<String, Map<String, String>>>> getStudent = new Immutator<>() { Immutator<Actually<Map<String, Map<String, String>>>, Map<String, Map<String, Map<String, String>>>> getModule = new Immutator<>() {
@Override @Override
public Actually<Map<String, Map<String, String>>> invoke(Map<String, Map<String, Map<String, String>>> param) { public Actually<Map<String, Map<String, String>>> invoke(Map<String, Map<String, Map<String, String>>> param) {
return Actually.ok(param.get(student)); return Actually.ok(param.get(module));
} }
}; };
Immutator<Actually<Map<String, String>>, Map<String, Map<String, String>>> getModule = new Immutator<>() { Immutator<Actually<Map<String, String>>, Map<String, Map<String, String>>> getStudent = new Immutator<>() {
@Override @Override
public Actually<Map<String, String>> invoke(Map<String, Map<String, String>> param) { public Actually<Map<String, String>> invoke(Map<String, Map<String, String>> param) {
return Actually.ok(param.get(module)); return Actually.ok(param.get(student));
} }
}; };
@ -48,35 +48,38 @@ class Lab5 {
}; };
return cDb.init().next(getStudent).next(getModule).next(getAssessment).except(cNoEntry); return cDb.init().next(getModule).next(getStudent).next(getAssessment).except(cNoEntry);
} }
public static void main(String[] args) { public static void main(String[] args) {
// Create a scanner to read from standard input. // Create a scanner to read from standard input.
Scanner sc = new Scanner(System.in); test6();
/*
// Read a single integer from the test file * Scanner sc = new Scanner(System.in);
// and then run the appropriate test case *
switch (sc.nextInt()) { * // Read a single integer from the test file
case 1: * // and then run the appropriate test case
test1(); * switch (sc.nextInt()) {
break; * case 1:
case 2: * test1();
test2(); * break;
break; * case 2:
case 3: * test2();
test3(); * break;
break; * case 3:
case 4: * test3();
test4(); * break;
break; * case 4:
case 5: * test4();
test5(); * break;
break; * case 5:
case 6: * test5();
test6(); * break;
break; * case 6:
} * test6();
* break;
* }
*/
} }
public static void test1() { public static void test1() {