fix linters
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
/**
|
||||
* The Action interface that can be called
|
||||
* on an object of type T to act.
|
||||
*
|
||||
* Contains a single abstract method call.
|
||||
*
|
||||
* CS2030S Lab 4
|
||||
* AY22/23 Semester 1
|
||||
*
|
||||
* @author Yadunand Prem (10B)
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
/**
|
||||
* The Actionable interface that can
|
||||
* act when given an action.
|
||||
*
|
||||
* Contains a single abstract method act.
|
||||
*
|
||||
* CS2030S Lab 4
|
||||
* AY22/23 Semester 1
|
||||
*
|
||||
* @author Yadunand Prem (10B)
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,12 +2,9 @@
|
||||
* The Applicable interface that can probably
|
||||
* transform if given something that is
|
||||
* probably an Immutator.
|
||||
*
|
||||
* Contains a single abstract method apply.
|
||||
*
|
||||
* CS2030S Lab 4
|
||||
* AY22/23 Semester 1
|
||||
*
|
||||
* @author Yadunand Prem (10B)
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
/**
|
||||
* The Immutator interface that can transform
|
||||
* to type T2, an object of type T1.
|
||||
*
|
||||
* Contains a single abstract method invoke.
|
||||
*
|
||||
* CS2030S Lab 4
|
||||
* AY22/23 Semester 1
|
||||
*
|
||||
* @author Yadunand Prem (10B)
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,12 +2,9 @@
|
||||
* The Immutatorable interface that can
|
||||
* transform when given something that is
|
||||
* Immutator.
|
||||
*
|
||||
* Contains a single abstract method transform.
|
||||
*
|
||||
* CS2030S Lab 4
|
||||
* AY22/23 Semester 1
|
||||
*
|
||||
* @author Yadunand Prem (10B)
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* A generic Immutator that takes in an object
|
||||
* that is T and returns an object that is probably T.
|
||||
*
|
||||
* CS2030S Lab 4
|
||||
* AY22/23 Semester 1
|
||||
*
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
* and return the boolean value by checking
|
||||
* if the given value is equal to mod when
|
||||
* divided by div.
|
||||
*
|
||||
* CS2030S Lab 4
|
||||
* AY22/23 Semester 1
|
||||
*
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* A non-generic Action to print the String
|
||||
* representation of the object.
|
||||
*
|
||||
* CS2030S Lab 4
|
||||
* AY22/23 Semester 1
|
||||
*
|
||||
|
||||
@@ -18,7 +18,7 @@ class Probably<T> implements Actionable<T>, Immutatorable<T>, Applicable<T> {
|
||||
* This is called a factory method. We can only
|
||||
* create this using the two public static method.
|
||||
*
|
||||
* @return The shared NOTHING.
|
||||
* @param value T
|
||||
*/
|
||||
private Probably(T value) {
|
||||
this.value = value;
|
||||
@@ -27,6 +27,7 @@ class Probably<T> implements Actionable<T>, Immutatorable<T>, Applicable<T> {
|
||||
/**
|
||||
* It is probably nothing, no value inside.
|
||||
*
|
||||
* @param <T> type T
|
||||
* @return The shared NOTHING.
|
||||
*/
|
||||
public static <T> Probably<T> none() {
|
||||
@@ -40,6 +41,8 @@ class Probably<T> implements Actionable<T>, Immutatorable<T>, Applicable<T> {
|
||||
* Unless the value is null, then nothing is
|
||||
* given again.
|
||||
*
|
||||
* @param <T> type T
|
||||
*
|
||||
* @param value Probably this is the value
|
||||
* unless it is null then we say
|
||||
* that there is no
|
||||
|
||||
@@ -7,6 +7,7 @@ class Test3 {
|
||||
return t1 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Length implements Immutator<Integer, String> {
|
||||
public Integer invoke(String t1) {
|
||||
return t1.length();
|
||||
|
||||
@@ -7,6 +7,7 @@ class Test4 {
|
||||
return t1 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Length implements Immutator<Integer, String> {
|
||||
public Integer invoke(String t1) {
|
||||
return t1.length();
|
||||
|
||||
@@ -7,6 +7,7 @@ class Test5 {
|
||||
return t1 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Length implements Immutator<Integer, String> {
|
||||
public Integer invoke(String t1) {
|
||||
return t1.length();
|
||||
|
||||
@@ -7,6 +7,7 @@ class Test6 {
|
||||
return t1 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Length implements Immutator<Integer, String> {
|
||||
public Integer invoke(String t1) {
|
||||
return t1.length();
|
||||
|
||||
Reference in New Issue
Block a user