org.jage.address
Class AbstractAddress

java.lang.Object
  extended by org.jage.address.AbstractAddress
All Implemented Interfaces:
Serializable, IAddress
Direct Known Subclasses:
AgentAddress, ComponentAddress

public abstract class AbstractAddress
extends Object
implements IAddress

This class provides a standard implementation of basic methods of addresses.

Author:
AGH AgE Team
See Also:
Serialized Form

Constructor Summary
AbstractAddress(INodeAddress nodeAddress, String userFriendlyName)
          Creates a new address.
 
Method Summary
 String getName()
          Provides a user friendly name included in this address.
 INodeAddress getNodeAddress()
          Returns an address of the node on which this address was created.
 String toString()
          Provides a standardised string representation of the address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractAddress

public AbstractAddress(INodeAddress nodeAddress,
                       String userFriendlyName)
Creates a new address.

Parameters:
nodeAddress - The current node address, cannot be null.
userFriendlyName - A user friendly name to use.
Method Detail

toString

public String toString()
Provides a standardised string representation of the address. It does not have to be unique.

This implementation returns a string of form userFriendlyName@nodeAddress.

Specified by:
toString in interface IAddress
Overrides:
toString in class Object
Returns:
A user friendly form of the address, not null.
See Also:
org.jage.address.IAddress#getUserFriendlyAddress()

getName

public String getName()
Description copied from interface: IAddress
Provides a user friendly name included in this address.

A "name" is the first part of the address - it does not contain the node address.

This user friendly name does not have to be unique.

Specified by:
getName in interface IAddress
Returns:
A user friendly name, not null.

getNodeAddress

public INodeAddress getNodeAddress()
Description copied from interface: IAddress
Returns an address of the node on which this address was created.

Specified by:
getNodeAddress in interface IAddress
Returns:
The node address, not null.


Copyright © 2006-2011 AGH University of Science and Technology. All Rights Reserved.