All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.javagimmicks.collections.transformer.BidiTransformingCollection Maven / Gradle / Ivy

There is a newer version: 0.99-alpha1
Show newest version
package net.sf.javagimmicks.collections.transformer;

import java.util.Collection;

import net.sf.javagimmicks.transform.BidiFunction;
import net.sf.javagimmicks.transform.BidiTransforming;

class BidiTransformingCollection
	extends TransformingCollection
	implements BidiTransforming
{
   /**
    * @deprecated Use TranformerUtils.decorate() instead
    */
   @Deprecated
   public BidiTransformingCollection(Collection collection, BidiFunction transformer)
   {
      super(collection, transformer);
   }

   public BidiFunction getTransformerBidiFunction()
   {
      return (BidiFunction)getTransformerFunction();
   }

   @Override
   public boolean add(T o)
   {
      return _internalCollection.add(transformBack(o));
   }
   
   protected F transformBack(T element)
   {
      return getTransformerBidiFunction().applyReverse(element);
   }
   
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy