|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.plt.tuple.Tuple
edu.rice.cs.plt.tuple.Option<T>
edu.rice.cs.plt.tuple.Wrapper<T>
public class Wrapper<T>
An arbitrary 1-tuple; overrides toString()
, equals(Object)
,
and Tuple.hashCode()
.
Field Summary | |
---|---|
protected T |
_value
|
Constructor Summary | |
---|---|
Wrapper(T value)
|
Method Summary | ||
---|---|---|
|
apply(OptionVisitor<? super T,? extends Ret> visitor)
Calls the appropriate case in the visitor. |
|
boolean |
equals(Object o)
|
|
static
|
factory()
Produce a lambda that invokes the constructor |
|
protected int |
generateHashCode()
|
|
boolean |
isSome()
Determine whether this Option is a "some" case. |
|
static
|
make(T value)
Call the constructor (allows T to be inferred) |
|
String |
toString()
|
|
T |
unwrap()
Get the value wrapped by this Option, or throw an OptionUnwrapException if there
is no wrapped value. |
|
T |
unwrap(T forNone)
Get the value wrapped by this Option, or forNone if there is no wrapped value. |
|
T |
value()
|
Methods inherited from class edu.rice.cs.plt.tuple.Option |
---|
comparator, comparator, isNone, none, some, unwrap, wrap |
Methods inherited from class edu.rice.cs.plt.tuple.Tuple |
---|
hashCode |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final T _value
Constructor Detail |
---|
public Wrapper(T value)
Method Detail |
---|
public T value()
value
in interface Thunk<T>
public T unwrap()
Option
OptionUnwrapException
if there
is no wrapped value.
unwrap
in class Option<T>
public T unwrap(T forNone)
Option
forNone
if there is no wrapped value.
unwrap
in class Option<T>
public <Ret> Ret apply(OptionVisitor<? super T,? extends Ret> visitor)
Option
apply
in class Option<T>
public boolean isSome()
Option
Option.isNone()
.
isSome
in class Option<T>
public String toString()
toString
in class Object
public boolean equals(Object o)
equals
in class Object
true
iff this
is of the same class as o
, and the
wrapped values are equal (according to equals
)protected int generateHashCode()
generateHashCode
in class Tuple
public static <T> Wrapper<T> make(T value)
T
to be inferred)
public static <T> Lambda<T,Wrapper<T>> factory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |