git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(no commit message)
[utils]
/
crawler
/
kiss
/
src
/
org
/
wamblee
/
crawler
/
kiss
/
MatchVisitor.java
diff --git
a/crawler/kiss/src/org/wamblee/crawler/kiss/MatchVisitor.java
b/crawler/kiss/src/org/wamblee/crawler/kiss/MatchVisitor.java
index a05745684b42075820a356374fb120bae30e1e35..031c48ad6b77c7c570eb5284cc397a5424f364da 100644
(file)
--- 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.
* 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;
package org.wamblee.crawler.kiss;
@@
-22,30
+22,47
@@
import java.util.List;
import org.wamblee.conditions.Condition;
/**
import org.wamblee.conditions.Condition;
/**
- *
+ *
Visitor which determines the interesting programs in the TV guide.
*/
public class MatchVisitor extends AbstractVisitor {
*/
public class MatchVisitor extends AbstractVisitor {
-
- private Condition _matcher;
+
+ /**
+ * Criterion that determines which programs are interesting.
+ */
+ private Condition<Program> _matcher;
+
+ /**
+ * List of interesting programs.
+ */
private List<Program> _programs;
private List<Program> _programs;
-
- public MatchVisitor(Condition aMatcher) {
- _matcher = aMatcher;
+
+ /**
+ * Constructs the visitor.
+ * @param aMatcher Condition describing interesting programs.
+ */
+ public MatchVisitor(Condition<Program> aMatcher) {
+ _matcher = aMatcher;
_programs = new ArrayList<Program>();
}
_programs = new ArrayList<Program>();
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.wamblee.crawler.kiss.Visitor#visitProgram(org.wamblee.crawler.kiss.Program)
*/
public void visitProgram(Program aProgram) {
* @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);
}
}
_programs.add(aProgram);
}
}
-
- public List<Program> 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<Program> getMatches() {
+ return _programs;
}
}
-
}
}