jaggregate
Class UnaryFunction<A,R>

java.lang.Object
  extended by jaggregate.UnaryFunction<A,R>
Type Parameters:
A - a constraint on the allowable types for the functor's argument
R - a constraint on the allowable types for the functor's return value
All Implemented Interfaces:
UnaryFunctor<A,R>

public abstract class UnaryFunction<A,R>
extends Object
implements UnaryFunctor<A,R>

A functor that accepts one argument.

Version:
$Id: UnaryFunction.java,v 1.6 2008/10/03 19:01:23 pholser Exp $
Author:
Paul Holser

Method Summary
<T> UnaryFunction<T,R>
compose(UnaryFunction<? super T,A> other)
          Answers a unary functor that evaluates in the same manner as this functor would if handed the result of evaluating a given unary functor with a given argument as its own argument; effectively offering a composition of the two functors.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jaggregate.UnaryFunctor
evaluate
 

Method Detail

compose

public final <T> UnaryFunction<T,R> compose(UnaryFunction<? super T,A> other)
Answers a unary functor that evaluates in the same manner as this functor would if handed the result of evaluating a given unary functor with a given argument as its own argument; effectively offering a composition of the two functors.

Type Parameters:
T - a constraint on the allowable types of the argument to the composed functor
Parameters:
other - the functor to compose
Returns:
a composed unary functor
Throws:
NullPointerException - if other is null


© Copyright 2004-2008 Paul R. Holser, Jr. All rights reserved. Licensed under the Academic Free License version 3.0. pholser@alumni.rice.edu