org.eobjects.metamodel.util
Class ConstantFunc<I,O>

java.lang.Object
  extended by org.eobjects.metamodel.util.ConstantFunc<I,O>
Type Parameters:
I -
O -
All Implemented Interfaces:
Func<I,O>

public final class ConstantFunc<I,O>
extends Object
implements Func<I,O>

A function that always returns the same constant response.


Constructor Summary
ConstantFunc(O response)
           
 
Method Summary
 boolean equals(Object obj)
           
 O eval(I arg)
          Evaluates an element and transforms it using this function.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantFunc

public ConstantFunc(O response)
Method Detail

eval

public O eval(I arg)
Description copied from interface: Func
Evaluates an element and transforms it using this function.

Specified by:
eval in interface Func<I,O>
Parameters:
arg - the input given to the function
Returns:
the output result of the function

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2007-2013. All Rights Reserved.