
net.sf.jtables.io.reader.VisitorFirstLine Maven / Gradle / Ivy
package net.sf.jtables.io.reader;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import net.sf.kerner.utils.collections.filter.Filter;
public class VisitorFirstLine implements Filter {
private final Collection needsToMatch;
public VisitorFirstLine(Collection needsToMatch) {
this.needsToMatch = new HashSet(needsToMatch);
}
public VisitorFirstLine(String needsToMatch) {
this(Arrays.asList(needsToMatch));
}
public boolean filter(String line) {
for (String s : needsToMatch) {
if (!line.contains(s)) {
return false;
}
}
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy