Package se.sics.kompics.network.test
Class TestAddress
java.lang.Object
se.sics.kompics.network.test.TestAddress
- All Implemented Interfaces:
Serializable
,Address
public class TestAddress extends Object implements Address, Serializable
- Author:
- Lars Kroll <[email protected]>
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description TestAddress(InetAddress addr, int port)
TestAddress(InetSocketAddress isa)
-
Method Summary
Modifier and Type Method Description InetSocketAddress
asSocket()
Get this address as InetSocketAddress.InetAddress
getIp()
int
getPort()
boolean
sameHostAs(Address other)
Compares only the ip+port part of the address for equality.String
toString()
-
Constructor Details
-
Method Details
-
getIp
-
getPort
-
asSocket
Description copied from interface:Address
Get this address as InetSocketAddress. This is used for lookups within network implementation, so it better be fast. Preferably no new object creation should happen as part of this call. -
sameHostAs
Description copied from interface:Address
Compares only the ip+port part of the address for equality. This is used to decide whether or not to reflect messages back up without serialising. Most likely the same as "this.asSocket().equals(other.asSocket())".- Specified by:
sameHostAs
in interfaceAddress
- Parameters:
other
- the addess to compare to- Returns:
- true, if
other
is on the same port asthis
-
toString
-