|
||||||||||
| 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.Null<T>
public final class Null<T>
An empty tuple. There is only one accessible instance, the INSTANCE singleton, which has
arbitrarily-chosen type argument Void (Option<null> would make more sense, but is
not expressible). Clients needing a specific kind of Null can perform an unsafe cast on
the singleton to produce the desired type (this is done in make()).
| Field Summary | |
|---|---|
static Null<java.lang.Void> |
INSTANCE
A singleton null tuple |
| Method Summary | ||
|---|---|---|
|
apply(OptionVisitor<? super T,? extends Ret> visitor)
Invokes visitor.forNone() |
|
boolean |
equals(java.lang.Object o)
Defined in terms of identity (since the singleton is the only accessible instance) |
|
protected int |
generateHashCode()
Defined in terms of identity (since the singleton is the only accessible instance) |
|
boolean |
isSome()
Determine whether this Option is a "some" case. |
|
static
|
make()
Return a singleton, cast to the appropriate type. |
|
java.lang.String |
toString()
Produces "()" |
|
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. |
|
| 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 |
|---|
public static final Null<java.lang.Void> INSTANCE
| Method Detail |
|---|
public <Ret> Ret apply(OptionVisitor<? super T,? extends Ret> visitor)
visitor.forNone()
apply in class Option<T>public boolean isSome()
OptionOption.isNone().
isSome in class Option<T>public T unwrap()
OptionOptionUnwrapException if there
is no wrapped value.
unwrap in class Option<T>public T unwrap(T forNone)
OptionforNone if there is no wrapped value.
unwrap in class Option<T>public java.lang.String toString()
"()"
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectprotected int generateHashCode()
generateHashCode in class Tuplepublic static <T> Null<T> make()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||