All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.antkorwin.pdfinder.find.match.CompositeMatchTokenStrategy Maven / Gradle / Ivy

There is a newer version: 0.6
Show newest version
package com.antkorwin.pdfinder.find.match;

import java.util.Arrays;
import java.util.List;

import com.antkorwin.pdfinder.TextToken;
import com.antkorwin.pdfinder.find.MatchTokenStrategy;

public class CompositeMatchTokenStrategy implements MatchTokenStrategy {

	private final List strategyList;

	public CompositeMatchTokenStrategy(MatchTokenStrategy... strategies) {
		this.strategyList = Arrays.asList(strategies);
	}


	@Override
	public boolean matchToken(TextToken token, String searchString) {
		for (MatchTokenStrategy strategy : strategyList) {
			if (!strategy.matchToken(token, searchString)) {
				return false;
			}
		}
		return true;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy