public class InputVariable extends Object implements VariableReference
InputVariable class.
| Modifier and Type | Field and Description |
|---|---|
protected GenericClass |
type
Type (class) of the variable
|
| Constructor and Description |
|---|
InputVariable(Type clazz,
int num)
Constructor for InputVariable.
|
| Modifier and Type | Method and Description |
|---|---|
void |
changeClassLoader(ClassLoader loader)
changeClassLoader
|
VariableReference |
clone()
Create a copy of the current variable
|
VariableReference |
clone(TestCase newTest)
Create a copy of the current variable for new test
|
int |
compareTo(VariableReference other) |
VariableReference |
copy(TestCase newTest,
int offset)
Create a copy of the current variable for new test
|
VariableReference |
getAdditionalVariableReference()
getAdditionalVariableReference
|
String |
getClassName()
Return class name
|
Class<?> |
getComponentClass()
Return raw class of this variable's component
|
String |
getComponentName()
getComponentName
|
Type |
getComponentType()
getComponentType
|
Object |
getDefaultValue()
getDefaultValue
|
String |
getDefaultValueString()
getDefaultValueString
|
int |
getDistance()
Distance metric used to select variables for mutation based on how close
they are to the SUT
|
GenericClass |
getGenericClass()
getGenericClass
|
String |
getName()
Return name for source code representation
|
Object |
getObject(Scope scope)
Return the actual object represented by this variable for a given scope
|
String |
getOriginalCode()
Getter for the field
originalCode. |
String |
getSimpleClassName()
Return simple class name
|
int |
getStPosition()
The position of the statement, defining this VariableReference, in the
testcase.
|
TestCase |
getTestCase()
getTestCase
|
Type |
getType()
Return type of this variable
|
Class<?> |
getVariableClass()
Return raw class of this variable
|
boolean |
isAccessible()
Return true if we can validly access this variable.
|
boolean |
isArray()
Return true if variable is an array
|
boolean |
isArrayIndex()
Return true if this is an index into an array variable
|
boolean |
isAssignableFrom(Type other)
Return true if other type can be assigned to this variable
|
boolean |
isAssignableFrom(VariableReference other)
Return true if other type can be assigned to this variable
|
boolean |
isAssignableTo(Type other)
Return true if this variable can by assigned to a variable of other type
|
boolean |
isAssignableTo(VariableReference other)
Return true if this variable can by assigned to a variable of other type
|
boolean |
isEnum()
Return true if variable is an enumeration
|
boolean |
isFieldReference()
Return true if this is a reference to a public field
|
boolean |
isPrimitive()
Return true if variable is a primitive type
|
boolean |
isString()
Return true if variable is a string
|
boolean |
isVoid()
Return true if variable is void
|
boolean |
isWrapperType()
Return true if type of variable is a primitive wrapper
|
void |
loadBytecode(org.objectweb.asm.commons.GeneratorAdapter mg,
Map<Integer,Integer> locals)
loadBytecode
|
void |
replaceAdditionalVariableReference(VariableReference var1,
VariableReference var2)
replaceAdditionalVariableReference
|
boolean |
same(VariableReference r)
same
|
void |
setAdditionalVariableReference(VariableReference var)
setAdditionalVariableReference
|
void |
setDistance(int distance)
Set the distance metric
|
void |
setObject(Scope scope,
Object value)
Set the actual object represented by this variable in a given scope
|
void |
setOriginalCode(String originalCode)
Set the code fragment that defined this variable reference if imported
from an existing test case.
|
void |
setType(Type type)
Set type of this variable
|
void |
storeBytecode(org.objectweb.asm.commons.GeneratorAdapter mg,
Map<Integer,Integer> locals)
storeBytecode
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoStringprotected GenericClass type
public int getStPosition()
getStPosition in interface VariableReferencepublic int getDistance()
getDistance in interface VariableReferencepublic void setDistance(int distance)
setDistance in interface VariableReferencedistance - a int.public VariableReference clone(TestCase newTest)
clone in interface VariableReferencenewTest - a TestCase object.VariableReference object.public VariableReference clone()
clone in interface VariableReferenceclone in class ObjectVariableReference object.public VariableReference copy(TestCase newTest, int offset)
copy in interface VariableReferencenewTest - a TestCase object.offset - a int.VariableReference object.public String getClassName()
getClassName in interface VariableReferenceString object.public String getComponentName()
getComponentName
getComponentName in interface VariableReferenceString object.public Type getComponentType()
getComponentType
getComponentType in interface VariableReferenceType object.public boolean isAccessible()
VariableReferenceisAccessible in interface VariableReferencepublic boolean isArray()
VariableReferenceisArray in interface VariableReferencepublic boolean isArrayIndex()
VariableReferenceisArrayIndex in interface VariableReferencepublic boolean isEnum()
isEnum in interface VariableReferencepublic boolean isPrimitive()
isPrimitive in interface VariableReferencepublic boolean isVoid()
isVoid in interface VariableReferencepublic boolean isString()
isString in interface VariableReferencepublic boolean isWrapperType()
isWrapperType in interface VariableReferencepublic boolean isAssignableFrom(Type other)
isAssignableFrom in interface VariableReferenceother - Right hand side of the assignmentpublic boolean isAssignableTo(Type other)
isAssignableTo in interface VariableReferenceother - Left hand side of the assignmentpublic boolean isAssignableFrom(VariableReference other)
isAssignableFrom in interface VariableReferenceother - Right hand side of the assignmentpublic boolean isAssignableTo(VariableReference other)
isAssignableTo in interface VariableReferenceother - Left hand side of the assignmentpublic Type getType()
getType in interface VariableReferenceType object.public void setType(Type type)
setType in interface VariableReferencetype - a Type object.public Class<?> getVariableClass()
getVariableClass in interface VariableReferenceClass object.public Class<?> getComponentClass()
getComponentClass in interface VariableReferenceClass object.public String getSimpleClassName()
getSimpleClassName in interface VariableReferenceString object.public GenericClass getGenericClass()
getGenericClass
getGenericClass in interface VariableReferenceGenericClass object.public Object getObject(Scope scope) throws CodeUnderTestException
getObject in interface VariableReferencescope - The scope of the test case executionObject object.CodeUnderTestException - if code from the class under test throws an exception. (E.g.
the static init of a field)public void setObject(Scope scope, Object value) throws CodeUnderTestException
setObject in interface VariableReferencescope - The scope of the test case executionvalue - The value to be assignedCodeUnderTestException - if code from the class under test throws an exception. (E.g.
the static init of a field)public String getName()
getName in interface VariableReferenceString object.public VariableReference getAdditionalVariableReference()
getAdditionalVariableReference
getAdditionalVariableReference in interface VariableReferenceVariableReference object.public void setAdditionalVariableReference(VariableReference var)
setAdditionalVariableReference
setAdditionalVariableReference in interface VariableReferencevar - a VariableReference object.public void replaceAdditionalVariableReference(VariableReference var1, VariableReference var2)
replaceAdditionalVariableReference
replaceAdditionalVariableReference in interface VariableReferencevar1 - a VariableReference object.var2 - a VariableReference object.public void loadBytecode(org.objectweb.asm.commons.GeneratorAdapter mg,
Map<Integer,Integer> locals)
loadBytecode
loadBytecode in interface VariableReferencemg - a GeneratorAdapter object.locals - a Map object.public void storeBytecode(org.objectweb.asm.commons.GeneratorAdapter mg,
Map<Integer,Integer> locals)
storeBytecode
storeBytecode in interface VariableReferencemg - a GeneratorAdapter object.locals - a Map object.public void changeClassLoader(ClassLoader loader)
changeClassLoader
changeClassLoader in interface VariableReferenceloader - a ClassLoader object.public Object getDefaultValue()
getDefaultValue
getDefaultValue in interface VariableReferenceObject object.public String getDefaultValueString()
getDefaultValueString
getDefaultValueString in interface VariableReferenceString object.public int compareTo(VariableReference other)
compareTo in interface Comparable<VariableReference>compareTo in interface VariableReferencepublic boolean same(VariableReference r)
same
same in interface VariableReferencer - a VariableReference object.public String getOriginalCode()
Getter for the field originalCode.
getOriginalCode in interface VariableReferenceString object.public void setOriginalCode(String originalCode)
setOriginalCode in interface VariableReferenceoriginalCode - The code fragment that defined this variable reference.public TestCase getTestCase()
VariableReferencegetTestCase
getTestCase in interface VariableReferenceTestCase object.public boolean isFieldReference()
VariableReferenceisFieldReference in interface VariableReferenceCopyright © 2010–2017 EvoSuite. All rights reserved.