Package it.unive.lisa.program.cfg
Class Parameter
- java.lang.Object
-
- it.unive.lisa.program.cfg.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, 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, Annotations annotations)Builds the parameter reference, identified by its name and its type, happening at the given location in the program.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnnotation(Annotation ann)Adds an annotations to this parameter.booleanequals(java.lang.Object obj)AnnotationsgetAnnotations()Yields the annotations of this parameter.CodeLocationgetLocation()Yields the location where this code element appears in the source file.java.lang.StringgetName()Yields the name of this parameter.TypegetStaticType()Yields the static type of this parameter.inthashCode()java.lang.StringtoString()
-
-
-
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 parametername- 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 source file. If unknown, usenullname- the name of this parameterstaticType- the type of this parameter. If unknown, useUntyped.INSTANCE
-
Parameter
public Parameter(CodeLocation location, java.lang.String name, Type staticType, 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 source file.name- the name of this parameterstaticType- the type of this parameter. If unknown, useUntyped.INSTANCEannotations- 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getLocation
public CodeLocation getLocation()
Description copied from interface:CodeElementYields the location where this code element appears in the source file.- Specified by:
getLocationin interfaceCodeElement- Returns:
- the location where this code element apperars in the source file
-
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
-
-