Clover Coverage Report - JmDNS 3.4.1
Coverage timestamp: Thu Aug 25 2011 13:06:33 CEST
../../../img/srcFileCovDistChart0.png 77% of files have more coverage
13   82   7   2.17
2   38   0.54   6
6     1.17  
1    
 
  NetworkTopologyEventImpl       Line # 15 13 0% 7 21 0% 0.0
 
No Tests
 
1    /**
2    *
3    */
4    package javax.jmdns.impl;
5   
6    import java.net.InetAddress;
7   
8    import javax.jmdns.JmDNS;
9    import javax.jmdns.NetworkTopologyEvent;
10    import javax.jmdns.NetworkTopologyListener;
11   
12    /**
13    * @author Cédrik Lime, Pierre Frisch
14    */
 
15    public class NetworkTopologyEventImpl extends NetworkTopologyEvent implements Cloneable {
16   
17    /**
18    *
19    */
20    private static final long serialVersionUID = 1445606146153550463L;
21   
22    private final InetAddress _inetAddress;
23   
24    /**
25    * Constructs a Network Topology Event.
26    *
27    * @param jmDNS
28    * @param inetAddress
29    * @exception IllegalArgumentException
30    * if source is null.
31    */
 
32  0 toggle public NetworkTopologyEventImpl(JmDNS jmDNS, InetAddress inetAddress) {
33  0 super(jmDNS);
34  0 this._inetAddress = inetAddress;
35    }
36   
 
37  0 toggle NetworkTopologyEventImpl(NetworkTopologyListener jmmDNS, InetAddress inetAddress) {
38  0 super(jmmDNS);
39  0 this._inetAddress = inetAddress;
40    }
41   
42    /*
43    * (non-Javadoc)
44    * @see javax.jmdns.NetworkTopologyEvent#getDNS()
45    */
 
46  0 toggle @Override
47    public JmDNS getDNS() {
48  0 return (this.getSource() instanceof JmDNS ? (JmDNS) getSource() : null);
49    }
50   
51    /*
52    * (non-Javadoc)
53    * @see javax.jmdns.NetworkTopologyEvent#getInetAddress()
54    */
 
55  0 toggle @Override
56    public InetAddress getInetAddress() {
57  0 return _inetAddress;
58    }
59   
 
60  0 toggle @Override
61    public String toString() {
62  0 StringBuilder buf = new StringBuilder();
63  0 buf.append("[" + this.getClass().getSimpleName() + "@" + System.identityHashCode(this) + " ");
64  0 buf.append("\n\tinetAddress: '");
65  0 buf.append(this.getInetAddress());
66  0 buf.append("']");
67    // buf.append("' source: ");
68    // buf.append("\n\t" + source + "");
69    // buf.append("\n]");
70  0 return buf.toString();
71    }
72   
73    /*
74    * (non-Javadoc)
75    * @see java.lang.Object#clone()
76    */
 
77  0 toggle @Override
78    public NetworkTopologyEventImpl clone() throws CloneNotSupportedException {
79  0 return new NetworkTopologyEventImpl(getDNS(), getInetAddress());
80    }
81   
82    }