Skip to content

Package: Type

Type

nameinstructionbranchcomplexitylinemethod
Type(long, String, boolean, boolean)
M: 0 C: 11
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
isAbs()
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%
isTrans()
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%
toString()
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%

Coverage

1: package de.fhdw.wtf.persistence.meta;
2:
3: /**
4: * A Class which represents any WTF-Class.
5: *
6: */
7: public abstract class Type extends ModelItem {
8:         
9:         /**
10:          * A field which represents the information if the represented type is abstract.
11:          */
12:         private final boolean abs;
13:         
14:         /**
15:          * A field which represents the information if the type is also a transaction.
16:          */
17:         private final boolean trans;
18:         
19:         /**
20:          * Getter for the isAbstract information.
21:          *
22:          * @return Provides true if the type is abstract.
23:          */
24:         public boolean isAbs() {
25:                 return this.abs;
26:         }
27:         
28:         /**
29:          * Getter for IsTransaction.
30:          *
31:          * @return Provides true if the instances to this type are Transactions.
32:          */
33:         public boolean isTrans() {
34:                 return this.trans;
35:         }
36:         
37:         /**
38:          * The constructor for a new Type.
39:          *
40:          * @param id
41:          * The Id in the Database.
42:          * @param name
43:          * The name of this type.
44:          * @param abs
45:          * is the Type abstract ?
46:          * @param trans
47:          * ist the Type a transaction ?
48:          */
49:         protected Type(final long id, final String name, final boolean abs, final boolean trans) {
50:                 super(id, name);
51:                 this.abs = abs;
52:                 this.trans = trans;
53:         }
54:         
55:         @Override
56:         public String toString() {
57:                 return Long.toString(this.getId());
58:         }
59:         
60:         public abstract void accept(TypeVisitor typeVisitor);
61:         
62:         public abstract <X> X accept(TypeVisitorReturn<X> typeVisitor);
63:         
64:         /**
65:          * Calls the appropriate handle-method on the given TypeVisitorException.
66:          *
67:          * @param typeVisitor
68:          * the given TypeVisitorException.
69:          * @throws Exc
70:          * can be thrown when also thrown by called handle-method.
71:          */
72:         public abstract <Exc extends Exception> void accept(TypeVisitorException<Exc> typeVisitor) throws Exc;
73:         
74:         public abstract <X, Y extends Exception> X accept(TypeVisitorReturnException<X, Y> typeVisitorReturnException)
75:                         throws Y;
76:         
77: }