net.sf.javagimmicks.collections8.transformer.TransformingSet 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.AbstractSet;
import java.util.Iterator;
import java.util.Set;
import java.util.Spliterator;
import java.util.function.Function;
import net.sf.javagimmicks.transform8.Transforming;
class TransformingSet
extends AbstractSet
implements Transforming
{
protected final Set _internalSet;
private final Function _transformer;
TransformingSet(Set set, Function transformer)
{
_internalSet = set;
_transformer = transformer;
}
public Function getTransformerFunction()
{
return _transformer;
}
@Override
public Iterator iterator()
{
return TransformerUtils.decorate(_internalSet.iterator(), getTransformerFunction());
}
@Override
public Spliterator spliterator()
{
return TransformerUtils.decorate(_internalSet.spliterator(), getTransformerFunction());
}
@Override
public int size()
{
return _internalSet.size();
}
@Override
public void clear()
{
_internalSet.clear();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy