|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.voytechs.jnetstream.primitive.address.Address
com.voytechs.jnetstream.primitive.address.IpNetwork
public class IpNetwork
This class manipulates a IP address as a network address it requires 2 values, address and netmask. Netmask is applied to the various operations that this class supports such as comparisons and sorting.
| Field Summary | |
|---|---|
static boolean |
debug1
|
| Fields inherited from class com.voytechs.jnetstream.primitive.address.Address |
|---|
address, debug, DEFAULT_NUMBER_BASE, format, separator |
| Constructor Summary | |
|---|---|
IpNetwork(Address ip,
int bitsInMask)
|
|
IpNetwork(Address ip,
IpNetmask mask)
|
|
IpNetwork(byte[] byteAddress,
IpNetmask mask)
|
|
IpNetwork(java.lang.String network,
int bitsInMask)
This form initializes the network number by creating a netmask from the number of bits within the mask. |
|
IpNetwork(java.lang.String network,
IpNetmask mask)
|
|
| Method Summary | |
|---|---|
int |
compareTo(byte[] comp)
|
int |
compareTo(java.lang.Object o)
|
boolean |
equals(java.lang.Object o)
Compare our byte values for IP address to the object's. |
Address |
getLowerBounds()
A getter method which returns lower network boundary based on the netmasked network address. |
IpNetmask |
getNetmask()
|
Address |
getNetmasked()
Returns an Address with the netmask applied to it. |
Address |
getUpperBounds()
A getter moethd which returns the upper network boundary based on the netmasked networked address. |
boolean |
isPartOf(java.lang.Object o)
|
static void |
main(java.lang.String[] args)
Test function for IpNetwork |
static IpNetwork |
parseIpNetwork(java.lang.String networkString)
Parse the string representing a network entry. |
byte[] |
toByteArray()
Overrides the default byteArrayValue method and applies the network netmask to the IP number. |
java.lang.String |
toString()
Convert to dot notation string representation of the address |
| Methods inherited from class com.voytechs.jnetstream.primitive.address.Address |
|---|
AND, AND, byteArrayValue, compare, compare, EOR, EOR, getByte, getByte, getRadix, INVERT, INVERT, longToByteArray, OR, OR, parseByteArray, setAddress, setByteArrayAddress, setFormat, setFormat, setRadix, setSeparator, stringValue, toString, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean debug1
| Constructor Detail |
|---|
public IpNetwork(java.lang.String network,
int bitsInMask)
network - The network number IP addressbitsInMask -
public IpNetwork(java.lang.String network,
IpNetmask mask)
public IpNetwork(byte[] byteAddress,
IpNetmask mask)
public IpNetwork(Address ip,
int bitsInMask)
public IpNetwork(Address ip,
IpNetmask mask)
| Method Detail |
|---|
public IpNetmask getNetmask()
public Address getLowerBounds()
public Address getUpperBounds()
public byte[] toByteArray()
toByteArray in class Addresspublic Address getNetmasked()
base & netmask
public boolean equals(java.lang.Object o)
Address
equals in class Addresso - Address object to campare to.
public boolean isPartOf(java.lang.Object o)
public static IpNetwork parseIpNetwork(java.lang.String networkString)
networkString - String network in form 'n1.n2.n3.n4/m1.m2.m3.m4'public java.lang.String toString()
Address
toString in class Addresspublic int compareTo(byte[] comp)
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.ComparablecompareTo in class Addresspublic static void main(java.lang.String[] args)
args - command line arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||