1 package de.fhdw.wtf.common.token;
2
3
4
5
6 public class EndToken extends Token {
7
8
9
10
11 private static final long serialVersionUID = 3907661300211152274L;
12
13
14
15 private static final int HASHCODE_TEMPLATE_CONSTANT = 36298324;
16
17
18
19
20 private static final String TOSTRING = "";
21
22
23
24
25
26
27
28 protected EndToken(final Position position) {
29 super(position);
30 }
31
32
33
34
35
36
37
38
39 public static EndToken create(final Position position) {
40 return new EndToken(position);
41 }
42
43 @Override
44 public boolean isEndToken() {
45 return true;
46 }
47
48 @Override
49 protected boolean equalsTemplate(final Token t) {
50 return t.isEndToken();
51 }
52
53 @Override
54 protected int hashCodeTemplate() {
55 return HASHCODE_TEMPLATE_CONSTANT;
56 }
57
58 @Override
59 public boolean equals(final Object o) {
60 if (o instanceof EndToken) {
61 return super.equals(o);
62 }
63 return false;
64 }
65
66 @Override
67 public int hashCode() {
68 return super.hashCode();
69 }
70
71 @Override
72 public String stringRepresentation() {
73 return TOSTRING;
74 }
75
76 @Override
77 public int getLength() {
78 return 0;
79 }
80
81 }