Difference between revisions of "Iterable Immutable List Assignment"

From CSE425S Wiki
Jump to navigation Jump to search
(Created page with "=Code To Implement= ==Lists== {{JavaToImplement|Lists|nil<br>cons<br>brackets|immutable.list.assignment}} ===nil=== <nowiki>public static <E> ImmutableList<E> nil()</nowiki>...")
 
Line 9: Line 9:
 
  <nowiki>@SafeVarargs
 
  <nowiki>@SafeVarargs
 
public static <E> ImmutableList<E> brackets(E... elements</nowiki>
 
public static <E> ImmutableList<E> brackets(E... elements</nowiki>
 +
==DefaultImmutableList==
 +
{{JavaToImplement|DefaultImmutableList|head<br>tail<br>isEmpty<br>iterator|immutable.list.assignment}}
 +
===head===
 +
===tail===
 +
===isEmpty===
 +
===iterator===
  
 
=Test=
 
=Test=
 
{{TestSuite|ListsTestSuite|immutable.list.assignment}}
 
{{TestSuite|ListsTestSuite|immutable.list.assignment}}

Revision as of 08:23, 30 July 2019

Code To Implement

Lists

class: Lists.java Java.png
methods: nil
cons
brackets
package: immutable.list.assignment
source folder: src/main/java

nil

public static <E> ImmutableList<E> nil()

cons

public static <E> ImmutableList<E> cons(E head, ImmutableList<E> tail)

brackets

@SafeVarargs
public static <E> ImmutableList<E> brackets(E... elements

DefaultImmutableList

class: DefaultImmutableList.java Java.png
methods: head
tail
isEmpty
iterator
package: immutable.list.assignment
source folder: src/main/java

head

tail

isEmpty

iterator

Test

class: ListsTestSuite.java Junit.png
package: immutable.list.assignment
source folder: src/test/java