Class ParameterDefinitionImpl

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        ParameterDefinitionImpl​(java.lang.String name, DataType dataType, java.lang.String comment)
      Constructs a new ParameterImp with an unassigned ordinal.
      protected ParameterDefinitionImpl​(java.lang.String name, DataType dataType, java.lang.String comment, int ordinal)
      Constructs a new ParameterImp
    • Constructor Detail

      • ParameterDefinitionImpl

        public ParameterDefinitionImpl​(java.lang.String name,
                                       DataType dataType,
                                       java.lang.String comment)
        Constructs a new ParameterImp with an unassigned ordinal. The ordinal will be established by the function definition.
        Parameters:
        name - the name of the parameter.
        dataType - the fixed-length datatype of the parameter
        comment - the comment to store about this parameter.
        Throws:
        java.lang.IllegalArgumentException - if invalid parameter datatype specified
      • ParameterDefinitionImpl

        protected ParameterDefinitionImpl​(java.lang.String name,
                                          DataType dataType,
                                          java.lang.String comment,
                                          int ordinal)
        Constructs a new ParameterImp
        Parameters:
        name - the name of the parameter.
        dataType - the fixed-length datatype of the parameter
        comment - the comment to store about this parameter.
        ordinal - the index of this parameter within the function signature.
        Throws:
        java.lang.IllegalArgumentException - if invalid parameter datatype specified
    • Method Detail

      • validateDataType

        public static DataType validateDataType​(DataType dataType,
                                                DataTypeManager dtMgr,
                                                boolean voidOK)
                                         throws java.lang.IllegalArgumentException
        Check the specified datatype for use as a return, parameter or variable type. It may not be suitable for other uses. The following datatypes will be mutated into a default pointer datatype:
        • Function definition datatype
        • An unsized/zero-element array
        Parameters:
        dataType - datatype to be checked. If null specified the DEFAULT datatype will be returned.
        dtMgr - target datatype manager (null permitted which will adopt default data organization)
        voidOK - true if checking return datatype and void is allow, else false.
        Returns:
        cloned/mutated datatype suitable for function parameters and variables (including function return data type).
        Throws:
        java.lang.IllegalArgumentException - if an unacceptable datatype was specified
      • getOrdinal

        public int getOrdinal()
        Description copied from interface: ParameterDefinition
        Get the parameter ordinal
        Specified by:
        getOrdinal in interface ParameterDefinition
        Returns:
        the ordinal (index) of this parameter within the function signature.
      • getName

        public java.lang.String getName()
        Description copied from interface: ParameterDefinition
        Get the Name of this variable.
        Specified by:
        getName in interface ParameterDefinition
        Returns:
        the name of the variable or null if no name has been specified.
      • setComment

        public void setComment​(java.lang.String comment)
        Description copied from interface: ParameterDefinition
        Set the comment for this variable
        Specified by:
        setComment in interface ParameterDefinition
        Parameters:
        comment - the comment
      • setName

        public void setName​(java.lang.String name)
        Description copied from interface: ParameterDefinition
        Set the name of this variable.
        Specified by:
        setName in interface ParameterDefinition
        Parameters:
        name - the name
      • isEquivalent

        public boolean isEquivalent​(Variable variable)
        Description copied from interface: ParameterDefinition
        Determine if a variable corresponds to a parameter which is equivalent to this parameter definition by both ordinal and datatype. Name is not considered relevant.
        Specified by:
        isEquivalent in interface ParameterDefinition
        Parameters:
        variable - variable to be compared with this parameter definition.
        Returns:
        true if the specified variable represents the same parameter by ordinal and dataType. False will always be returned if specified variable is not a Parameter.
      • isEquivalent

        public boolean isEquivalent​(ParameterDefinition parm)
        Description copied from interface: ParameterDefinition
        Determine if parm is equivalent to this parameter definition by both ordinal and datatype. Name is not considered relevant.
        Specified by:
        isEquivalent in interface ParameterDefinition
        Parameters:
        parm - parameter definition to be compared with this parameter definition.
        Returns:
        true if the specified parameter definition represents the same parameter by ordinal and dataType.
      • toString

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