Package ghidra.program.model.data
Class ParameterDefinitionImpl
- java.lang.Object
-
- ghidra.program.model.data.ParameterDefinitionImpl
-
- All Implemented Interfaces:
ParameterDefinition
,java.lang.Comparable<ParameterDefinition>
public class ParameterDefinitionImpl extends java.lang.Object implements ParameterDefinition
-
-
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
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataType
checkDataType(DataType dataType, DataTypeManager dtMgr)
int
compareTo(ParameterDefinition p)
boolean
equals(java.lang.Object obj)
java.lang.String
getComment()
Get the Comment for this variableDataType
getDataType()
Get the Data Type of this variableint
getLength()
Get the length of this variablejava.lang.String
getName()
Get the Name of this variable.int
getOrdinal()
Returns the ordinal (index) of this parameter within the function signature.boolean
isEquivalent(ParameterDefinition parm)
Returns true if the specified parameter definition represents the same parameter by ordinal and dataTypeboolean
isEquivalent(Variable variable)
Returns true if the specified variable represents the same parameter by ordinal and dataTypevoid
setComment(java.lang.String comment)
Set the comment for this variablevoid
setDataType(DataType type)
Set the Data Type of this variable.void
setName(java.lang.String name)
Set the name of this variable.java.lang.String
toString()
-
-
-
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 datatype of the parametercomment
- the comment to store about this parameter.
-
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 datatype of the parametercomment
- the comment to store about this parameter.ordinal
- the index of this parameter within the function signature.
-
-
Method Detail
-
checkDataType
public static DataType checkDataType(DataType dataType, DataTypeManager dtMgr)
-
compareTo
public final int compareTo(ParameterDefinition p)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ParameterDefinition>
- See Also:
Comparable.compareTo(java.lang.Object)
-
getOrdinal
public int getOrdinal()
Description copied from interface:ParameterDefinition
Returns the ordinal (index) of this parameter within the function signature.- Specified by:
getOrdinal
in interfaceParameterDefinition
-
getComment
public java.lang.String getComment()
Description copied from interface:ParameterDefinition
Get the Comment for this variable- Specified by:
getComment
in interfaceParameterDefinition
- Returns:
- the comment
-
getDataType
public DataType getDataType()
Description copied from interface:ParameterDefinition
Get the Data Type of this variable- Specified by:
getDataType
in interfaceParameterDefinition
- Returns:
- the data type of the variable
-
getLength
public int getLength()
Description copied from interface:ParameterDefinition
Get the length of this variable- Specified by:
getLength
in interfaceParameterDefinition
- Returns:
- the length of the variable
-
getName
public java.lang.String getName()
Description copied from interface:ParameterDefinition
Get the Name of this variable.- Specified by:
getName
in interfaceParameterDefinition
- 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 interfaceParameterDefinition
- Parameters:
comment
- the comment
-
setDataType
public void setDataType(DataType type) throws InvalidInputException
Description copied from interface:ParameterDefinition
Set the Data Type of this variable. The given dataType must have a fixed length.- Specified by:
setDataType
in interfaceParameterDefinition
- Parameters:
type
- the data type- Throws:
InvalidInputException
- if data type is not a fixed length or will not fit.
-
setName
public void setName(java.lang.String name)
Description copied from interface:ParameterDefinition
Set the name of this variable.- Specified by:
setName
in interfaceParameterDefinition
- Parameters:
name
- the name
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
isEquivalent
public boolean isEquivalent(Variable variable)
Description copied from interface:ParameterDefinition
Returns true if the specified variable represents the same parameter by ordinal and dataType- Specified by:
isEquivalent
in interfaceParameterDefinition
-
isEquivalent
public boolean isEquivalent(ParameterDefinition parm)
Description copied from interface:ParameterDefinition
Returns true if the specified parameter definition represents the same parameter by ordinal and dataType- Specified by:
isEquivalent
in interfaceParameterDefinition
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-