X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=crawler%2Fkiss%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fcrawler%2Fkiss%2Fmain%2FProgramFilter.java;fp=crawler%2Fkiss%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fcrawler%2Fkiss%2Fmain%2FProgramFilter.java;h=0000000000000000000000000000000000000000;hb=2ef561a4fbf29b65335f1558bfebd74733a6ddd9;hp=31f58629c11181268b10cd779cee45a255ec7716;hpb=54903ea538a09fdb1e2ee6dc37e89bb85aebfec4;p=utils diff --git a/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramFilter.java b/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramFilter.java deleted file mode 100644 index 31f58629..00000000 --- a/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramFilter.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wamblee.crawler.kiss.main; - -import java.util.List; - -import org.wamblee.conditions.Condition; -import org.wamblee.crawler.kiss.guide.MatchVisitor; -import org.wamblee.crawler.kiss.guide.Program; -import org.wamblee.crawler.kiss.guide.TVGuide; - -/** - * Obtains a list of interesting programs from a TV guide and decides what to do - * with them. - * - * @author Erik Brakkee - */ -public class ProgramFilter { - - private Condition _condition; - - private ProgramAction _action; - - /** - * Constructs the program filter. - * @param aCondition Condition used to find interesting programs. - * @param aAction Corresponding action to execute for matching programs. - */ - public ProgramFilter(Condition aCondition, ProgramAction aAction) { - _condition = aCondition; - _action = aAction; - } - - /** - * Gets the action. - * @return Action. - */ - public ProgramAction getAction() { - return _action; - } - - /** - * Applies the filter to a TV guide. - * @param aGuide TV guide. - * @return List of matching programs. - */ - public List apply(TVGuide aGuide) { - MatchVisitor matcher = new MatchVisitor(_condition); - aGuide.accept(matcher); - return matcher.getMatches(); - } -}