X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=crawler%2Fkiss%2Fsrc%2Forg%2Fwamblee%2Fcrawler%2Fkiss%2Fmain%2FProgramFilter.java;h=e8633401222faa21e6478ae4b1ec295d2778d9c8;hb=94445186085ec1ec27bed5a5c07b634da957eb08;hp=397cfe9c54a3aab3abed61adb80105264d93f881;hpb=dbb0ee9cc1d8004ee4d8ad77678e1f396880d784;p=utils diff --git a/crawler/kiss/src/org/wamblee/crawler/kiss/main/ProgramFilter.java b/crawler/kiss/src/org/wamblee/crawler/kiss/main/ProgramFilter.java index 397cfe9c..e8633401 100644 --- a/crawler/kiss/src/org/wamblee/crawler/kiss/main/ProgramFilter.java +++ b/crawler/kiss/src/org/wamblee/crawler/kiss/main/ProgramFilter.java @@ -12,7 +12,7 @@ * 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; @@ -23,29 +23,42 @@ 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. + * Obtains a list of interesting programs from a TV guide and decides what to do + * with them. */ public class ProgramFilter { - - private Condition _condition; - - private ProgramAction _action; - - public ProgramFilter(Condition aCondition, ProgramAction aAction) { - _condition = aCondition; - _action = aAction; + + 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; } - - public ProgramAction getAction() { + + /** + * Gets the action. + * @return Action. + */ + public ProgramAction getAction() { return _action; } - - public List apply(TVGuide aGuide) { + + /** + * 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(); + return matcher.getMatches(); } }