* 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 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<Program> _condition;
-
- private ProgramAction _action;
-
- public ProgramFilter(Condition<Program> aCondition, ProgramAction aAction) {
- _condition = aCondition;
- _action = aAction;
+
+ private Condition<Program> _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<Program> aCondition, ProgramAction aAction) {
+ _condition = aCondition;
+ _action = aAction;
}
-
- public ProgramAction getAction() {
+
+ /**
+ * Gets the action.
+ * @return Action.
+ */
+ public ProgramAction getAction() {
return _action;
}
-
- public List<Program> apply(TVGuide aGuide) {
+
+ /**
+ * Applies the filter to a TV guide.
+ * @param aGuide TV guide.
+ * @return List of matching programs.
+ */
+ public List<Program> apply(TVGuide aGuide) {
MatchVisitor matcher = new MatchVisitor(_condition);
aGuide.accept(matcher);
- return matcher.getMatches();
+ return matcher.getMatches();
}
}