Class c2.framework.Port
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class c2.framework.Port

java.lang.Object
   |
   +----c2.framework.Port

public class Port
extends Object
Components and connectors in an architecture exchange messages through communication ports. A port cannot exist independently of a brick (component or connector) and can be linked to at most one other port.

NOTE: This class should not be used directly. Use either FIFOPort or one of its derived classes.

See Also:
Component, Connector, FIFOPort

Variable Index

 o belongs_to
Component or connector to which the port belongs.
 o link
Component or connector to which the port is linked.

Constructor Index

 o Port()
 o Port(Brick)

Method Index

 o belongsTo()
Accesses the brick to which the port belongs.
 o belongsTo(Brick)
(Re)assigns a port to a brick.
 o className()
Accesses the name of the class.
 o classType()
Accesses the class itself.
 o debugPrint(String)
Prints a string to System.err.
 o debugPrintln(String)
Prints a string to System.err.
 o Link()
Accesses the port to which the port is linked.
 o receive(Message)
Receives a message and notifies its brick.
 o selectNextIncomingMessage()
Selects a message from the incoming queue.
 o selectNextOutgoingMessage()
Selects a message from the outgoing queue.
 o send(Message)
Sends a message if the port is attached to another port.
 o toString()
Displays information about the port.
 o weld(Port)
Welds this port to another port.

Variables

 o belongs_to
  protected Brick belongs_to
Component or connector to which the port belongs.
 o link
  protected Port link
Component or connector to which the port is linked.

Constructors

 o Port
  public Port()
 o Port
  public Port(Brick b)

Methods

 o className
  protected static String className()
Accesses the name of the class.
Returns:
Port class name.
 o classType
  public static Class classType()
Accesses the class itself.
Returns:
Port class.
 o Link
  public Port Link()
Accesses the port to which the port is linked.
Returns:
Port to which this port is linked.
 o belongsTo
  public Brick belongsTo()
Accesses the brick to which the port belongs.
Returns:
Brick to which the port belongs.
 o belongsTo
  public void belongsTo(Brick b)
(Re)assigns a port to a brick.
Parameters:
brick - Brick to which the port is assigned.
 o weld
  public void weld(Port p)
Welds this port to another port. param p Port to which this port is welded.
 o receive
  public void receive(Message msg)
Receives a message and notifies its brick.
Parameters:
msg - Received message.
 o send
  public void send(Message msg)
Sends a message if the port is attached to another port.
Parameters:
msg - Message to be sent.
 o selectNextIncomingMessage
  public abstract Message selectNextIncomingMessage()
Selects a message from the incoming queue. Not implemented in this class.
 o selectNextOutgoingMessage
  public abstract Message selectNextOutgoingMessage()
Selects a message from the outgoing queue. Not implemented in this class.
 o toString
  public String toString()
Displays information about the port. Used for debugging.
Overrides:
toString in class Object
 o debugPrintln
  public void debugPrintln(String s)
Prints a string to System.err. See debugPrintln in Brick.
See Also:
Brick
 o debugPrint
  public void debugPrint(String s)
Prints a string to System.err. See debugPrintln in Brick.
See Also:
Brick

All Packages  Class Hierarchy  This Package  Previous  Next  Index