korat.finitization.impl
Class Finitization

java.lang.Object
  extended by korat.finitization.impl.Finitization
All Implemented Interfaces:
IFinitization

public class Finitization
extends Object
implements IFinitization

Author:
Aleksandar Milicevic

Field Summary
private  Map<Class<?>,IClassDomain> classDomains
           
protected static ClassLoader classLoader
           
private  Map<IClassDomain,Map<String,IFieldDomain>> clsDomainsMap
           
private  boolean handleArraysAsObjects
           
private  List<Finitization> includedFinitizations
           
private  Class rootClass
           
private  ClassDomain rootClassDomain
           
private  StateSpace stateSpace
           
 
Constructor Summary
Finitization(Class myClass)
           
 
Method Summary
 void addAll(Class cls, String fieldName, IObjSet objSet)
          Adds all objects from the given objSet to the given field which has to be of type Collection.
 void addAll(String fullFieldName, IObjSet objSet)
          Adds all objects from the given objSet to the given field which has to be of type Collection.
 void addAll(String className, String fieldName, IObjSet objSet)
          Adds all objects from the given objSet to the given field which has to be of type Collection.
private  void appendClassDomain(List<CVElem> list, ClassDomain cd)
           
private  void appendFields(List<CVElem> fieldsList, Object obj, Map<String,IFieldDomain> fieldsMap)
           
 boolean areArraysHandledAsObjects()
           
 IArraySet createArraySet(Class clz, IIntSet array$length, IFieldDomain array$values, int count)
           Creates an instance of the IArraySet.
 IBooleanSet createBooleanSet()
          Creates new IBooleanSet
 IByteSet createByteSet(byte singleValue)
          Creates IByteSet with the single value that is given as the method parameter.
 IByteSet createByteSet(byte min, byte max)
          Here the step (differecte) between two consecutive values in the set defaults to 1.
 IByteSet createByteSet(byte min, byte diff, byte max)
           
 IClassDomain createClassDomain(Class cls)
          Creates new empty class domain Equivalent to createClassDomain(cls, 0);
 IClassDomain createClassDomain(Class cls, int numOfInstances)
          Creates new ClassDomain if the ClassDomain with the given Class hasn't already been created or returns existing ClassDomain, no matter if it's size is different from the given parameter numOfInstances
 IClassDomain createClassDomain(String className)
          Equivalent to createClassDomain(className)
 IClassDomain createClassDomain(String className, int numOfInstances)
          Helper.
 IDoubleSet createDoubleSet(double singleValue)
          Creates IDoubleSet with the single value that is given as the method parameter.
 IDoubleSet createDoubleSet(double min, double max)
          Here the step (differecte) between two consecutive values in the set defaults to 1.
 IDoubleSet createDoubleSet(double min, double diff, double max)
           
 IFloatSet createFloatSet(float singleValue)
          Creates IFloatSet with the single value that is given as the method parameter.
 IFloatSet createFloatSet(float min, float max)
          Here the step (differecte) between two consecutive values in the set defaults to 1.
 IFloatSet createFloatSet(float min, float diff, float max)
          Here the step (differecte) between two consecutive values in the set defaults to 1.
 IIntSet createIntSet(int singleValue)
          Creates IIntSet with the single value that is given as the method parameter.
 IIntSet createIntSet(int min, int max)
          Creates IIntSet with the given min and max parameters.
 IIntSet createIntSet(int min, int diff, int max)
          Creates IIntSet according to the given parameters.
 ILongSet createLongSet(long singleValue)
          Creates ILongSet with the single value that is given as the method parameter.
 ILongSet createLongSet(long min, long max)
          Here the step (differecte) between two consecutive values in the set defaults to 1.
 ILongSet createLongSet(long min, long diff, long max)
           
 IObjSet createObjSet(Class fieldBaseClass)
          Helper.
 IObjSet createObjSet(Class fieldBaseClass, boolean includeNull)
          Creates IObjSet according to the given parameters.
 IObjSet createObjSet(Class fieldBaseClass, int numOfInstances)
          Helper.
 IObjSet createObjSet(Class fieldBaseClass, int numOfInstances, boolean includeNull)
          Creates IObjSet and automatically creates given number of instances of the same class Equivalent to
