|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
IpAddress.java | - | 100% | 100% | 100% |
|
1 |
/*
|
|
2 |
* Replica is published under the terms
|
|
3 |
* of the Apache Software License.
|
|
4 |
*/
|
|
5 |
package replica.group;
|
|
6 |
|
|
7 |
import java.net.InetAddress;
|
|
8 |
|
|
9 |
/**
|
|
10 |
* Implements an ip address. (Borrowed from IpAddress in jgroups :).
|
|
11 |
*
|
|
12 |
* @author Pedro Costa
|
|
13 |
* @author Helder Silva
|
|
14 |
* @since 19/Jan/2004
|
|
15 |
*/
|
|
16 |
public class IpAddress implements Address { |
|
17 |
|
|
18 |
private InetAddress address;
|
|
19 |
private int port; |
|
20 |
|
|
21 |
/**
|
|
22 |
* Default constructor;
|
|
23 |
*/
|
|
24 | 74 |
public IpAddress() {
|
25 | 74 |
super();
|
26 |
} |
|
27 |
|
|
28 |
/**
|
|
29 |
* @return
|
|
30 |
*/
|
|
31 | 13 |
public InetAddress getAddress() {
|
32 | 13 |
return address;
|
33 |
} |
|
34 |
|
|
35 |
/**
|
|
36 |
* @return
|
|
37 |
*/
|
|
38 | 13 |
public int getPort() { |
39 | 13 |
return port;
|
40 |
} |
|
41 |
|
|
42 |
/**
|
|
43 |
* @param address
|
|
44 |
*/
|
|
45 | 70 |
public void setAddress(InetAddress address) { |
46 | 70 |
this.address = address;
|
47 |
} |
|
48 |
|
|
49 |
/**
|
|
50 |
* @param i
|
|
51 |
*/
|
|
52 | 70 |
public void setPort(int i) { |
53 | 70 |
port = i; |
54 |
} |
|
55 |
|
|
56 | 11 |
public String toString(){
|
57 | 11 |
return getAddress() + ":" + getPort(); |
58 |
} |
|
59 |
|
|
60 |
} |
|
61 |
|
|