Difference between revisions of "Any and All Assignment"

From CSE425S Wiki
Jump to navigation Jump to search
Line 15: Line 15:
 
{{JavaToImplement|All|all<br/>all<br/>all|anyandall.group}}
 
{{JavaToImplement|All|all<br/>all<br/>all|anyandall.group}}
  
  public static double sumDistancesToOrigin(ImList<ImTuple2<Double, Double>> xys)
+
  public static boolean all(boolean... values)
 +
 
 +
public static boolean all(ImList<Boolean> values)
 +
 
 +
public static <T> boolean all(Predicate<T> predicate, ImList<T> values)
  
 
=Test=
 
=Test=
 
==Java==
 
==Java==
 
{{TestSuite|AnyAndAllTestSuite|anyandall.group}}
 
{{TestSuite|AnyAndAllTestSuite|anyandall.group}}

Revision as of 08:57, 9 February 2022

Group Warmup

Background

Code To Implement

Any

class: Any.java Java.png
methods: any
any
any
package: anyandall.group
source folder: src/main/java
public static double sumDistancesToOrigin(ImList<ImTuple2<Double, Double>> xys)

All

class: All.java Java.png
methods: all
all
all
package: anyandall.group
source folder: src/main/java
public static boolean all(boolean... values)
public static boolean all(ImList<Boolean> values)
public static <T> boolean all(Predicate<T> predicate, ImList<T> values)

Test

Java

class: AnyAndAllTestSuite.java Junit.png
package: anyandall.group
source folder: src/test/java