org.etlunit.feature.FeatureProxyBase Maven / Gradle / Ivy
package org.etlunit.feature;
import java.util.ArrayList;
import java.util.List;
public class FeatureProxyBase
{
interface Getter
{
K get(Feature f);
}
private final Getter getter;
private final List list;
private final List klist = new ArrayList();
private int lastSize = -1;
public FeatureProxyBase(List list, Getter getter)
{
this.list = list;
this.getter = getter;
}
public List getList()
{
if (list.size() == lastSize)
{
return klist;
}
klist.clear();
for (Feature feature : list)
{
K k = getter.get(feature);
if (k != null)
{
klist.add(k);
}
}
lastSize = list.size();
return klist;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy