ImmutableList Assignment
Revision as of 04:56, 17 January 2020 by Dennis.cosgrove (talk | contribs)
Contents
Code To Implement
class: | DefaultImmutableList.java | ![]() |
methods: | constructors head tail isEmpty |
|
package: | immutable.list.assignment | |
source folder: | src/main/java |
class DefaultImmutableList implements ImmutableList<E>
class: | Lists.java | ![]() |
methods: | nil cons brackets |
|
package: | immutable.list.assignment | |
source folder: | src/main/java |
Length
class: | Length.java | ![]() |
methods: | length | |
package: | immutable.list.apps.assignment | |
source folder: | src/main/java |
public static <E> int length(ImmutableList<E> list)
SumProductCountdownFactorial
class: | SumProductCountdownFactorial.java | ![]() |
methods: | sum product countdown factorial |
|
package: | immutable.list.apps.assignment | |
source folder: | src/main/java |
sum
public static int sum(ImmutableList<Integer> xs)
product
public static int product(ImmutableList<Integer> xs)
countdown
public static ImmutableList<Integer> countdown(int n)
factorial
public static int factorial(int n)
Concat
class: | Concat.java | ![]() |
methods: | concat | |
package: | immutable.list.apps.assignment | |
source folder: | src/main/java |
public static <E> ImmutableList<E> concat(ImmutableList<E> xs, ImmutableList<E> ys)
Test
class: | ImmutableListTestSuite.java | ![]() |
package: | immutable.list.assignment | |
source folder: | src/test/java |