edu.mit.sketch.language.parser
Class AliasDef

java.lang.Object
  extended by edu.mit.sketch.language.parser.AliasDef
All Implemented Interfaces:
LadderCommand

public class AliasDef
extends java.lang.Object
implements LadderCommand

A variable/alias of a shape definition. This gives a new name to a component.


Constructor Summary
AliasDef(java.lang.String text)
          This constructs an AliasDef from the ladder text description.
AliasDef(java.lang.String type, java.lang.String name, java.lang.String oldname)
          Constructs a AliasDef.
 
Method Summary
 java.lang.String getDescription()
          Gets the description of the alias.
 java.lang.String getName()
          Gets the name of the alias.
 java.lang.String getOldName()
          Gets the component to be renamed by the alias as a string.
 java.lang.String getType()
           
 void print()
           
 void setDescription(java.lang.String desc)
          Sets the description of the alias.
 void setName(java.lang.String name)
          Sets the name of the alias.
 void setOldName(java.lang.String oldname)
          Sets the component to be renamed by the alias as a string.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AliasDef

public AliasDef(java.lang.String text)
This constructs an AliasDef from the ladder text description.

Parameters:
text - The ladder text of an AliasDef

AliasDef

public AliasDef(java.lang.String type,
                java.lang.String name,
                java.lang.String oldname)
Constructs a AliasDef.

Parameters:
name - The new name given to the component
oldname - The component to be named as a string
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

print

public void print()

setName

public void setName(java.lang.String name)
Sets the name of the alias. This is essentially the left hand side of an equation.

Parameters:
name - The name of the alias;

getName

public java.lang.String getName()
Gets the name of the alias. This is essentially the left hand side of an equation.

Returns:
The name of the alias;

setDescription

public void setDescription(java.lang.String desc)
Sets the description of the alias. This is a comment field.

Parameters:
desc - The description of the alias.

getDescription

public java.lang.String getDescription()
Gets the description of the alias. The description is a comment of the alias.

Returns:
The description of the alias.

setOldName

public void setOldName(java.lang.String oldname)
Sets the component to be renamed by the alias as a string. This is essentially the right hand side of an equation.

Parameters:
oldname - The original name of the component.

getOldName

public java.lang.String getOldName()
Gets the component to be renamed by the alias as a string. This is essentially the right hand side of an equation.

Returns:
The original name of the component.

getType

public java.lang.String getType()