Class ActorTypeUtil


  • public class ActorTypeUtil
    extends java.lang.Object

    This class includes a number of utility methods and classes that simplify the generation of type constraints.

    Since:
    Ptolemy II 6.1
    Version:
    $Id$
    Author:
    Stephen neuendorffer
    Pt.AcceptedRating:
    Red (neuendor)
    Pt.ProposedRating:
    Red (neuendor)
    • Constructor Summary

      Constructors 
      Constructor Description
      ActorTypeUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static InequalityTerm arrayOf​(Typeable typeable, Variable length)
      Return a type constraint that can be used to constrain another typeable object to have a type related to an array whose element type is the type of the specified typeable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ActorTypeUtil

        public ActorTypeUtil()
    • Method Detail

      • arrayOf

        public static InequalityTerm arrayOf​(Typeable typeable,
                                             Variable length)
                                      throws IllegalActionException
        Return a type constraint that can be used to constrain another typeable object to have a type related to an array whose element type is the type of the specified typeable. A typical usage of this is as follows:
              output.setTypeAtLeast(ArrayType.arrayOf(input, length));
          
        where input and output are ports (this is the type constraint of SequenceToArray, for example), and length is a Variable that determines the length of the array. If length has a constant value, then the resulting type will have a length specified. If length does not have a constant value, the the type will have an indeterminate length.
        Parameters:
        typeable - A typeable.
        length - Variable specifying the length of array.
        Returns:
        An InequalityTerm that can be passed to methods like setTypeAtLeast() of the Typeable interface.
        Throws:
        IllegalActionException - If the specified typeable cannot be set to an array type.