public class ArrayIndex extends VariableReferenceImpl
| Modifier and Type | Field and Description |
|---|---|
protected ArrayReference |
array
If this variable is contained in an array, this is the reference to the
array
|
changeListener, stPosition, testCase, type| Constructor and Description |
|---|
ArrayIndex(TestCase testCase,
ArrayReference array,
int index)
Constructor
|
ArrayIndex(TestCase testCase,
ArrayReference array,
List<Integer> indices)
Constructor for ArrayIndex.
|
| Modifier and Type | Method and Description |
|---|---|
VariableReference |
clone(TestCase newTestCase)
Create a copy of the current variable for new test
|
VariableReference |
copy(TestCase newTestCase,
int offset)
Create a copy of the current variable for new test
|
boolean |
equals(Object obj) |
VariableReference |
getAdditionalVariableReference()
getAdditionalVariableReference
|
ArrayReference |
getArray()
Getter for the field
array. |
int |
getArrayIndex()
getArrayIndex
|
List<Integer> |
getArrayIndices()
getArrayIndices
|
String |
getName()
Return name for source code representation
|
Object |
getObject(Scope scope)
Return the actual object represented by this variable for a given scope
|
int |
getStPosition()
The position of the statement, defining this VariableReference, in the
testcase.
|
int |
hashCode() |
boolean |
isArrayIndex()
Return true if variable is an array
|
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 |
setArray(ArrayReference r)
Setter for the field
array. |
void |
setArrayIndex(int index)
setArrayIndex
|
void |
setArrayIndices(List<Integer> indices)
setArrayIndices
|
void |
setObject(Scope scope,
Object value)
Set the actual object represented by this variable in a given scope
|
void |
storeBytecode(org.objectweb.asm.commons.GeneratorAdapter mg,
Map<Integer,Integer> locals)
storeBytecode
|
changeClassLoader, clone, compareTo, getClassName, getComponentClass, getComponentName, getComponentType, getDefaultValue, getDefaultValueString, getDistance, getGenericClass, getOriginalCode, getSimpleClassName, getTestCase, getType, getVariableClass, isAccessible, isArray, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isEnum, isFieldReference, isPrimitive, isString, isVoid, isWrapperType, setDistance, setOriginalCode, setType, toStringprotected ArrayReference array
public ArrayIndex(TestCase testCase, ArrayReference array, int index)
testCase - a TestCase object.array - a ArrayReference object.index - a int.public ArrayIndex(TestCase testCase, ArrayReference array, List<Integer> indices)
Constructor for ArrayIndex.
testCase - a TestCase object.array - a ArrayReference object.indices - a List object.public ArrayReference getArray()
Getter for the field array.
ArrayReference object.public void setArray(ArrayReference r)
Setter for the field array.
r - a ArrayReference object.public boolean isArrayIndex()
isArrayIndex in interface VariableReferenceisArrayIndex in class VariableReferenceImplpublic int getArrayIndex()
getArrayIndex
public void setArrayIndex(int index)
setArrayIndex
index - a int.public int getStPosition()
getStPosition in interface VariableReferencegetStPosition in class VariableReferenceImplpublic String getName()
getName in interface VariableReferencegetName in class VariableReferenceImplString object.public void loadBytecode(org.objectweb.asm.commons.GeneratorAdapter mg,
Map<Integer,Integer> locals)
loadBytecode
loadBytecode in interface VariableReferenceloadBytecode in class VariableReferenceImplmg - a GeneratorAdapter object.locals - a Map object.public void storeBytecode(org.objectweb.asm.commons.GeneratorAdapter mg,
Map<Integer,Integer> locals)
storeBytecode
storeBytecode in interface VariableReferencestoreBytecode in class VariableReferenceImplmg - a GeneratorAdapter object.locals - a Map object.public boolean same(VariableReference r)
same
same in interface VariableReferencesame in class VariableReferenceImplr - a VariableReference object.public Object getObject(Scope scope) throws CodeUnderTestException
getObject in interface VariableReferencegetObject in class VariableReferenceImplscope - 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 VariableReferencesetObject in class VariableReferenceImplscope - 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 VariableReference copy(TestCase newTestCase, int offset)
copy in interface VariableReferencecopy in class VariableReferenceImplnewTestCase - a TestCase object.offset - a int.VariableReference object.public VariableReference clone(TestCase newTestCase)
VariableReferenceImplclone in interface VariableReferenceclone in class VariableReferenceImplnewTestCase - a TestCase object.VariableReference object.public VariableReference getAdditionalVariableReference()
getAdditionalVariableReference
getAdditionalVariableReference in interface VariableReferencegetAdditionalVariableReference in class VariableReferenceImplVariableReference object.public void setAdditionalVariableReference(VariableReference var)
setAdditionalVariableReference
setAdditionalVariableReference in interface VariableReferencesetAdditionalVariableReference in class VariableReferenceImplvar - a VariableReference object.public void replaceAdditionalVariableReference(VariableReference var1, VariableReference var2)
replaceAdditionalVariableReference
replaceAdditionalVariableReference in interface VariableReferencereplaceAdditionalVariableReference in class VariableReferenceImplvar1 - a VariableReference object.var2 - a VariableReference object.public void setArrayIndices(List<Integer> indices)
setArrayIndices
indices - a List object.Copyright © 2010–2017 EvoSuite. All rights reserved.