public class L3Address
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BCAST
BCAST is defined to be an octet of all 1s, in each part of the address.
|
Constructor and Description |
---|
L3Address(int net,
int host)
Create an address from the net part and host part.
|
L3Address(java.lang.String bits)
Create an address from a 16-long string of 1s and 0s.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(L3Address other)
return true of this address is identical to the given one.
|
void |
fromDottedDecimal(java.lang.String in)
Convert from dotted-decimal form.
|
int |
getHost() |
int |
getNetwork()
getters
|
boolean |
isBcast()
return true if this address is the bcast address, 255.255.
|
java.lang.String |
toDottedDecimal()
Convert to dotted-decimal form: net.host
|
java.lang.String |
toString()
Convert to a string of 0s and 1s for transmission over a network.
|
public static final int BCAST
public L3Address(int net, int host)
public L3Address(java.lang.String bits)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toDottedDecimal()
public void fromDottedDecimal(java.lang.String in)
public boolean equals(L3Address other)
public boolean isBcast()
public int getNetwork()
public int getHost()