View Javadoc

1   
2   /*
3    * SmartCrawler
4    *
5    * $Id: ConcretePattern.java,v 1.5 2005/08/05 15:55:53 vincool Exp $
6    * Copyright 2005 Davide Pozza
7    *
8    * This program is free software; you can redistribute it
9    * and/or modify it under the terms of the GNU General Public
10   * License as published by the Free Software Foundation;
11   * either version 2 of the License, or (at your option) any
12   * later version.
13   *
14   * This program is distributed in the hope that it will be
15   * useful, but WITHOUT ANY WARRANTY; without even the implied
16   * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17   * PURPOSE. See the GNU General Public License for more
18   * details.
19   *
20   * You should have received a copy of the GNU General Public
21   * License along with this program; if not, write to the Free
22   * Software Foundation, Inc., 59 Temple Place, Suite 330,
23   * Boston, MA 02111-1307 USA
24   *
25   */
26  
27  package org.smartcrawler.extractor.pattern;
28  
29  /***
30   *
31   *
32   * @author <a href="mailto:pozzad@alice.it">Davide Pozza</a>
33   * @version <tt>$Revision: 1.5 $</tt>
34   */
35  public class ConcretePattern extends AbstractPattern {
36  
37      private String stringPattern;
38      private String group;
39      private String tagName;
40  
41      /*** Creates a new instance of ConcretePattern */
42      public ConcretePattern() {
43      }
44  
45      /***
46       *
47       * @return
48       */
49      public String getStringPattern() {
50          return stringPattern;
51      }
52  
53      /***
54       *
55       * @param stringPattern
56       */
57      public void setStringPattern(String stringPattern) {
58          this.stringPattern = stringPattern;
59      }
60  
61      /***
62       *
63       * @return
64       */
65      public String getGroup() {
66          return group;
67      }
68  
69      /***
70       *
71       * @param group
72       */
73      public void setGroup(String group) {
74          this.group = group;
75      }
76  
77      /***
78       *
79       * @param o
80       * @return
81       */
82      public boolean equals(Object o) {
83          if (o instanceof ConcretePattern) {
84              ConcretePattern c = (ConcretePattern)o;
85              return (c.getGroup().equals(this.getGroup()) &&
86                      c.getStringPattern().equals(this.getStringPattern()));
87          } else {
88              return false;
89          }
90      }
91  
92      /***
93       *
94       * @return
95       */
96      public String toString() {
97          return "group: " + this.getGroup() + "; pattern=" + this.getStringPattern();
98      }
99  
100     /***
101      *
102      * @return
103      */
104     public String getTagName() {
105         return tagName;
106     }
107 
108     /***
109      *
110      * @param tagName
111      */
112     public void setTagName(String tagName) {
113         this.tagName = tagName;
114     }
115 
116 
117 
118 }