X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=crawler%2Fkiss%2Fsrc%2Forg%2Fwamblee%2Fcrawler%2Fkiss%2FMatchVisitor.java;h=031c48ad6b77c7c570eb5284cc397a5424f364da;hb=86cff1086b248b389e72c49b08498652bbd8095f;hp=a05745684b42075820a356374fb120bae30e1e35;hpb=33225df8dfc5d87809fd0923b585c74245ad26b8;p=utils diff --git a/crawler/kiss/src/org/wamblee/crawler/kiss/MatchVisitor.java b/crawler/kiss/src/org/wamblee/crawler/kiss/MatchVisitor.java index a0574568..031c48ad 100644 --- a/crawler/kiss/src/org/wamblee/crawler/kiss/MatchVisitor.java +++ b/crawler/kiss/src/org/wamblee/crawler/kiss/MatchVisitor.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; @@ -22,30 +22,47 @@ import java.util.List; import org.wamblee.conditions.Condition; /** - * + * Visitor which determines the interesting programs in the TV guide. */ public class MatchVisitor extends AbstractVisitor { - - private Condition _matcher; + + /** + * Criterion that determines which programs are interesting. + */ + private Condition _matcher; + + /** + * List of interesting programs. + */ private List _programs; - - public MatchVisitor(Condition aMatcher) { - _matcher = aMatcher; + + /** + * Constructs the visitor. + * @param aMatcher Condition describing interesting programs. + */ + public MatchVisitor(Condition aMatcher) { + _matcher = aMatcher; _programs = new ArrayList(); } - - /* (non-Javadoc) + + /* + * (non-Javadoc) + * * @see org.wamblee.crawler.kiss.Visitor#visitProgram(org.wamblee.crawler.kiss.Program) */ public void visitProgram(Program aProgram) { - if ( _matcher.matches(aProgram)) { + if (_matcher.matches(aProgram)) { _programs.add(aProgram); } } - - public List getMatches() { - return _programs; + + /** + * Gets the list of interesting programs. To be called after applying + * the visitor on a tv guide. + * @return List of interesting programs. + */ + public List getMatches() { + return _programs; } - }