IClassDomain c = f.createClassDomain(fieldBaseClass, numOfInstances); IObjSet toReturn = f.createObjSet(fieldBaseClass, includeNull); toReturn.addClassDomain(c); return toReturn;
 IFieldDomain createObjSet(IClassDomain classDomain)
          Helper.
 IFieldDomain createObjSet(IClassDomain classDomain, boolean includeNull)
          Similar to createObjSet(IClassDomain classDomain) but also can include null value
 IObjSet createObjSet(String fieldBaseClassName)
          Helper.
 IObjSet createObjSet(String fieldBaseClassName, boolean includeNull)
          Helper.
 IObjSet createObjSet(String fieldBaseClassName, int numOfInstances)
          Helper.
 IObjSet createObjSet(String fieldBaseClassName, int numOfInstances, boolean includeNull)
          Helper.
 IShortSet createShortSet(short singleValue)
          Creates IShortSet with the single value that is given as the method parameter.
 IShortSet createShortSet(short min, short max)
          Here the step (differecte) between two consecutive values in the set defaults to 1.
 IShortSet createShortSet(short min, short diff, short max)
           
private  void createStateSpace()
           
 ClassDomain getClassDomain(Class cls)
          Searches for the ObjSet of the given Class object.
 IClassDomain getClassDomain(String name)
          Helper.
private  Class getClassFromName(String className)
           
static ClassLoader getClassLoader()
           
 IFieldDomain getFieldDomain(Class cls, String fieldName)
           
 IFieldDomain getFieldDomain(String fullFieldName)
           
 IFieldDomain getFieldDomain(String className, String fieldName)
           
 Class getFinClass()
          Returns Class object of the finitized class
 IFinitization getIncludedFinitization(Class clazz)
          Returns the included finitization, if there is such, for type given by clazz parameter
 int[] getInitialCandidateVector()
           
 StateSpace getStateSpace()
          Returns the IStateSpace according to the bounds of the system
 void handleArraysAsObjects(boolean handleAsObjects)
          If selected, arrays will be handled like other objects during Korat search.
 boolean includeFinitization(IFinitization ifin)
          Includes information from finitization fin into current finitization.
 void initialize()
          Does all needed initialization.
private  void initializeClassDomains()
           
private  void initializeFieldSetters()
           
private  String parseClassName(String fullFieldName)
           
private  String parseFieldName(String fullFieldName)
           
private  Map<String,IFieldDomain> putClsDomainsMap(IClassDomain cd, Map<String,IFieldDomain> mfd)
           
 void set(Class cls, String fieldName, IFieldDomain fieldDomain)
          Assigns fieldDomain to the given field (fieldName) of the given class (cls).
 void set(String fullFieldName, IFieldDomain fieldDomain)
          Helper.
 void set(String className, String fieldName, IFieldDomain fieldDomain)
          Helper.
static void setClassLoader(ClassLoader classLoader2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootClass

private Class rootClass

rootClassDomain

private ClassDomain rootClassDomain

clsDomainsMap

private Map<IClassDomain,Map<String,IFieldDomain>> clsDomainsMap

classDomains

private Map<Class<?>,IClassDomain> classDomains

stateSpace

private StateSpace stateSpace

handleArraysAsObjects

private boolean handleArraysAsObjects

includedFinitizations

private List<Finitization> includedFinitizations

classLoader

protected static ClassLoader classLoader
Constructor Detail

Finitization

public Finitization(Class myClass)
Method Detail

setClassLoader

public static void setClassLoader(ClassLoader classLoader2)

getClassLoader

public static ClassLoader getClassLoader()

getClassFromName

private Class getClassFromName(String className)

parseClassName

private String parseClassName(String fullFieldName)

parseFieldName

private String parseFieldName(String fullFieldName)

putClsDomainsMap

private Map<String,IFieldDomain> putClsDomainsMap(IClassDomain cd,
                                                  Map<String,IFieldDomain> mfd)

initializeClassDomains

private void initializeClassDomains()

appendFields

private void appendFields(List<CVElem> fieldsList,
                          Object obj,
                          Map<String,IFieldDomain> fieldsMap)

appendClassDomain

private void appendClassDomain(List<CVElem> list,
                               ClassDomain cd)

createStateSpace

private void createStateSpace()

initializeFieldSetters

private void initializeFieldSetters()

areArraysHandledAsObjects

public boolean areArraysHandledAsObjects()
Specified by:
areArraysHandledAsObjects in interface IFinitization
Returns:
- are arrays treated as objects during Korat search

handleArraysAsObjects

public void handleArraysAsObjects(boolean handleAsObjects)
Description copied from interface: IFinitization

If selected, arrays will be handled like other objects during Korat search. This implies that one array object might be shared among many objects.

Another option is to treat array objects as special "field containers", that may belong to only one object.

Specified by:
handleArraysAsObjects in interface IFinitization
Parameters:
handleAsObjects - - should arrays be treated like objects during search.
See Also:
IFinitization.areArraysHandledAsObjects()

getFinClass

public Class getFinClass()
Description copied from interface: IFinitization
Returns Class object of the finitized class

Specified by:
getFinClass in interface IFinitization
Returns:
Class object for root class that is being finitized

createClassDomain

public IClassDomain createClassDomain(String className,
                                      int numOfInstances)
Description copied from interface: IFinitization
Helper.

First, tries to find a Class object for the given className and then calls createClassDomain(Class, int).
Searches in the package of the finitized class, or in the default package.

Specified by:
createClassDomain in interface IFinitization
Parameters:
className - fully qualified name of the class or relative to the package name of the finitized class.
numOfInstances - number of elements to be created
Returns:
created IClassDomain
See Also:
IFinitization.createClassDomain(Class, int)

createClassDomain

public IClassDomain createClassDomain(Class cls,
                                      int numOfInstances)
Description copied from interface: IFinitization
Creates new ClassDomain if the ClassDomain with the given Class hasn't already been created or returns existing ClassDomain, no matter if it's size is different from the given parameter numOfInstances

Specified by:
createClassDomain in interface IFinitization
Parameters:
cls - Class of the objects
numOfInstances - number of instances to be created
Returns:
created IClassDomain
See Also:
IFinitization.createClassDomain(String, int)

createBooleanSet

public IBooleanSet createBooleanSet()
Description copied from interface: IFinitization
Creates new IBooleanSet

Specified by:
createBooleanSet in interface IFinitization
Returns:
newly created IBooleanSet

createIntSet

public IIntSet createIntSet(int min,
                            int diff,
                            int max)
Description copied from interface: IFinitization
Creates IIntSet according to the given parameters.

Specified by:
createIntSet in interface IFinitization
Parameters:
min - minimal element of this set of integers (included)
diff - step, the difference between to elements
max - maximal element of this set of integers (included)
Returns:
created IIntSet
See Also:
IFinitization.createIntSet(int), IFinitization.createIntSet(int, int)

createIntSet

public IIntSet createIntSet(int min,
                            int max)
Description copied from interface: IFinitization
Creates IIntSet with the given min and max parameters. The difference between two elements is by default 1. Equivalent of createIntSet(min, 1, max).

Specified by:
createIntSet in interface IFinitization
Parameters:
min - minimal element of this set of integers (included)
max - maximal element of this set of integers (included)
Returns:
created IIntSet
See Also:
IFinitization.createIntSet(int), IFinitization.createIntSet(int, int, int)

createIntSet

public IIntSet createIntSet(int singleValue)
Description copied from interface: IFinitization
Creates IIntSet with the single value that is given as the method parameter. Equivalent of createIntSet(value, 1, value).

Specified by:
createIntSet in interface IFinitization
Parameters:
singleValue - single value that will be added to IIntSet
Returns:
created IIntSet
See Also:
IFinitization.createIntSet(int, int), IFinitization.createIntSet(int, int, int)

createByteSet

public IByteSet createByteSet(byte min,
                              byte diff,
                              byte max)
Specified by:
createByteSet in interface IFinitization
Parameters:
min - - minimum value to be included in the set
diff - - difference (step) between two consecutive values in the set
max - - maximum value to be included in the set
Returns:
newly created IByteSet

createByteSet

public IByteSet createByteSet(byte min,
                              byte max)
Description copied from interface: IFinitization
Here the step (differecte) between two consecutive values in the set defaults to 1.

Specified by:
createByteSet in interface IFinitization
Parameters:
min - - minimum value to be included in the set
max - - maximum value to be included in the set
Returns:
newly created IByteSet

createByteSet

public IByteSet createByteSet(byte singleValue)
Description copied from interface: IFinitization
Creates IByteSet with the single value that is given as the method parameter. Equivalent of createByteSet(value, 1, value).

Specified by:
createByteSet in interface IFinitization
Parameters:
singleValue - single value that will be added to IByteSet
Returns:
created IByteSet
See Also:
IFinitization.createByteSet(byte, byte), IFinitization.createByteSet(byte, byte, byte)

createDoubleSet

public IDoubleSet createDoubleSet(double min,
                                  double diff,
                                  double max)
Specified by:
createDoubleSet in interface IFinitization
Parameters:
min - - minimum value to be included in the set
diff - - difference (step) between two consecutive values in the set
max - - maximum value to be included in the set
Returns:
newly created IDoubleSet

createDoubleSet

public IDoubleSet createDoubleSet(double min,
                                  double max)
Description copied from interface: IFinitization
Here the step (differecte) between two consecutive values in the set defaults to 1.

Specified by:
createDoubleSet in interface IFinitization
Parameters:
min - - minimum value to be included in the set
max - - maximum value to be included in the set
Returns:
newly created IDoubleSet

createDoubleSet

public IDoubleSet createDoubleSet(double singleValue)
Description copied from interface: IFinitization
Creates IDoubleSet with the single value that is given as the method parameter. Equivalent of createDoubleSet(value, 1, value).

Specified by:
createDoubleSet in interface IFinitization
Parameters:
singleValue - single value that will be added to IDoubleSet
Returns:
created IDoubletSet
See Also:
IFinitization.createDoubleSet(double, double), IFinitization.createDoubleSet(double, double, double)

createFloatSet

public IFloatSet createFloatSet(float min,
                                float diff,
                                float max)
Description copied from interface: IFinitization
Here the step (differecte) between two consecutive values in the set defaults to 1.

Specified by:
createFloatSet in interface IFinitization
Parameters:
min - - minimum value to be included in the set
max - - maximum value to be included in the set
Returns:
newly created IFloatSet

createFloatSet

public IFloatSet createFloatSet(float min,
                                float max)
Description copied from interface: IFinitization
Here the step (differecte) between two consecutive values in the set defaults to 1.

Specified by:
createFloatSet in interface IFinitization
Parameters:
min - - minimum value to be included in the set
max - - maximum value to be included in the set
Returns:
newly created IFloatSet

createFloatSet

public IFloatSet createFloatSet(float singleValue)
Description copied from interface: IFinitization
Creates IFloatSet with the single value that is given as the method parameter. Equivalent of createFloatSet(value, 1, value).

Specified by:
createFloatSet in interface IFinitization
Parameters:
singleValue - single value that will be added to IFloatSet
Returns:
created IFloatSet
See Also:
IFinitization.createFloatSet(float, float), IFinitization.createFloatSet(float, float, float)

createLongSet

public ILongSet createLongSet(long min,
                              long diff,
                              long max)
Specified by:
createLongSet in interface IFinitization
Parameters:
min - - minimum value to be included in the set
diff - - difference (step) between two consecutive values in the set
max - - maximum value to be included in the set
Returns:
newly created ILongSet

createLongSet

public ILongSet createLongSet(long min,
                              long max)
Description copied from interface: IFinitization
Here the step (differecte) between two consecutive values in the set defaults to 1.

Specified by:
createLongSet in interface IFinitization
Parameters:
min - - minimum value to be included in the set
max - - maximum value to be included in the set
Returns:
newly created ILongSet

createLongSet

public ILongSet createLongSet(long singleValue)
Description copied from interface: IFinitization
Creates ILongSet with the single value that is given as the method parameter. Equivalent of createLongSet(value, 1, value).

Specified by:
createLongSet in interface IFinitization
Parameters:
singleValue - single value that will be added to ILongSet
Returns:
created ILongSet
See Also:
IFinitization.createLongSet(long, long), IFinitization.createLongSet(long, long, long)

createShortSet

public IShortSet createShortSet(short min,
                                short diff,
                                short max)
Specified by:
createShortSet in interface IFinitization
Parameters:
min - - minimum value to be included in the set
diff - - difference (step) between two consecutive values in the set
max - - maximum value to be included in the set
Returns:
newly created IShortSet

createShortSet

public IShortSet createShortSet(short min,
                                short max)
Description copied from interface: IFinitization
Here the step (differecte) between two consecutive values in the set defaults to 1.

Specified by:
createShortSet in interface IFinitization
Parameters:
min - - minimum value to be included in the set
max - - maximum value to be included in the set
Returns:
newly created IShortSet

createShortSet

public IShortSet createShortSet(short singleValue)
Description copied from interface: IFinitization
Creates IShortSet with the single value that is given as the method parameter. Equivalent of createShortSet(value, 1, value).

Specified by:
createShortSet in interface IFinitization
Parameters:
singleValue - single value that will be added to IShortSet
Returns:
created IShortSet
See Also:
IFinitization.createShortSet(short, short), IFinitization.createShortSet(short, short, short)

createObjSet

public IObjSet createObjSet(Class fieldBaseClass,
                            boolean includeNull)
Description copied from interface: IFinitization
Creates IObjSet according to the given parameters.

Specified by:
createObjSet in interface IFinitization
Parameters:
fieldBaseClass - Base type of the field that is used in type checking. If fieldBaseClass is a Class object of a reference type, new IObjSet will be returned, else an exception will be thrown.
includeNull - whether to include null in the IObjSet.
Returns:
- created IObjSet
See Also:
IFinitization.createObjSet(Class), IFinitization.createObjSet(String), IFinitization.createObjSet(String, boolean)

createObjSet

public IObjSet createObjSet(Class fieldBaseClass)
Description copied from interface: IFinitization
Helper.
Calls createObjSet(fieldBaseClass, false);

Specified by:
createObjSet in interface IFinitization
Parameters:
fieldBaseClass - Base type of the field
Returns:
newly created IObjSet
See Also:
IFinitization.createObjSet(Class, boolean), IFinitization.createObjSet(String), IFinitization.createObjSet(String, boolean)

createObjSet

public IObjSet createObjSet(String fieldBaseClassName,
                            boolean includeNull)
Description copied from interface: IFinitization
Helper.
First, tries to find a Class object for the given fieldBaseClassName and then calls createObjSet(Class, boolean).
Searches in the package of the finitized class, or in the default package.

Specified by:
createObjSet in interface IFinitization
Parameters:
fieldBaseClassName - name of the base type of the field
includeNull - weather to include null in the IObjSet.
Returns:
created IObjSet
See Also:
IFinitization.createObjSet(Class, boolean), IFinitization.createObjSet(Class), IFinitization.createObjSet(String)

createObjSet

public IObjSet createObjSet(String fieldBaseClassName)
Description copied from interface: IFinitization
Helper.
Calls createFieldDomain(fieldBaseClassName, false);

Specified by:
createObjSet in interface IFinitization
Parameters:
fieldBaseClassName - name of the base type of the field
Returns:
created IObjSet
See Also:
IFinitization.createObjSet(Class, boolean), IFinitization.createObjSet(Class), IFinitization.createObjSet(String, boolean)

createObjSet

public IFieldDomain createObjSet(IClassDomain classDomain)
Description copied from interface: IFinitization
Helper.
Creates new ObjectSet for class of the classDomain and adds classDomain. Null value is not allowed

Specified by:
createObjSet in interface IFinitization
Returns:
newly created IFieldDomain

createObjSet

public IFieldDomain createObjSet(IClassDomain classDomain,
                                 boolean includeNull)
Description copied from interface: IFinitization
Similar to createObjSet(IClassDomain classDomain) but also can include null value

Specified by:
createObjSet in interface IFinitization
Returns:
created IFieldDomain
See Also:
IFinitization.createObjSet(IClassDomain)

set

public void set(Class cls,
                String fieldName,
                IFieldDomain fieldDomain)
Description copied from interface: IFinitization
Assigns fieldDomain to the given field (fieldName) of the given class (cls).
Note that you cannot assign field domain to the field of some class if the class domain (ObjSet) for that class has not been created before (e.g. with the call createObjSet(cls, numOfInstances))

Specified by:
set in interface IFinitization
Parameters:
cls - - Class object of the class
fieldName - - field name of the given class
fieldDomain - - domain of the field
See Also:
IFinitization.set(String, IFieldDomain), IFinitization.set(String, String, IFieldDomain)

set

public void set(String className,
                String fieldName,
                IFieldDomain fieldDomain)
Description copied from interface: IFinitization
Helper.
Searches for the class with the given name (in the default package and in package of the finitized class), and then calls set(Class, String, IFieldDomain)

Specified by:
set in interface IFinitization
Parameters:
className - - fully qualified name of the class or name relative to package name of the finitized class
fieldName - - name of the field
fieldDomain - - domain of the field
See Also:
IFinitization.set(String, IFieldDomain), IFinitization.set(Class, String, IFieldDomain)

set

public void set(String fullFieldName,
                IFieldDomain fieldDomain)
Description copied from interface: IFinitization
Helper.
Parses fullFieldName into className and fieldName according to following format:
  • if fullFieldName does not contains "." it is considered as a fieldName of the class which this finitization is for;
  • if fullFieldName contains "." then the substring after the last "." in the fullFieldName is considered as a fieldName and the substring before the last "." is taken as className. className should be a fully qualified name of the class or a relative name in the package of the finitized field;
Then calls set(className, fieldName, fieldDomain)

Specified by:
set in interface IFinitization
Parameters:
fullFieldName - - name of the field ( format: ClassName.FieldName )
fieldDomain - - field domain
See Also:
IFinitization.set(Class, String, IFieldDomain), IFinitization.set(String, String, IFieldDomain)

getClassDomain

public ClassDomain getClassDomain(Class cls)
Description copied from interface: IFinitization
Searches for the ObjSet of the given Class object.

Specified by:
getClassDomain in interface IFinitization
Parameters:
cls - - Class object of the class
Returns:
existing ObjSet for the given class name or null if is not been created yet.
See Also:
IFinitization.getClassDomain(String)

getClassDomain

public IClassDomain getClassDomain(String name)
Description copied from interface: IFinitization
Helper.
Searches for the Class object of the class with the given name and then calls getObjSet(Class)

Specified by:
getClassDomain in interface IFinitization
Parameters:
name - - name of the class of which the ObjSet is requested.
Returns:
existing ObjSet for the given class name or null if is not been created yet.
See Also:
IFinitization.getClassDomain(Class)

getFieldDomain

public IFieldDomain getFieldDomain(Class cls,
                                   String fieldName)
Specified by:
getFieldDomain in interface IFinitization
Returns:
newly created IFieldDomain
See Also:
IFinitization.getFieldDomain(String), IFinitization.getFieldDomain(String, String)

getFieldDomain

public IFieldDomain getFieldDomain(String className,
                                   String fieldName)
Specified by:
getFieldDomain in interface IFinitization
Returns:
newly created IFieldDomain
See Also:
IFinitization.getFieldDomain(Class, String), IFinitization.getFieldDomain(String)

getFieldDomain

public IFieldDomain getFieldDomain(String fullFieldName)
Specified by:
getFieldDomain in interface IFinitization
Returns:
newly created IFieldDomain
See Also:
IFinitization.getFieldDomain(Class, String), IFinitization.getFieldDomain(String, String)

getStateSpace

public StateSpace getStateSpace()
Returns the IStateSpace according to the bounds of the system


initialize

public void initialize()
Does all needed initialization. Korat search algorithm should call this before getting StateSpace


createArraySet

public IArraySet createArraySet(Class clz,
                                IIntSet array$length,
                                IFieldDomain array$values,
                                int count)
Description copied from interface: IFinitization

Creates an instance of the IArraySet.

Use this method to create a field domain for the field of an array type. If the given parameter doesn't stand clz.isArray() an IllegalArgumentException will be thrown. The other two parameters are used to set bounds on array length and array components. An array will take any int value from the given IIntSet array$length parameter and any of the array components will take any value from the given IFieldDomain array$values

Specified by:
createArraySet in interface IFinitization
Parameters:
clz - class of the array field
array$length - possible values for the array length
array$values - possible values for the array components
count - number of arrays to create
Returns:
created IArraySet

createClassDomain

public IClassDomain createClassDomain(String className)
Description copied from interface: IFinitization
Equivalent to createClassDomain(className)

Specified by:
createClassDomain in interface IFinitization
Returns:
newly created IClassDomain
See Also:
IFinitization.createClassDomain(String, int)

createClassDomain

public IClassDomain createClassDomain(Class cls)
Description copied from interface: IFinitization
Creates new empty class domain

Equivalent to createClassDomain(cls, 0);

Specified by:
createClassDomain in interface IFinitization
Parameters:
cls - Class of the object
Returns:
created class domain
See Also:
IFinitization.createClassDomain(Class, int)

createObjSet

public IObjSet createObjSet(Class fieldBaseClass,
                            int numOfInstances,
                            boolean includeNull)
Description copied from interface: IFinitization
Creates IObjSet and automatically creates given number of instances of the same class

Equivalent to

 IClassDomain c = f.createClassDomain(fieldBaseClass, numOfInstances);
 IObjSet toReturn = f.createObjSet(fieldBaseClass, includeNull);
 toReturn.addClassDomain(c);
 return toReturn;
 

Specified by:
createObjSet in interface IFinitization
Parameters:
fieldBaseClass - - class of the field
numOfInstances - - instances of the fieldBaseClass that are to be created in the class domain of fieldBaseClass
includeNull - - whether to include null in the IObjSet
Returns:
newly created IObjSet

createObjSet

public IObjSet createObjSet(Class fieldBaseClass,
                            int numOfInstances)
Description copied from interface: IFinitization
Helper.
First, tries to find a Class object for the given fieldBaseClassName and then calls createObjSet(Class, int, boolean).
Searches in the package of the finitized class, or in the default package.

Specified by:
createObjSet in interface IFinitization
Returns:
newly created IObjSet

createObjSet

public IObjSet createObjSet(String fieldBaseClassName,
                            int numOfInstances,
                            boolean includeNull)
Description copied from interface: IFinitization
Helper.
First, tries to find a Class object for the given fieldBaseClassName and then calls createObjSet(Class, int, boolean).
Searches in the package of the finitized class, or in the default package.

Specified by:
createObjSet in interface IFinitization
Returns:
newly created IObjSet

createObjSet

public IObjSet createObjSet(String fieldBaseClassName,
                            int numOfInstances)
Description copied from interface: IFinitization
Helper.
Calls createObjSet(fieldBaseClassName, numOfInstances, false);

Specified by:
createObjSet in interface IFinitization
Returns:
newly created IObjSet

addAll

public void addAll(String fullFieldName,
                   IObjSet objSet)
Description copied from interface: IFinitization
Adds all objects from the given objSet to the given field which has to be of type Collection.

Specified by:
addAll in interface IFinitization
Parameters:
fullFieldName - - full name of the field: <className>.<fieldName>
objSet - - set of objects to be added to the given field (collection)
See Also:
IFinitization.addAll(Class, String, IObjSet), IFinitization.addAll(String, String, IObjSet)

addAll

public void addAll(String className,
                   String fieldName,
                   IObjSet objSet)
Description copied from interface: IFinitization
Adds all objects from the given objSet to the given field which has to be of type Collection.

Specified by:
addAll in interface IFinitization
Parameters:
className - - name of the field's declaring class (class which contains the field)
fieldName - - name of the field
objSet - - set of objects to be added to the given field (collection)
See Also:
IFinitization.addAll(String, IObjSet), IFinitization.addAll(Class, String, IObjSet)

addAll

public void addAll(Class cls,
                   String fieldName,
                   IObjSet objSet)
Description copied from interface: IFinitization
Adds all objects from the given objSet to the given field which has to be of type Collection.

Specified by:
addAll in interface IFinitization
Parameters:
cls - - field's declaring class (class which contains the field)
fieldName - - name of the field
objSet - - set of objects to be added to the given field (collection)
See Also:
IFinitization.addAll(String, IObjSet), IFinitization.addAll(String, String, IObjSet)

getInitialCandidateVector

public int[] getInitialCandidateVector()

includeFinitization

public boolean includeFinitization(IFinitization ifin)
Description copied from interface: IFinitization
Includes information from finitization fin into current finitization. Only one finitization of the same type can be included.

Specified by:
includeFinitization in interface IFinitization
Parameters:
ifin - - finitization which will be included in current finitization
Returns:
- is finitization including successful
See Also:
IFinitization.getIncludedFinitization(Class)

getIncludedFinitization

public IFinitization getIncludedFinitization(Class clazz)
Description copied from interface: IFinitization
Returns the included finitization, if there is such, for type given by clazz parameter

Specified by:
getIncludedFinitization in interface IFinitization
Parameters:
clazz - - class for which the finitization has been done
Returns:
- included finitization the root of which is clazz, if exists. Otherwise returns null
See Also:
IFinitization.includeFinitization(IFinitization)