Package immutable.list.assignment
Class Lists
java.lang.Object
immutable.list.assignment.Lists
public class Lists
extends java.lang.Object
- Author:
- __STUDENT_NAME__, Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
-
Constructor Summary
Constructors Constructor Description Lists() -
Method Summary
Modifier and Type Method Description static <E> ImmutableList<E>brackets(E... elements)static <E> ImmutableList<E>cons(E head, ImmutableList<E> tail)Constructs a new list comprised of head and tail.static <E> ImmutableList<E>nil()
-
Constructor Details
-
Lists
public Lists()
-
-
Method Details
-
nil
- Type Parameters:
E- the type of elements held in the ImmutableList- Returns:
- an empty ImmutableList
-
cons
Constructs a new list comprised of head and tail.- Type Parameters:
E- the type of elements held in the ImmutableLists- Parameters:
head- the valuetail- the rest- Returns:
- the constructed list
-
brackets
- Type Parameters:
E- the type of elements held in the ImmutableList- Parameters:
elements- the contents of the to be created list- Returns:
- the created list
-