Package at.jku.ssw.fp.coll
Class FList.Cons<E>
- java.lang.Object
-
- at.jku.ssw.fp.coll.FList<E>
-
- at.jku.ssw.fp.coll.FList.Cons<E>
-
- Type Parameters:
E
- the element type
- All Implemented Interfaces:
Serializable
,Iterable<E>
public static final class FList.Cons<E> extends FList<E>
Class representing a functional list with a head element and tail list.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class at.jku.ssw.fp.coll.FList
FList.Builder<E>, FList.Cons<E>, FList.Nil<E>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Indicates whether some other object is "equal to" this list.int
hashCode()
Returns a hash code value for the list.E
head()
Returns the head element of this list.boolean
isEmpty()
Returnsfalse
as this list is not empty.int
size()
Returns the number of elements of this functional list.FList<E>
tail()
Returns the tail list of this list.-
Methods inherited from class at.jku.ssw.fp.coll.FList
add, contains, empty, filter, find, flatMap, forEach, generate, get, iterator, map, of, parallelStream, reduce, reduce, remove, removeIdx, replaceIdx, reverse, stream, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
spliterator
-
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Returnsfalse
as this list is not empty.
-
size
public int size()
Returns the number of elements of this functional list.
-
head
public E head()
Returns the head element of this list.
-
hashCode
public int hashCode()
Returns a hash code value for the list. It is computed from the hash code of the head element and the hash code of the tail list.
-
equals
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this list. The object is equal to this list, if it is a functional list and the head element and the tail list are equal.
-
-