Skip to content

Method: RefUnResState(String)

1: package model.type;
2:
3: /**
4: * A state that represents that a reference is unresolved.
5: *
6: * @author HFW410RA - Philipp Rammos
7: *
8: */
9: public class RefUnResState extends AbstractRefState {
10:         /**
11:          * Represents the stringrepresentation of the reference.
12:          */
13:
14:         /**
15:          * Constructor, just sets fields. No side effects.
16:          *
17:          * @param value
18:          * The value to set.
19:          */
20:
21:         public RefUnResState(final String value) {
22:                 super(value);
23:
24:         }
25:
26:         @Override
27:         public boolean equals(final Object obj) {
28:                 return obj instanceof RefUnResState
29:                                 && ((RefUnResState) obj).getValue().equals(this.getValue());
30:         }
31:
32:         @Override
33:         public int hashCode() {
34:                 return this.getValue().hashCode();
35:         }
36:
37:         @Override
38:         public NamedVariableType getType() throws ReferenceIsUnresolvedException {
39:
40:                 throw new ReferenceIsUnresolvedException(
41:                                 basic.ModelConstants.REFISUNRESEXCEP + this.getValue());
42:
43:         }
44:
45:         @Override
46:         public void accept(final RefStateVisitor vis)
47:                         throws TypeDoesNotExistException, TypeExceptions {
48:                 vis.visit(this);
49:         }
50:
51: }