Skip to content

Package: Adapter

Adapter

nameinstructionbranchcomplexitylinemethod
Adapter()
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
getOwner()
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%
getState()
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%
setConnected()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setNotConnected()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setOwner(Device)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

Coverage

1: package networkconfigurator.item;
2:
3: import networkconfigurator.AdapterStates.AdapterState;
4: import networkconfigurator.AdapterStates.IsConnectedState;
5: import networkconfigurator.AdapterStates.IsNotConnectedState;
6:
7: /**
8: * abstract adapter.
9: *
10: * @author Erik Ole Arand
11: *
12: */
13: public abstract class Adapter extends Node {
14:         /**
15:          * the owner of the networkadaper.
16:          */
17:         private Device owner;
18:         /**
19:          * State of the Adapter.
20:          */
21:         private AdapterState state = new IsNotConnectedState();
22:
23:         /**
24:          * normal getter.
25:          *
26:          * @return get the state
27:          */
28:         public AdapterState getState() {
29:                 return state;
30:         }
31:
32:         /**
33:          * sets the state to the Connected State.
34:          */
35:         public void setConnected() {
36:                 this.state = new IsConnectedState();
37:         }
38:
39:         /**
40:          * sets the state to the NOTConnected State.
41:          */
42:         public void setNotConnected() {
43:                 this.state = new IsNotConnectedState();
44:         }
45:
46:         /**
47:          * getter for owner.
48:          *
49:          * @return the owner
50:          */
51:         public Device getOwner() {
52:                 return owner;
53:         }
54:
55:         /**
56:          * setter for owner.
57:          *
58:          * @param owner2
59:          * the owner.
60:          */
61:         public void setOwner(final Device owner2) {
62:                 this.owner = owner2;
63:         }
64: }