net.sf.javagimmicks.collections8.transformer.BidiTransformingCollection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gimmicks Show documentation
Show all versions of gimmicks Show documentation
Utility classes, APIs and tools for Java
package net.sf.javagimmicks.collections8.transformer;
import java.util.Collection;
import net.sf.javagimmicks.transform8.BidiFunction;
import net.sf.javagimmicks.transform8.BidiTransforming;
class BidiTransformingCollection
extends TransformingCollection
implements BidiTransforming
{
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