Package: UnknownSymbol
UnknownSymbol
| name | instruction | branch | complexity | line | method | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| UnknownSymbol(String, Position) | 
 | 
 | 
 | 
 | 
 | ||||||||||||||||||||
| equals(Object) | 
 | 
 | 
 | 
 | 
 | ||||||||||||||||||||
| getValue() | 
 | 
 | 
 | 
 | 
 | ||||||||||||||||||||
| hashCode() | 
 | 
 | 
 | 
 | 
 | ||||||||||||||||||||
| toString() | 
 | 
 | 
 | 
 | 
 | ||||||||||||||||||||
Coverage
1: package symbols;
2: 
3: import model.Position;
4: import scanner.ScannerConstants;
5: 
6: /**
7:  * 
8:  * This class represents a Unkown Symbol.
9:  * 
10:  */
11: public class UnknownSymbol extends AbstractSymbol {
12:         /**
13:          * This is a instance of the symbol. This attribute shows the value of the Symbol.
14:          */
15:         private final transient String value;
16: 
17:         /**
18:          * This is only the constructor of the UnkownSymbol. It initialize the Unknown Symbol and set
19:          * 
20:          * @param value
21:          *            = this.value.
22:          * @param position
23:          *            is the row and column of the data in the stream.
24:          */
25:         public UnknownSymbol(final String value, final Position position) {
26:                 super(position);
27:                 this.value = value;
28:         }
29: 
30:         /**
31:          * @return the value of the unknown symbol.
32:          */
33:         public String getValue() {
34:                 return this.value;
35:         }
36: 
37:         @Override
38:         public String toString() {
39:                 return ScannerConstants.UNKNOWN + this.getValue() + this.getPosition();
40:         }
41: 
42:         @Override
43:         public int hashCode() {
44:                 return super.hashCode() + this.value.hashCode();
45:         }
46: 
47:         @Override
48:         public boolean equals(final Object obj) {
49:•                return super.equals(obj) && obj instanceof UnknownSymbol
50:•                                && ((UnknownSymbol) obj).getValue().equals(this.getValue());
51:         }
52: 
53: }