Class SCRTableHelper


  • public class SCRTableHelper
    extends java.lang.Object
    Helper functions for SCR Tables.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Patricia Derler
    Pt.AcceptedRating:
    Red (pd)
    Pt.ProposedRating:
    Red (pd)
    • Constructor Summary

      Constructors 
      Constructor Description
      SCRTableHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void checkDisjointness​(java.util.List<java.lang.String> _tableContent, int rowCount, int columnCount, FSMActor model)
      Check that all modes are unique.
      static int getContentIndex​(int rowIndex, int columnIndex, int columnCount)
      Return the content index.
      static Transition getSelfTransition​(State state)
      Returns a self transition on a given state, if there is one, null otherwise.
      static Transition getSelfTransition​(State state, Parameter parameter)
      Return the self transition.
      static int indexOfMatchingCloseBracket​(java.lang.String expression, int openingBracket)
      Search towards the right of the string.
      static int indexOfMatchingOpenBracket​(java.lang.String expression, int openingBracket)
      Search towards the left of the string.
      • Methods inherited from class java.lang.Object

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

      • SCRTableHelper

        public SCRTableHelper()
    • Method Detail

      • indexOfMatchingOpenBracket

        public static int indexOfMatchingOpenBracket​(java.lang.String expression,
                                                     int openingBracket)
        Search towards the left of the string.
        Parameters:
        expression - The expression to be searched.
        openingBracket - the index of the open bracket.
        Returns:
        The index of the matching open bracket.
      • indexOfMatchingCloseBracket

        public static int indexOfMatchingCloseBracket​(java.lang.String expression,
                                                      int openingBracket)
        Search towards the right of the string.
        Parameters:
        expression - The expression to be searched.
        openingBracket - the index of the open bracket.
        Returns:
        The index of the matching close bracket.
      • getSelfTransition

        public static Transition getSelfTransition​(State state)
        Returns a self transition on a given state, if there is one, null otherwise.
        Parameters:
        state - The given state.
        Returns:
        The self transition or null.
      • getContentIndex

        public static int getContentIndex​(int rowIndex,
                                          int columnIndex,
                                          int columnCount)
        Return the content index.
        Parameters:
        rowIndex - the index of the row.
        columnIndex - the index of the column.
        columnCount - The number of columns.
        Returns:
        the content index.
      • checkDisjointness

        public static void checkDisjointness​(java.util.List<java.lang.String> _tableContent,
                                             int rowCount,
                                             int columnCount,
                                             FSMActor model)
                                      throws IllegalActionException
        Check that all modes are unique. -- by definition Check that all values are unique. Check that pairwise OR of events in a row is always false. --- check coverage: AND of all events in a row is true
        Parameters:
        _tableContent - The table content.
        rowCount - the number of rows.
        columnCount - the number of columns.
        model - the model to be checked.
        Throws:
        IllegalActionException - If thrown while checking the disjointness.
      • getSelfTransition

        public static Transition getSelfTransition​(State state,
                                                   Parameter parameter)
        Return the self transition.
        Parameters:
        state - The state.
        parameter - the parameter.
        Returns:
        the self transition.