Class Antecedent

    • Field Detail

      • rbx

        static final java.util.ResourceBundle rbx
    • Method Detail

      • getDeepCopy

        public Base getDeepCopy​(java.util.Map<java.lang.String,​java.lang.String> systemNames,
                                java.util.Map<java.lang.String,​java.lang.String> userNames)
                         throws JmriException
        Description copied from interface: Base
        Create a deep copy of myself and my children The item needs to try to lookup itself in both systemNames and userNames to see if the user has given a new system name and/or a new user name.If no new system name is given, an auto system name is used. If no user name is given, a null user name is used.
        Specified by:
        getDeepCopy in interface Base
        Parameters:
        systemNames - a map of old and new system name
        userNames - a map of old system name and new user name
        Returns:
        a deep copy
        Throws:
        JmriException - in case of an error
      • getChild

        public FemaleSocket getChild​(int index)
                              throws java.lang.IllegalArgumentException,
                                     java.lang.UnsupportedOperationException
        Description copied from class: AbstractBase
        Get a child of this item
        Specified by:
        getChild in interface Base
        Overrides:
        getChild in class AbstractBase
        Parameters:
        index - the index of the child to get
        Returns:
        the child
        Throws:
        java.lang.IllegalArgumentException - if the index is less than 0 or greater or equal with the value returned by getChildCount()
        java.lang.UnsupportedOperationException
      • getShortDescription

        public java.lang.String getShortDescription​(java.util.Locale locale)
        Description copied from interface: Base
        Get a short description of this item.
        Specified by:
        getShortDescription in interface Base
        Parameters:
        locale - The locale to be used
        Returns:
        a short description
      • getLongDescription

        public java.lang.String getLongDescription​(java.util.Locale locale)
        Description copied from interface: Base
        Get a long description of this item.
        Specified by:
        getLongDescription in interface Base
        Parameters:
        locale - The locale to be used
        Returns:
        a long description
      • setup

        public void setup()
        Setup this object and its children. This method is used to lookup system names for child sockets, turnouts, sensors, and so on.
        Specified by:
        setup in interface Base
      • validateAntecedent

        public java.lang.String validateAntecedent​(java.lang.String ant,
                                                   java.util.List<Antecedent.ExpressionEntry> expressionEntryList)
                                            throws JmriException
        Check that an antecedent is well formed.
        Parameters:
        ant - the antecedent string description
        expressionEntryList - arraylist of existing ExpressionEntries
        Returns:
        error message string if not well formed
        Throws:
        JmriException - when an exception occurs
      • parseCalculate

        Antecedent.DataPair parseCalculate​(java.lang.String s,
                                           java.util.List<Antecedent.ExpressionEntry> expressionEntryList)
                                    throws JmriException
        Parses and computes one parenthesis level of a boolean statement.

        Recursively calls inner parentheses levels. Note that all logic operators are detected by the parsing, therefore the internal negation of a variable is washed.

        Parameters:
        s - The expression to be parsed
        expressionEntryList - ExpressionEntries for R1, R2, etc
        Returns:
        a data pair consisting of the truth value of the level a count of the indices consumed to parse the level and a bitmap of the variable indices used.
        Throws:
        JmriException - if unable to compute the logic
      • disposeMe

        public void disposeMe()
        Dispose this class. Listeners do not need to be unregistered by this method since they are unregistered by dispose().
        Overrides:
        disposeMe in class AbstractBase