org.primordion.xholon.base
Class PortInterface

java.lang.Object
  extended byorg.primordion.xholon.base.PortInterface
All Implemented Interfaces:
IPortInterface

public class PortInterface
extends java.lang.Object
implements IPortInterface

A port interface is either a provided or a required interface for one or more ports.

Since:
0.4 (Created on August 21, 2006)
Author:
Ken Webb

Field Summary
 
Fields inherited from interface org.primordion.xholon.base.IPortInterface
SIGNAL_ID_NOT_FOUND, SIGNAL_NAME_NOT_FOUND
 
Constructor Summary
PortInterface()
           
 
Method Summary
 int[] getInterface()
          Get the provided or required interface of this port.
 java.lang.String[] getInterfaceNames()
          Get the names of the signals in the provided or required interface of this port.
 int getSignalId(java.lang.String name)
          Get the ID of an interface signal, given its name.
 java.lang.String getSignalName(int id)
          Get the name of an interface signal, given its ID.
 int getSize()
          Get number of signals in this provided or required interface.
 void setInterface(int[] nterface)
          Set the provided or required interface of this port.
 void setInterfaceNames(java.lang.String[] nterfaceNames)
          Set the names of the signals in the provided or required interface of this port.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortInterface

public PortInterface()
Method Detail

getInterface

public int[] getInterface()
Description copied from interface: IPortInterface
Get the provided or required interface of this port.

Specified by:
getInterface in interface IPortInterface
Returns:
An array of zero or more signal IDs.

setInterface

public void setInterface(int[] nterface)
Description copied from interface: IPortInterface
Set the provided or required interface of this port.

Specified by:
setInterface in interface IPortInterface
Parameters:
nterface - An array of zero or more signal IDs.

getInterfaceNames

public java.lang.String[] getInterfaceNames()
Description copied from interface: IPortInterface
Get the names of the signals in the provided or required interface of this port. The array is orderd corresponding to the order of the signal IDs obtained by calling getInterface().

Specified by:
getInterfaceNames in interface IPortInterface
Returns:
An array of zero or more signal names.

setInterfaceNames

public void setInterfaceNames(java.lang.String[] nterfaceNames)
Description copied from interface: IPortInterface
Set the names of the signals in the provided or required interface of this port.

Specified by:
setInterfaceNames in interface IPortInterface
Parameters:
nterfaceNames - An array of zero or more signal names. These should be in the same order as the corresponding signal IDs used in setInterface().

getSignalId

public int getSignalId(java.lang.String name)
Description copied from interface: IPortInterface
Get the ID of an interface signal, given its name.

Specified by:
getSignalId in interface IPortInterface
Parameters:
name - The name of a signal.
Returns:
The ID corresponding to that signal, or SIGNAL_ID_NOT_FOUND if no ID is available.

getSignalName

public java.lang.String getSignalName(int id)
Description copied from interface: IPortInterface
Get the name of an interface signal, given its ID.

Specified by:
getSignalName in interface IPortInterface
Parameters:
id - A signal ID.
Returns:
The name corresponding to that ID, or a string version of the ID if no name is available, or SIGNAL_NAME_NOT_FOUND if it's an invalid ID.

getSize

public int getSize()
Description copied from interface: IPortInterface
Get number of signals in this provided or required interface.

Specified by:
getSize in interface IPortInterface
Returns:
The size of the signal array.