jcontrol.comm.eia709
Class Eia709Address

java.lang.Object
  extended by jcontrol.comm.eia709.Eia709Address

public class Eia709Address
extends Object

Represents an EIA-709.1 address that can be used as target addresses for network variables and "normal" application messages. Address types 0, 1 and 2a are supported. 2b and 3 are special purpose addresses which cannot be used for application messages. An address can only be created in the context of a node.


Constructor Summary
protected Eia709Address(Eia709Node node, int id)
          Constructor used by Eia709NetworkVariable.getEia709Address()
 
Method Summary
static Eia709Address createAddressType0(Eia709Node node, int dstSubnet)
          Creates a type 0 address.
static Eia709Address createAddressType1(Eia709Node node, int dstGroup)
          Creates a type 1 address.
static Eia709Address createAddressType2a(Eia709Node node, int dstSubnet, int dstNode)
          Creates a type 2a address.
 int getAddressType()
          Returns the address type.
 int getDstGroup()
          Returns DstGroup, if address type is ADDRESS_TYPE_1, otherwise throws an IllegalArgumentException.
 int getDstNode()
          Returns DstNode, if address type is ADDRESS_TYPE_2A, otherwise throws an IllegalArgumentException.
 int getDstSubnet()
          Returns DstSubnet, if address type is ADDRESS_TYPE_0 or ADDRESS_TYPE_2A, otherwise throws an IllegalArgumentException.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notifyAll, toString, wait
 

Constructor Detail

Eia709Address

protected Eia709Address(Eia709Node node,
                        int id)
Constructor used by Eia709NetworkVariable.getEia709Address()

Parameters:
node - the node the address should be added to
id - the internal address id
Method Detail

createAddressType0

public static Eia709Address createAddressType0(Eia709Node node,
                                               int dstSubnet)
Creates a type 0 address.

Parameters:
node - the node the address should be added to
dstSubnet - DstSubnet
Returns:
newly created address

createAddressType1

public static Eia709Address createAddressType1(Eia709Node node,
                                               int dstGroup)
Creates a type 1 address.

Parameters:
node - the node the address should be added to
dstGroup - DstGroup
Returns:
newly created address

createAddressType2a

public static Eia709Address createAddressType2a(Eia709Node node,
                                                int dstSubnet,
                                                int dstNode)
Creates a type 2a address.

Parameters:
node - the node the address should be added to
dstSubnet - DstSubnet
dstNode - DstNode
Returns:
newly created address

getAddressType

public int getAddressType()
Returns the address type.

Returns:
address type (ADDRESS_TYPE_0, ADDRESS_TYPE_1 or ADDRESS_TYPE_2A)
See Also:
Eia709Constants.ADDRESS_TYPE_0, Eia709Constants.ADDRESS_TYPE_1, Eia709Constants.ADDRESS_TYPE_2A

getDstGroup

public int getDstGroup()
Returns DstGroup, if address type is ADDRESS_TYPE_1, otherwise throws an IllegalArgumentException.

Returns:
DstGroup
See Also:
createAddressType1(Eia709Node, int), Eia709Constants.ADDRESS_TYPE_1

getDstSubnet

public int getDstSubnet()
Returns DstSubnet, if address type is ADDRESS_TYPE_0 or ADDRESS_TYPE_2A, otherwise throws an IllegalArgumentException.

Returns:
DstSubnet
See Also:
createAddressType0(Eia709Node, int), createAddressType2a(Eia709Node, int, int), Eia709Constants.ADDRESS_TYPE_0, Eia709Constants.ADDRESS_TYPE_2A

getDstNode

public int getDstNode()
Returns DstNode, if address type is ADDRESS_TYPE_2A, otherwise throws an IllegalArgumentException.

Returns:
DstNode
See Also:
createAddressType2a(Eia709Node, int, int), Eia709Constants.ADDRESS_TYPE_2A