org.avineas.fins
public final class Address extends java.lang.Object
Constructor and Description |
---|
Address()
Default constructor.
|
Address(byte[] from,
int offset)
Construct an address from a byte array, normally part of a frame.
|
Address(int na,
int nn,
int unit)
Construct an address with specific network, node and unit numbers.
|
Address(java.lang.String addr)
Construct an address from a string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
byte |
getNetworkAddress()
Get the network address.
|
java.lang.String |
getNodeAsString()
Get the node part of this address as string value.
|
byte |
getNodeNumber()
Get the node number.
|
byte |
getUnitAddress()
Get the unit address value of this address.
|
int |
hashCode() |
void |
set(byte[] to,
int offset)
Encode this address into a message, normally a FINS packet or frame.
|
void |
setNetworkAddress(byte networkAddress)
Set the network address, this is the first byte of the FINS addressing.
|
void |
setNodeNumber(byte nodeNumber)
Set the node number of this address.
|
void |
setUnitAddress(byte unitAddress)
Set the unit address.
|
java.lang.String |
toString() |
public Address()
public Address(byte[] from, int offset)
from
- The byte array to extract the address fromoffset
- The offset in the byte array to start the decodingpublic Address(int na, int nn, int unit)
na
- The network addressnn
- The node addressunit
- The unit on the nodepublic Address(java.lang.String addr)
addr
- The string representation of the addresspublic byte getNetworkAddress()
public void setNetworkAddress(byte networkAddress)
networkAddress
- The network address of this address objectpublic byte getNodeNumber()
public void setNodeNumber(byte nodeNumber)
nodeNumber
- The node numberpublic byte getUnitAddress()
public void setUnitAddress(byte unitAddress)
unitAddress
- The unit address to setpublic void set(byte[] to, int offset)
to
- The byte array to encode the address inoffset
- The offset to start in the byte arraypublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getNodeAsString()