|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object endrov.util.collection.Maybe<E>
public class Maybe<E>
Wrapper around pointer that can be a value and can be null, but need to know in addition if it is set. Corresponds to the Haskell Maybe monad.
Constructor Summary | |
---|---|
Maybe()
Construct a Nothing-value |
|
Maybe(E e)
Construct a reference to a value |
Method Summary | ||
---|---|---|
E |
get()
Get the value |
|
boolean |
hasValue()
Is there a value? |
|
static
|
just(E e)
Construct value. |
|
java.lang.String |
toString()
String of value of <> if there is no value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Maybe()
public Maybe(E e)
Method Detail |
---|
public E get()
public boolean hasValue()
public static <E> Maybe<E> just(E e)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |