edu.rice.cs.plt.tuple
Class IdentityWrapper<T>
java.lang.Object
edu.rice.cs.plt.tuple.Tuple
edu.rice.cs.plt.tuple.Option<T>
edu.rice.cs.plt.tuple.Wrapper<T>
edu.rice.cs.plt.tuple.IdentityWrapper<T>
- All Implemented Interfaces:
- Thunk<T>, Serializable
public class IdentityWrapper<T>
- extends Wrapper<T>
A wrapper that defines equals(java.lang.Object) and Tuple.hashCode() in terms of its value's
identity (==) instead of equality (@code equals})
- See Also:
- Serialized Form
|
Method Summary |
boolean |
equals(Object o)
|
static
|
factory()
Produce a lambda that invokes the constructor |
protected int |
generateHashCode()
|
static
|
make(T value)
Call the constructor (allows T to be inferred) |
| Methods inherited from class edu.rice.cs.plt.tuple.Tuple |
hashCode |
IdentityWrapper
public IdentityWrapper(T value)
equals
public boolean equals(Object o)
- Overrides:
equals in class Wrapper<T>
- Returns:
true iff this is of the same class as o, and the
wrapped values are identical (according to ==)
generateHashCode
protected int generateHashCode()
- Overrides:
generateHashCode in class Wrapper<T>
make
public static <T> IdentityWrapper<T> make(T value)
- Call the constructor (allows
T to be inferred)
factory
public static <T> Lambda<T,Wrapper<T>> factory()
- Produce a lambda that invokes the constructor