Package at.jku.ssw.fp.coll
Class FSet.Cons<E>
- java.lang.Object
-
- at.jku.ssw.fp.coll.FSet<E>
-
- at.jku.ssw.fp.coll.FSet.Cons<E>
-
- Type Parameters:
E
- the element type
- All Implemented Interfaces:
Serializable
,Iterable<E>
public static final class FSet.Cons<E> extends FSet<E>
Class representing a functional set.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class at.jku.ssw.fp.coll.FSet
FSet.Builder<E>, FSet.Cons<E>, FSet.Empty<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 set.int
hashCode()
Returns a hash code value for the set.E
head()
Returns the first element of this set.boolean
isEmpty()
Returnsfalse
as this list is not empty.int
size()
Returns the number of elements of this functional set.FSet<E>
tail()
Returns the tail of this set.-
Methods inherited from class at.jku.ssw.fp.coll.FSet
add, contains, empty, filter, flatMap, forEach, iterator, map, of, of, of, 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 set.
-
head
public E head()
Returns the first element of this set.
-
hashCode
public int hashCode()
Returns a hash code value for the set. It is computed from the hash code of the head element and the hash code of the tail.
-
equals
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this set. The object is equal to this set, if it is a functional set and the head element and the tail are equal.
-
-