public class IpAddress
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
int |
b0
First octet of IP address
|
int |
b1
Second octet of IP address
|
int |
b2
Third octet of IP address
|
int |
b3
Fourth octet of IP address
|
| Constructor and Description |
|---|
IpAddress()
Default constructor, sets IP to 0.0.0.0
|
IpAddress(int ip)
Convert IP as integer to an IpAddress object
|
IpAddress(java.lang.String ipAddressAsString)
Convert IP as String in dotted notation, to an IpAddress object
|
| Modifier and Type | Method and Description |
|---|---|
int |
asInteger()
Returns value of IP address as integer.
|
void |
maskByInvertedSubnet(IpAddress subnet)
Masks the IpAddress by the inversion of subnet, to obtain a numeric IP broadcast address.
|
void |
maskBySubnet(IpAddress subnet)
Masks the IpAddress by the specified subnet, to obtain a numeric IP network identifier.
|
java.lang.String |
toString()
Returns IP address in dotted notation
|
public int b0
public int b1
public int b2
public int b3
public IpAddress()
public IpAddress(int ip)
ip - - IP address as intpublic IpAddress(java.lang.String ipAddressAsString)
ipAddressAsString - IP in dotted notationpublic int asInteger()
public void maskBySubnet(IpAddress subnet)
subnet - as IpAddress typepublic void maskByInvertedSubnet(IpAddress subnet)
subnet - as IpAddress typepublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2009 Eurotech Inc. All rights reserved.