Skip to content

Method: toString()

1: package symbols;
2:
3: import model.Position;
4: import scanner.ScannerConstants;
5:
6: /**
7: *
8: * This class represents the BracketOpensymbol. It implements the Interface Symbol.
9: */
10: public final class BracketOpenSymbol extends AbstractSymbol {
11:
12:         /**
13:          * This constructor instantiate the BracketOpensymbol.
14:          *
15:          * @param position
16:          * is the position of the data in the stream.
17:          */
18:         public BracketOpenSymbol(final Position position) {
19:                 super(position);
20:         }
21:
22:         @Override
23:         public String toString() {
24:                 return ScannerConstants.BRACKETOPENSIGN.toString() + this.getPosition().toString();
25:         }
26:
27:         @Override
28:         public boolean equals(final Object obj) {
29:                 return super.equals(obj) && obj instanceof BracketOpenSymbol;
30:         }
31:
32:         @Override
33:         public int hashCode() {
34:                 return super.hashCode();
35:         }
36:
37: }