com.myjavatools.lib.foundation
Class LazyPair<X,Y>

java.lang.Object
  extended by com.myjavatools.lib.foundation.Pair<X,Y>
      extended by com.myjavatools.lib.foundation.LazyPair<X,Y>
All Implemented Interfaces:
java.util.Map.Entry<X,Y>

public class LazyPair<X,Y>
extends Pair<X,Y>

LazyPair<Left, Right> is a pair consisting of key and value; its value won't be calculated until requested. LazyPair is immutable.

Since:
6.0
Version:
6.0 04/25/06
See Also:
Map#Entry

Field Summary
 
Fields inherited from class com.myjavatools.lib.foundation.Pair
left, right
 
Constructor Summary
LazyPair(X x, Function<? super X,Y> f)
          Constructor; saves argument and function
 
Method Summary
 Y right()
          right getter
 
Methods inherited from class com.myjavatools.lib.foundation.Pair
equals, getKey, getValue, hashCode, hashCode, left, pairEqual, setValue, swap
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyPair

public LazyPair(X x,
                Function<? super X,Y> f)
Constructor; saves argument and function

Parameters:
x - X
f - Function
Method Detail

right

public Y right()
right getter

Overrides:
right in class Pair<X,Y>
Returns:
the value of the function