Package org.jcsp.net

# Class LinkFactory.Builder

java.lang.Object
org.jcsp.net.LinkFactory.Builder

Enclosing class:
  `LinkFactory`

public abstract static class LinkFactory.Builder extends Object
An abstract inner class which should be implemented by comunication protocol implementations. The `Builder` class provides an abstract method which should be implemented to take a `NodeAddressID` object which should be used to construct a `Link` which is then returned by the method to the factory.

## Constructor Summary

Constructors
Constructor
Description
`Builder(ProtocolID protocolID)`
A constructor which takes the `ProtocolID` identifying the protocol that this `Builder` supports.

## Method Summary

Modifier and Type
Method
Description
`final ProtocolID`
`getProtocolID()`
Gets the `ProtocolID` that this `Builder` supports.
`abstract Link`
`testAndBuild(NodeAddressID addressID)`
Takes a `NodeAddressID` and constructs and returns a `Link` object.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Builder

public Builder(ProtocolID protocolID)
A constructor which takes the `ProtocolID` identifying the protocol that this `Builder` supports. This must be called by sub-classes.

Parameters:
  `protocolID` - the `ProtocolID` for the protocol that the implementation supports.

## Method Details

### testAndBuild

public abstract Link testAndBuild(NodeAddressID addressID) throws IllegalArgumentException
Takes a `NodeAddressID` and constructs and returns a `Link` object.

Parameters:
  `addressID` - the `AddressID` for the remote Node.
Returns:
  the constructed `Link`.
Throws:
  `IllegalArgumentException` - if the `AddressID` object is invalid.

### getProtocolID

public final ProtocolID getProtocolID()
Gets the `ProtocolID` that this `Builder` supports.

Returns:
  the `ProtocolID` that this `Builder` supports.