01: package org.syrup.helpers;
02:
03: import org.syrup.LogEntryTemplate;
04:
05: /**
06: * A generic LogEntryTemplateImpl implementation.
07: *
08: * @author Robbert van Dalen
09: */
10: public class LogEntryTemplateImpl extends TemplateImpl implements
11: LogEntryTemplate {
12: static final String COPYRIGHT = "Copyright 2005 Robbert van Dalen."
13: + "At your option, you may copy, distribute, or make derivative works under "
14: + "the terms of The Artistic License. This License may be found at "
15: + "http://www.opensource.org/licenses/artistic-license.php. "
16: + "THERE IS NO WARRANTY; USE THIS PRODUCT AT YOUR OWN RISK.";
17:
18: /**
19: * Constructor for the LogEntryTemplateImpl object
20: *
21: * @param specification
22: * The query specification
23: */
24: public LogEntryTemplateImpl(String[] specification)
25: throws Exception {
26: super (specification);
27: }
28:
29: public int time_match() {
30: return operator(operators.get("time"));
31: }
32:
33: public int key_match() {
34: return operator(operators.get("key"));
35: }
36:
37: public int event_match() {
38: return operator(operators.get("event"));
39: }
40:
41: public int worker_match() {
42: return operator(operators.get("worker"));
43: }
44:
45: public long time() {
46: return to_date((String) values.get("time"));
47: }
48:
49: public String key() {
50: return (String) values.get("key");
51: }
52:
53: public int event() {
54: return (int) LogEntryImpl.parseEvents((String) values
55: .get("event"));
56: }
57:
58: public String worker() {
59: return (String) values.get("worker");
60: }
61: }
|