korat.finitization.impl
Class BooleanSet

java.lang.Object
  extended by korat.finitization.impl.FieldDomain
      extended by korat.finitization.impl.BooleanSet
All Implemented Interfaces:
IBooleanSet, IFieldDomain, IPrimitiveTypeSet

public class BooleanSet
extends FieldDomain
implements IBooleanSet

Author:
Sasa Misailovic

Field Summary
 
Fields inherited from class korat.finitization.impl.FieldDomain
classOfField
 
Constructor Summary
BooleanSet()
           
 
Method Summary
 boolean getBoolean(int index)
          gets boolean value for the corresponding candidate vector index
 ClassDomain getClassDomain(int classDomainIndex)
          Returns the class domain for the given index

primitive types should return null.

 ClassDomain getClassDomainFor(int objectIndex)
          Finds the class domain for given object index by calling getClassDomainFor(objectIndex) and returns the following class domain.
 int getClassDomainIndexFor(int objectIndex)
          Given the index of object in this field domain, returns index of that object in its class domain.
 Class getClassOfField()
           
 int getIndexOfFirstObjectInNextClassDomain(int objectIndex)
           
 ClassDomain getNextClassDomainFor(int objectIndex)
          Finds the class domain for given object index by calling getClassDomainFor(objectIndex) and returns the following class domain.
 int getNumberOfElements()
          Number of all elements in this field domain.
 int getNumOfClassDomains()
          Number of class domains contained in this field domain.
 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.
 boolean isArrayType()
          Does this field domain represent array type.
 boolean isPrimitiveType()
          Does this field domain represent primitive type.
 
Methods inherited from class korat.finitization.impl.FieldDomain
checkClassDomainIndex, checkObjectIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanSet

public BooleanSet()
Method Detail

getBoolean

public boolean getBoolean(int index)
gets boolean value for the corresponding candidate vector index

Parameters:
index - - candidate vector index
Returns:
- boolean value: false if index == 0 i or true if index == 1

getClassOfField

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

isPrimitiveType

public boolean isPrimitiveType()
Description copied from interface: IFieldDomain
Does this field domain represent primitive type.

Specified by:
isPrimitiveType in interface IFieldDomain
Returns:
true for primitive data types and strings, false otherwise

isArrayType

public boolean isArrayType()
Description copied from interface: IFieldDomain
Does this field domain represent array type.

Specified by:
isArrayType in interface IFieldDomain
Returns:
true if class of this FieldDomain is array, false otherwise

getNumberOfElements

public int getNumberOfElements()
Description copied from class: FieldDomain
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
Specified by:
getNumberOfElements in class FieldDomain
Returns:
overall number of elements in field domain

getClassDomainIndexFor

public int getClassDomainIndexFor(int objectIndex)
Description copied from class: FieldDomain
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.

Specified by:
getClassDomainIndexFor in class FieldDomain
Parameters:
objectIndex - - index of object in the field domain
Returns:
index of object in its class domain

getNumOfClassDomains

public int getNumOfClassDomains()
Description copied from class: FieldDomain
Number of class domains contained in this field domain.

Primitive types should return 1.

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

getClassDomain

public ClassDomain getClassDomain(int classDomainIndex)
Description copied from class: FieldDomain
Returns the class domain for the given index

primitive types should return null.

Specified by:
getClassDomain in class FieldDomain
Parameters:
classDomainIndex - - the index of the class domain
Returns:
class domain

getClassDomainFor

public ClassDomain getClassDomainFor(int objectIndex)
Description copied from class: FieldDomain
Finds the class domain for given object index by calling getClassDomainFor(objectIndex) and returns the following class domain.

Primitive types should return null.

Specified by:
getClassDomainFor in class FieldDomain
Parameters:
objectIndex - - the index of the given object
Returns:
the class domain following the class domain that contains given object.
See Also:


getNextClassDomainFor

public ClassDomain getNextClassDomainFor(int objectIndex)
Description copied from class: FieldDomain
Finds the class domain for given object index by calling getClassDomainFor(objectIndex) and returns the following class domain.

Primitive typess should return null.

Specified by:
getNextClassDomainFor in class FieldDomain
Parameters:
objectIndex - - the index of the given object
Returns:
the class domain following the class domain that contains given object.
See Also:


getSizeOfClassDomain

public int getSizeOfClassDomain(int classDomainIndex)
Description copied from class: FieldDomain
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.

Specified by:
getSizeOfClassDomain in class FieldDomain
Parameters:
classDomainIndex - - class domain index
Returns:
number of objects in domain with index classDomainIndex
See Also:


getIndexOfFirstObjectInNextClassDomain

public int getIndexOfFirstObjectInNextClassDomain(int objectIndex)
Specified by:
getIndexOfFirstObjectInNextClassDomain in class FieldDomain