net.sf.asyncobjects.util.callbacks
Class MapperAdapter<I,O>

java.lang.Object
  extended by net.sf.asyncobjects.util.callbacks.MapperAdapter<I,O>
Type Parameters:
I - input type
O - output type
All Implemented Interfaces:
ExplicitSharing

public abstract class MapperAdapter<I,O>
extends Object
implements ExplicitSharing

Adapter for the AMapper interface. It simpplifies creation of instances of this type.

Author:
const

Nested Class Summary
 class MapperAdapter.InternalMapperAdapter
          An internal class that addapt Adapter calss to asynchronous interface.
 
Constructor Summary
MapperAdapter()
           
 
Method Summary
 AMapper<I,O> export()
           
protected abstract  Promise<? extends O> map(I value)
          A map function
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapperAdapter

public MapperAdapter()
Method Detail

map

protected abstract Promise<? extends O> map(I value)
                                     throws Throwable
A map function

Parameters:
value - a value to map
Returns:
a promise for mapped value
Throws:
Throwable

export

public final AMapper<I,O> export()
Returns:
an action exported as asynchronous interface


Copyright 2002-2007 Constantine Plotnikov. All Rights Reserved.