korat.finitization.impl
Class FieldDomain

java.lang.Object
  extended by korat.finitization.impl.FieldDomain
All Implemented Interfaces:
IFieldDomain
Direct Known Subclasses:
ArraySet, BooleanSet, ObjSet, PrimitiveTypeSet

public abstract class FieldDomain
extends Object
implements IFieldDomain

Author:
Aleksandar Milicevic

Field Summary
protected  Class classOfField
           
 
Constructor Summary
FieldDomain(Class classOfField)
          Used for type checking when assigning class domains for this field
FieldDomain(String classOfFieldName)
           
 
Method Summary
protected  boolean checkClassDomainIndex(int index)
           
protected  boolean checkObjectIndex(int index)
           
abstract  ClassDomain getClassDomain(int classDomainIndex)
          Returns the class domain for the given index

primitive types should return null.

abstract  ClassDomain getClassDomainFor(int objectIndex)
          Finds the class domain for given object index by calling getClassDomainFor(objectIndex) and returns the following class domain.
abstract  int getClassDomainIndexFor(int objectIndex)
          Given the index of object in this field domain, returns index of that object in its class domain.
 Class getClassOfField()
           
abstract  int getIndexOfFirstObjectInNextClassDomain(int objectIndex)
           
abstract  ClassDomain getNextClassDomainFor(int objectIndex)
          Finds the class domain for given object index by calling getClassDomainFor(objectIndex) and returns the following class domain.
abstract  int getNumberOfElements()
          Number of all elements in this field domain.
abstract  int getNumOfClassDomains()
          Number of class domains contained in this field domain.
abstract  int getSizeOfClassDomain(int classDomainIndex)
          Number of object in the class domain which is at a classDomainIndex position in the list of all class domains within this field domain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface korat.finitization.IFieldDomain
isArrayType, isPrimitiveType
 

Field Detail

classOfField

protected Class classOfField
Constructor Detail

FieldDomain

FieldDomain(Class classOfField)
Used for type checking when assigning class domains for this field

Parameters:
classOfField - - type of the field

FieldDomain

FieldDomain(String classOfFieldName)
      throws ClassNotFoundException
Parameters:
classOfFieldName - - fully qualified name of the Class
Throws:
ClassNotFoundException - - if classOfFieldName is not valid
Method Detail

checkClassDomainIndex

protected boolean checkClassDomainIndex(int index)

checkObjectIndex

protected boolean checkObjectIndex(int index)

getClassOfField

public Class getClassOfField()
Specified by:
getClassOfField in interface IFieldDomain
Returns:
type of the field that this domain can accept

getClassDomainIndexFor

public abstract int getClassDomainIndexFor(int objectIndex)
Given the index of object in this field domain, returns index of that object in its class domain.

For primitive types it's the same as the input parameter objectIndex because primitive type field domains conceptually contain exactly one class domain.

Parameters:
objectIndex - - index of object in the field domain
Returns:
index of object in its class domain

getIndexOfFirstObjectInNextClassDomain

public abstract int getIndexOfFirstObjectInNextClassDomain(int objectIndex)

getNumOfClassDomains

public abstract int getNumOfClassDomains()
Number of class domains contained in this field domain.

Primitive types should return 1.

Specified by:
getNumOfClassDomains in interface IFieldDomain
Returns:
number of class domains in this field domain
See Also:
IPrimitiveTypeSet

getSizeOfClassDomain

public abstract int getSizeOfClassDomain(int classDomainIndex)
Number of object in the class domain which is at a classDomainIndex position in the list of all class domains within this field domain.

Primitive types should return -1 if classDomainIndex is different than 0, or getNumberOfElements() else.

Parameters:
classDomainIndex - - class domain index
Returns:
number of objects in domain with index classDomainIndex
See Also:


getNumberOfElements

public abstract int getNumberOfElements()
Number of all elements in this field domain. These are all elements that can be assigned to a field associated with this field domain in the process of generating test cases.

Specified by:
getNumberOfElements in interface IFieldDomain
Returns:
overall number of elements in field domain

getClassDomain

public abstract ClassDomain getClassDomain(int classDomainIndex)
Returns the class domain for the given index

primitive types should return null.

Parameters:
classDomainIndex - - the index of the class domain
Returns:
class domain

getClassDomainFor

public abstract ClassDomain getClassDomainFor(int objectIndex)
Finds the class domain for given object index by calling getClassDomainFor(objectIndex) and returns the following class domain.

Primitive types should return null.

Parameters:
objectIndex - - the index of the given object
Returns:
the class domain following the class domain that contains given object.
See Also:


getNextClassDomainFor

public abstract ClassDomain getNextClassDomainFor(int objectIndex)
Finds the class domain for given object index by calling getClassDomainFor(objectIndex) and returns the following class domain.

Primitive typess should return null.

Parameters:
objectIndex - - the index of the given object
Returns:
the class domain following the class domain that contains given object.
See Also: