Class Parameter

  • All Implemented Interfaces:
    CodeElement

    public class Parameter
    extends java.lang.Object
    implements CodeElement
    A CFG parameter identified by its name and its type, containing the information about the source file, line and column where the parameter is defined. No information about the CFG where the parameter appears is contained.
    • Constructor Summary

      Constructors 
      Constructor Description
      Parameter​(CodeLocation location, java.lang.String name)
      Builds an untyped parameter reference, identified by its name.
      Parameter​(CodeLocation location, java.lang.String name, Expression defaultValue)
      Builds the parameter reference, identified by its name and its type, happening at the given location in the program.
      Parameter​(CodeLocation location, java.lang.String name, Type staticType)
      Builds the parameter reference, identified by its name and its type, happening at the given location in the program.
      Parameter​(CodeLocation location, java.lang.String name, Type staticType, Expression defaultValue, Annotations annotations)
      Builds the parameter reference, identified by its name and its type, happening at the given location in the program.
    • Constructor Detail

      • Parameter

        public Parameter​(CodeLocation location,
                         java.lang.String name)
        Builds an untyped parameter reference, identified by its name. The type of this parameter is unknown (i.e. it is {#link Untyped#INSTANCE}).
        Parameters:
        location - the location of this parameter
        name - the name of this parameter
      • Parameter

        public Parameter​(CodeLocation location,
                         java.lang.String name,
                         Type staticType)
        Builds the parameter reference, identified by its name and its type, happening at the given location in the program.
        Parameters:
        location - the location where this parameter is defined within the program
        name - the name of this parameter
        staticType - the type of this parameter. If unknown, use Untyped.INSTANCE
      • Parameter

        public Parameter​(CodeLocation location,
                         java.lang.String name,
                         Expression defaultValue)
        Builds the parameter reference, identified by its name and its type, happening at the given location in the program.
        Parameters:
        location - the location where this parameter is defined within the program
        name - the name of this parameter
        defaultValue - the default value for this parameter that can be used when a call does not specify a value for it
      • Parameter

        public Parameter​(CodeLocation location,
                         java.lang.String name,
                         Type staticType,
                         Expression defaultValue,
                         Annotations annotations)
        Builds the parameter reference, identified by its name and its type, happening at the given location in the program.
        Parameters:
        location - the location where this parameter is defined within the program
        name - the name of this parameter
        staticType - the type of this parameter. If unknown, use Untyped.INSTANCE
        defaultValue - the default value for this parameter that can be used when a call does not specify a value for it
        annotations - the annotations of this parameter
    • Method Detail

      • getName

        public java.lang.String getName()
        Yields the name of this parameter.
        Returns:
        the name of this parameter
      • getStaticType

        public Type getStaticType()
        Yields the static type of this parameter.
        Returns:
        the static type of this parameter
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

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

        public CodeLocation getLocation()
        Description copied from interface: CodeElement
        Yields the location where this code element appears in the program.
        Specified by:
        getLocation in interface CodeElement
        Returns:
        the location where this code element appears in the program
      • getAnnotations

        public Annotations getAnnotations()
        Yields the annotations of this parameter.
        Returns:
        the annotations of this parameter
      • addAnnotation

        public void addAnnotation​(Annotation ann)
        Adds an annotations to this parameter.
        Parameters:
        ann - the annotation to be added
      • getDefaultValue

        public Expression getDefaultValue()
        Yields the default value for this parameter that can be used when a call does not specify a value for it.
        Returns:
        the default value
      • toSymbolicVariable

        public Variable toSymbolicVariable()
        Creates a Variable that represent this parameter, that can be used by SemanticDomains to reference this parameter.
        Returns:
        the variable representing this parameter