2 * Copyright 2005 the original author or authors.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.wamblee.crawler.kiss;
19 import org.wamblee.crawler.Action;
24 public class Program {
26 private static final String RECORD_ACTION = "record";
27 private static final String INDENT = " ";
29 private String _channel;
31 private String _description;
32 private String _keywords;
33 private TimeInterval _interval;
34 private Action _programInfo;
36 public Program(String aChannel, String aName, String aDescription, String aKeywords, TimeInterval aInterval, Action aProgramInfo) {
39 _description = aDescription;
40 _keywords = aKeywords;
41 _interval = aInterval;
42 _programInfo = aProgramInfo;
45 public String getChannel() {
49 public String getName() {
53 public String getDescription() {
57 public String getKeywords() {
61 public TimeInterval getInterval() {
65 public boolean record() {
66 Action record = _programInfo.execute().getAction(RECORD_ACTION);
67 if ( record == null) {
74 public void accept(Visitor aVisitor) {
75 aVisitor.visitProgram(this);
79 * @see java.lang.Object#toString()
82 public String toString() {
83 return _interval + " - " + _name + " (" + _channel + "/" + _keywords + ")" + "\n" +
84 (INDENT + _description).replaceAll("\n", "\n" + INDENT);