Skip to content

Package: StringType

StringType

nameinstructionbranchcomplexitylinemethod
StringType(long)
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
accept(TypeVisitor)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
accept(TypeVisitorException)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
accept(TypeVisitorReturn)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
accept(TypeVisitorReturnException)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getInstance()
M: 0 C: 9
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
isTheSameAs(Object)
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: package de.fhdw.wtf.persistence.meta;
2:
3: /**
4: * A class to represent the Base Type String. A String is an arbitrary long sequence of characters. (Maximum: 4000 chars
5: *
6: */
7: public final class StringType extends Type {
8:         
9:         /**
10:          * The Name of the String Base Type.
11:          */
12:         public static final String STRING_NAME = "String";
13:         
14:         /**
15:          * The Id of String by Contract.
16:          */
17:         public static final long String_ID = 1;
18:         
19:         /**
20:          * A field to store the singleton instance of the String Base Type.
21:          */
22:         private static StringType instance;
23:         
24:         /**
25:          * Provides the only instance of the string base type. Realizes the singleton pattern.
26:          *
27:          * @return Provides the String.
28:          */
29:         public static synchronized StringType getInstance() {
30:•                if (instance == null) {
31:                         instance = new StringType(String_ID);
32:                 }
33:                 return instance;
34:         }
35:         
36:         /**
37:          * Private constructor for a new String Type.
38:          *
39:          * @param id
40:          */
41:         private StringType(final long id) {
42:                 super(id, STRING_NAME, false, false);
43:         }
44:         
45:         @Override
46:         public void accept(final TypeVisitor typeVisitor) {
47:                 typeVisitor.handleBaseType(this);
48:                 
49:         }
50:         
51:         @Override
52:         public <X> X accept(final TypeVisitorReturn<X> typeVisitor) {
53:                 return typeVisitor.handleBaseType(this);
54:         }
55:         
56:         @Override
57:         public <Exc extends Exception> void accept(final TypeVisitorException<Exc> typeVisitor) throws Exc {
58:                 typeVisitor.handleBaseType(this);
59:         }
60:         
61:         @Override
62:         public <X, Y extends Exception> X accept(final TypeVisitorReturnException<X, Y> typeVisitorReturnException)
63:                         throws Y {
64:                 return typeVisitorReturnException.handleBaseType(this);
65:         }
66:         
67:         @Override
68:         public boolean isTheSameAs(final java.lang.Object other) {
69:                 return other instanceof StringType;
70:         }
71:         
72: }