edu.usc.alfa.xalfa.ast.primitive
Class DuctNode

java.lang.Object
  extended byedu.usc.alfa.xalfa.ast.Node
      extended byedu.usc.alfa.xalfa.ast.NamedNode
          extended byedu.usc.alfa.xalfa.ast.primitive.DuctNode

public final class DuctNode
extends NamedNode

A Duct Node represents an Alfa Duct primitive. It has two properties, which determine the behavior of Duct objects.


Field Summary
static java.lang.String FIRST
          If the oldest data item is lost, when the Duct is full
static java.lang.String INITIAL
          If only the initial data item is lost
static java.lang.String LAST
          If the newest data item is lost, when the Duct is full
static java.lang.String NONE
          If the Duct is lossless
 
Constructor Summary
DuctNode(java.lang.String ID, java.lang.String name, int holds, java.lang.String loses)
          Creates a new instance of DuctNode
 
Method Summary
 void accept(edu.usc.alfa.xalfa.visitor.NodeVisitor v)
          The visitor method to analyze xAlfa objects.
 PortalNode[] getEnds()
          Get the ends of this duct
 int getHolds()
          Getter for property holds.
 java.lang.String getLoses()
          Getter for property loses.
 DuctNode getTemplate()
          Getter for property template.
 void setEnds(PortalNode[] ends)
          Setter for property ends.
 void setTemplate(DuctNode template)
          Setter for property template.
 java.lang.String toDebugString(int level)
          Generate debug information for this node.
 
Methods inherited from class edu.usc.alfa.xalfa.ast.NamedNode
getName
 
Methods inherited from class edu.usc.alfa.xalfa.ast.Node
equals, getID, getTabs, hashCode, nodeSequenceString, nodeSequenceString, toDebugString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL

public static final java.lang.String INITIAL
If only the initial data item is lost

See Also:
Constant Field Values

NONE

public static final java.lang.String NONE
If the Duct is lossless

See Also:
Constant Field Values

FIRST

public static final java.lang.String FIRST
If the oldest data item is lost, when the Duct is full

See Also:
Constant Field Values

LAST

public static final java.lang.String LAST
If the newest data item is lost, when the Duct is full

See Also:
Constant Field Values
Constructor Detail

DuctNode

public DuctNode(java.lang.String ID,
                java.lang.String name,
                int holds,
                java.lang.String loses)
Creates a new instance of DuctNode

Parameters:
ID - uniquely identifying this object
name - for manual identification
holds - the number of data items that can be buffered
loses - the kind of lossiness of this duct
Method Detail

accept

public void accept(edu.usc.alfa.xalfa.visitor.NodeVisitor v)
Description copied from class: Node
The visitor method to analyze xAlfa objects. This method is part of the Visitor pattern from GOF.

Specified by:
accept in class Node
Parameters:
v - Node Visitor that wants to visit this node.

getEnds

public PortalNode[] getEnds()
Get the ends of this duct

Returns:
the two portals at the end of this duct

setEnds

public void setEnds(PortalNode[] ends)
Setter for property ends.

Parameters:
ends - New value of property ends.

toDebugString

public java.lang.String toDebugString(int level)
Description copied from class: Node
Generate debug information for this node. Nesting levels are provided so that hierarchical information can be easily debugged. Typically, debugging information includes values of various parameters and the debugging information for internal objects

Specified by:
toDebugString in class Node
Parameters:
level - The level of visual nesting to produce in the output
Returns:
A String containing debugging information about the object.

getHolds

public int getHolds()
Getter for property holds.

Returns:
Value of property holds.

getLoses

public java.lang.String getLoses()
Getter for property loses.

Returns:
Value of property loses.

getTemplate

public DuctNode getTemplate()
Getter for property template.

Returns:
Value of property template.

setTemplate

public void setTemplate(DuctNode template)
Setter for property template.

Parameters:
template - New value of property template.