Skip to contentMethod: getValue()
      1: package model.type;
2: 
3: /**
4:  * Representation for the state of a RegExRefpart.
5:  * 
6:  * @author HFW410RA - Philipp Rammos
7:  * 
8:  */
9: public abstract class AbstractRefState {
10:         /**
11:          * The string representation of the reference.
12:          */
13:         private final String value;
14: 
15:         /**
16:          * Constructor for an AbstractRefState, just sets the field value.
17:          * 
18:          * @param value
19:          *            The value to set.
20:          */
21:         public AbstractRefState(final String value) {
22:                 this.value = value;
23:         }
24: 
25:         /**
26:          * Returns the field value. No side effects.
27:          * 
28:          * @return Return this.value()
29:          */
30:         public String getValue() {
31: 
32:                 return this.value;
33:         }
34: 
35:         /**
36:          * Returns the field type, if it is an RefResState, else an exception is thrown.
37:          * 
38:          * @return this.type
39:          * @throws ReferenceIsUnresolvedException
40:          *             If the state isnt a RefResState.
41:          */
42:         public abstract NamedVariableType getType() throws ReferenceIsUnresolvedException;
43: 
44:         /**
45:          * accept method for visitor pattern.
46:          * 
47:          * @param vis
48:          *            the visitor.
49:          * @throws TypeDoesNotExistException
50:          *             if a part is not resolvable
51:          * 
52:          * @throws TypeExceptions
53:          *             if a cycle is detected or ReferenceIsUnresolved
54:          */
55:         abstract void accept(RefStateVisitor vis) throws TypeDoesNotExistException, TypeExceptions;
56: 
57: }