fr.ifremer.isisfish.ui.widget.filter
Class AcceptorFactory

java.lang.Object
  extended by fr.ifremer.isisfish.ui.widget.filter.AcceptorFactory

public class AcceptorFactory
extends Object

This class is an Acceptor factory.

For simple AcceptorFactory.LongAcceptor we use a cache to use an unique instance.

Author:
chemit

Nested Class Summary
static class AcceptorFactory.DoubleAcceptor
          Double acceptor implementation
static class AcceptorFactory.FloatAcceptor
          Float acceptor implementation
static class AcceptorFactory.LongAcceptor
          Long acceptor implementation
 
Field Summary
protected static Map<Integer,Acceptor<?>> cache
          cache of simple acceptors indexed by their klazz hashcode
 
Constructor Summary
AcceptorFactory()
           
 
Method Summary
static
<M,T> FilterAcceptor<M,T>
createCompositeFilterAcceptor(Class<T> klazz, ValueGetter<M,T> getter)
          Obtain a new instance of a CompositeFilterAcceptor using as delegate Acceptor a simple one in cache
static
<T> Acceptor<T>
getAcceptor(Class<T> klazz)
          Obtain a acceptor from caceh via his klazz key
protected static Map<Integer,Acceptor<?>> getCache()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected static Map<Integer,Acceptor<?>> cache
cache of simple acceptors indexed by their klazz hashcode

Constructor Detail

AcceptorFactory

public AcceptorFactory()
Method Detail

createCompositeFilterAcceptor

public static <M,T> FilterAcceptor<M,T> createCompositeFilterAcceptor(Class<T> klazz,
                                                                      ValueGetter<M,T> getter)
Obtain a new instance of a CompositeFilterAcceptor using as delegate Acceptor a simple one in cache

Parameters:
klazz - klazz of simple Acceptor to use
getter - ValueGetter to use
Returns:
a new instance of CompositeFilterAcceptor

getAcceptor

public static <T> Acceptor<T> getAcceptor(Class<T> klazz)
Obtain a acceptor from caceh via his klazz key

Parameters:
klazz - klazz of Acceptor to get
Returns:
the Acceptor register in cache via his klazz

getCache

protected static Map<Integer,Acceptor<?>> getCache()
Returns:
the unique instance of cache of Acceptor


Copyright © 1999-2012 CodeLutin. All Rights Reserved.