net.sf.javagimmicks.collections.transformer.TransformingCollection 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.collections.transformer;
import java.util.AbstractCollection;
import java.util.Collection;
import java.util.Iterator;
import net.sf.javagimmicks.transform.Transforming;
import net.sf.javagimmicks.util.Function;
class TransformingCollection
extends AbstractCollection
implements Transforming
{
protected final Collection _internalCollection;
private final Function _transformer;
/**
* @deprecated Use TranformerUtils.decorate() instead
*/
@Deprecated
public TransformingCollection(Collection collection, Function transformer)
{
_internalCollection = collection;
_transformer = transformer;
}
public Function getTransformerFunction()
{
return _transformer;
}
@Override
public Iterator iterator()
{
return TransformerUtils.decorate(_internalCollection.iterator(), getTransformerFunction());
}
@Override
public int size()
{
return _internalCollection.size();
}
@Override
public void clear()
{
_internalCollection.clear();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy