edu.rice.cs.plt.tuple
Class IdentityWrapper<T>

java.lang.Object
  extended by edu.rice.cs.plt.tuple.Tuple
      extended by edu.rice.cs.plt.tuple.Option<T>
          extended by edu.rice.cs.plt.tuple.Wrapper<T>
              extended by 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

Field Summary
 
Fields inherited from class edu.rice.cs.plt.tuple.Wrapper
_value
 
Constructor Summary
IdentityWrapper(T value)
           
 
Method Summary
 boolean equals(Object o)
           
static
<T> Lambda<T,Wrapper<T>>
factory()
          Produce a lambda that invokes the constructor
protected  int generateHashCode()
           
static
<T> IdentityWrapper<T>
make(T value)
          Call the constructor (allows T to be inferred)
 
Methods inherited from class edu.rice.cs.plt.tuple.Wrapper
apply, isSome, toString, unwrap, unwrap, value
 
Methods inherited from class edu.rice.cs.plt.tuple.Option
isNone, none, some, 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
 

Constructor Detail

IdentityWrapper

public IdentityWrapper(T value)
Method Detail

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