|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkorat.finitization.impl.StateSpace
public class StateSpace
Represents the state space scheme required by ITestCaseGenerator
.
Provides operations required by Korat testing engine.
Field Summary | |
---|---|
protected boolean |
initialized
|
protected static StateSpace |
lastInstance
|
protected Map<Object,int[]> |
objFields
|
protected Object |
rootObject
|
protected CVElem[] |
structureList
|
private static int[] |
zeroSizeInt
|
Constructor Summary | |
---|---|
StateSpace()
|
Method Summary | |
---|---|
CVElem |
getCVElem(int candidateVectorIndex)
Returns ICVElem corresponding to the given index. |
protected CVElem |
getCVElem(Object obj,
String fieldName)
|
FieldDomain |
getFieldDomain(int candidateVectorIndex)
Returns FieldDomain connected with the given index in candidate vector. |
FieldDomain |
getFieldDomain(Object obj,
String fieldName)
Helper, returns IFieldIndex connected with the given field in the given object. |
int[] |
getFieldIndicesFor(Object obj)
|
String |
getFieldName(int candidateVectorIndex)
Returns field name connected with the given index in candidate vector. |
protected int |
getIndex(Object obj,
String fieldName)
|
int |
getIndexInCandidateVector(Object obj,
String fieldName)
Returns the index of the field fieldName of the Object
obj in scheme. |
int |
getIndexInCandidateVector(Object obj,
String fld,
Setter setter)
Returns the index of the field fieldName of the Object
obj in scheme. |
static StateSpace |
getLastInstance()
|
Object |
getObject(int candidateVectorIndex)
Returns Object connected with the given index in candidate vector. |
Object |
getRootObject()
Returns root object of this structure (previously set by IFinitization ). |
CVElem[] |
getStructureList()
|
int |
getTotalNumberOfFields()
Returns total number of fields for all objects included in finitization |
void |
initialize()
Initializes the state space |
private void |
initializeFieldMap()
|
void |
setRootObject(Object root)
Finitization should set the root object of the structure,
after it creates the StateSpace . |
void |
setStructureList(CVElem[] structureList)
Feature that will be used by Finitization object to build
StateSpace . |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Object rootObject
protected boolean initialized
protected CVElem[] structureList
protected static StateSpace lastInstance
protected Map<Object,int[]> objFields
private static final int[] zeroSizeInt
Constructor Detail |
---|
public StateSpace()
Method Detail |
---|
protected int getIndex(Object obj, String fieldName)
protected CVElem getCVElem(Object obj, String fieldName)
public CVElem getCVElem(int candidateVectorIndex)
ICVElem
corresponding to the given index.
candidateVectorIndex
- -
index in candidate vector
public static StateSpace getLastInstance()
public CVElem[] getStructureList()
public void setStructureList(CVElem[] structureList)
Finitization
object to build
StateSpace
.
For example, structureList
can contain structures like
(Object, String, IFieldDomain)
, where the
Object
parameter is the object, String
represents field name of that object, and IFieldDomain
is
the the domain assigned to that field.
public Object getRootObject()
IFinitization
). This object is the one that is actualy
being tested.
setRootObject(Object)
public void setRootObject(Object root)
Finitization
should set the root object of the structure,
after it creates the StateSpace
.
root
- represents the test case object, the one that is being tested.getRootObject()
public String getFieldName(int candidateVectorIndex)
candidateVectorIndex
- -
index in candidate vector
public Object getObject(int candidateVectorIndex)
candidateVectorIndex
- -
index in candidate vector
public int getIndexInCandidateVector(Object obj, String fieldName)
fieldName
of the Object
obj
in scheme.
obj
- object of interestfieldName
- name of the field of the given object
public FieldDomain getFieldDomain(int candidateVectorIndex)
candidateVectorIndex
- -
index in candidate vector
public FieldDomain getFieldDomain(Object obj, String fieldName)
obj
- fieldName
- -
name of the field of the given object
public int getTotalNumberOfFields()
public String toString()
toString
in class Object
public int getIndexInCandidateVector(Object obj, String fld, Setter setter)
fieldName
of the Object
obj
in scheme. At the same time, if the returned index is
greater than or equal to zero (meaning that there is a valid
CVElem
associated with the given object and its field
named fieldName
), the given setter object will be set for
that CVElem
.
obj
- object of interestfld
- name of the field of the given objectsetter
-
public void initialize()
private void initializeFieldMap()
public int[] getFieldIndicesFor(Object obj)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |