Package org.jcsp.net2
Class NetChannelLocation
- java.lang.Object
-
- org.jcsp.net2.NetLocation
-
- org.jcsp.net2.NetChannelLocation
-
- All Implemented Interfaces:
java.io.Serializable
public final class NetChannelLocation extends NetLocation implements java.io.Serializable
This class is a data structure representing the location of a NetChannelInput in a network. The NetChannelLocation consists of the NodeID of the Node on which the NetChannelInput resides, and its Virtual Channel Number, which is the number uniquely identifying the NetChannelInput on said Node.To acquire the NetChannelLocation of a NetBarrier, use the getLocation method:
NetChannelLocation location = (NetChannelLocation)chan.getLocation();
The location returned depends on whether the channel is a NetChannelInput or a NetChannelOutput end. An input end will return its own location. An output end will return the location of the input end it is connected to. This is because we consider a networked channel to be a single, virtual construct, with only one location. That location is where the input end is located.
- See Also:
NetChannelInput
,NetChannelOutput
,NetLocation
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private NodeID
nodeID
The NodeID portion of the locationprivate static long
serialVersionUID
The SUID representing this classprivate int
vcn
The vcn portion of the location
-
Constructor Summary
Constructors Constructor Description NetChannelLocation(NodeID aNodeID, int aVCN)
Creates a new NetChannelLocation
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeAddress
getNodeAddress()
Gets the NodeAddress part of the locationNodeID
getNodeID()
Gets the NodeID part of the locationint
getVCN()
Gets the vcn part of the locationstatic NetChannelLocation
parse(java.lang.String str)
Converts the string form of a NetChannelLocation back into its object formjava.lang.String
toString()
Converts the NetChannelLocation object into a string representation of the form ncl://[NodeID]/[VCN]
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The SUID representing this class- See Also:
- Constant Field Values
-
nodeID
private final NodeID nodeID
The NodeID portion of the location
-
vcn
private final int vcn
The vcn portion of the location
-
-
Constructor Detail
-
NetChannelLocation
public NetChannelLocation(NodeID aNodeID, int aVCN)
Creates a new NetChannelLocation- Parameters:
aNodeID
- The NodeID part of the locationaVCN
- The vcn part of the location
-
-
Method Detail
-
getNodeID
public NodeID getNodeID()
Gets the NodeID part of the location- Specified by:
getNodeID
in classNetLocation
- Returns:
- The NodeID part of the NetChannelLocation
-
getNodeAddress
public NodeAddress getNodeAddress()
Gets the NodeAddress part of the location- Specified by:
getNodeAddress
in classNetLocation
- Returns:
- The NodeAddress part of the NetChannelLocation
-
getVCN
public int getVCN()
Gets the vcn part of the location- Returns:
- The VCN part of the NetChannelLocation
-
toString
public java.lang.String toString()
Converts the NetChannelLocation object into a string representation of the form ncl://[NodeID]/[VCN]- Overrides:
toString
in classjava.lang.Object
- Returns:
- The String form of the NetChannelLocation
-
parse
public static NetChannelLocation parse(java.lang.String str)
Converts the string form of a NetChannelLocation back into its object form- Parameters:
str
- The string representation of a NetChannelLocation- Returns:
- A new NetChannelLocation created from the String representation
-
-