View Javadoc

1   /*
2    * This file is part of hyphenType. hyphenType is free software: you can
3    * redistribute it and/or modify it under the terms of the GNU General Public
4    * License as published by the Free Software Foundation, either version 3 of the
5    * License, or (at your option) any later version. hyphenType is distributed in
6    * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
7    * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
8    * the GNU General Public License for more details. You should have received a
9    * copy of the GNU General Public License along with hyphenType. If not, see
10   * <http://www.gnu.org/licenses/>.
11   */
12  package org.hyphenType.datastructure.lexer;
13  
14  /**
15   * @author Aurelio Akira M. Matsui
16   */
17  public abstract class LexToken {
18  
19      public final String value;
20  
21      public LexToken(String value) {
22          this.value = value;
23      }
24  
25      @Override
26      public String toString() {
27          return this.getClass().getSimpleName() + " : \"" + value + "\"";
28      }
29  
30      @Override
31      public boolean equals(Object obj) {
32          LexToken other = (LexToken) obj;
33          return this.value.equals(other.value);
34      }
35  
36      @Override
37      public int hashCode() {
38          return value.hashCode();
39      }
40  }