ptolemy.codegen.kernel
Class CodeStream.Signature

java.lang.Object
  extended by ptolemy.codegen.kernel.CodeStream.Signature
All Implemented Interfaces:
java.lang.Comparable
Enclosing class:
CodeStream

public static class CodeStream.Signature
extends java.lang.Object
implements java.lang.Comparable

Inner class for representing a code block signature.


Field Summary
 java.lang.String functionName
          The code block name.
 int numParameters
          The number of parameters.
 
Constructor Summary
private CodeStream.Signature(java.lang.String functionName, int numParameters)
          Constructor for a code block signature.
 
Method Summary
 int compareTo(java.lang.Object object)
          Compare this signature to the given object by comparing their string representation lexicographically.
 boolean equals(java.lang.Object object)
          Return true if the given object is equal to this signature.
 int hashCode()
          Return the hash code for this channel.
 java.lang.String toString()
          Return the string format of this code block signature.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

functionName

public java.lang.String functionName
The code block name.


numParameters

public int numParameters
The number of parameters.

Constructor Detail

CodeStream.Signature

private CodeStream.Signature(java.lang.String functionName,
                             int numParameters)
                      throws IllegalActionException
Constructor for a code block signature. It consists of the code block name and the number of parameters.

Parameters:
functionName - The given code block name.
numParameters - The number of parameters.
Throws:
IllegalActionException - Thrown if the given name is null, or the number of parameters is less than zero.
Method Detail

compareTo

public int compareTo(java.lang.Object object)
Compare this signature to the given object by comparing their string representation lexicographically. Each signature has an unique string representation (See toString()).

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - The given object.
Returns:
A negative integer if this signature precedes the given object, or a positive integer if the given object precedes this signature. Otherwise, it returns the value zero, which indicates that they are equal.

equals

public boolean equals(java.lang.Object object)
Return true if the given object is equal to this signature.

Overrides:
equals in class java.lang.Object
Parameters:
object - The given object.
Returns:
true if the given object is equal to this signature, otherwise false.

hashCode

public int hashCode()
Return the hash code for this channel. Implementing this method is required for comparing the equality of channels.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code for this channel.

toString

public java.lang.String toString()
Return the string format of this code block signature.

Overrides:
toString in class java.lang.Object