Package de.uni_trier.wi2.procake
Class CakeInstance
- java.lang.Object
-
- de.uni_trier.wi2.procake.CakeInstance
-
public class CakeInstance extends Object
Main starter class for ProCAKE. It is used to initially load model, similarity model and case data.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddSimilarityModel(String path, String name)Initializes and builds the similarity model with the given name.static booleanaddSimModel(String simModel)Add Similarity Model to List.static voidextendModel(InputStream streamModel, String modelName)Adds an input stream containing a model definition (model.xml) to the existing loaded model.static voidextendModel(String pathModel, String modelName)Adds a file containing a model definition (model.xml) to the existing loaded model.static voidextendSimilarityModel(InputStream streamSimModel, String modelName)Adds an input stream containing a similarity model definition (sim.xml) to the existing loaded similarity model.static voidextendSimilarityModel(String pathSimModel, String modelName)Adds a file containing a similarity model definition (sim.xml) to the existing loaded similarity model.static DependencyModelgetDependencyModel()Method, that returns the dependency model.static CakeInstancegetInstance()Getter for the fieldinstance.static DependencyModelinitDefaultDependencyModel(String dependencyModelPath, WriteableObjectPool casebase)Method, that initializes the dependency model from an XML file.static booleanisRunning()Check whether an instance of ProCAKE has been started already.<T extends DataObject>
WriteableObjectPool<T>run()run.static <T extends DataObject>
WriteableObjectPool<T>start()start.static <T extends DataObject>
WriteableObjectPool<T>start(String composition)start.static <T extends DataObject>
WriteableObjectPool<T>start(String composition, String casebase)start.static <T extends DataObject>
WriteableObjectPool<T>start(String composition, String model, String[] simModels, String casebase, String transformationConfig, boolean reuseDataClassReferencesAtRestart)start.static <T extends DataObject>
WriteableObjectPool<T>start(String composition, String model, String simModel, String casebase)start.static <T extends DataObject>
WriteableObjectPool<T>start(String composition, String model, String simModel, String casebase, String transformationConfig)start.static <T extends DataObject>
WriteableObjectPool<T>start(String composition, String model, String simModel, String casebase, String transformationConfig, boolean reuseDataClassReferencesAtRestart)start.static voidvalidateSimModel(Model model, SimilarityModel simModel)Validates the similarity model by checking if a defined class from the data model has a respective measure in the similarity model.CakeInstancewithCaseBase(String path)withCaseBase.CakeInstancewithComposition(String path)withComposition.CakeInstancewithModel(String path)withModel.CakeInstancewithReuseDataClassReferencesAtRestart(boolean flag)withReuseDataClassReferencesAtRestart.CakeInstancewithSimModel(String path)withSimModel.
-
-
-
Method Detail
-
getInstance
public static CakeInstance getInstance()
Getter for the field
instance.- Returns:
- a
CakeInstanceobject
-
withComposition
public CakeInstance withComposition(String path)
withComposition.
- Parameters:
path- aStringobject- Returns:
- a
CakeInstanceobject
-
withModel
public CakeInstance withModel(String path)
withModel.
- Parameters:
path- aStringobject- Returns:
- a
CakeInstanceobject
-
withSimModel
public CakeInstance withSimModel(String path)
withSimModel.
- Parameters:
path- aStringobject- Returns:
- a
CakeInstanceobject
-
withCaseBase
public CakeInstance withCaseBase(String path)
withCaseBase.
- Parameters:
path- aStringobject- Returns:
- a
CakeInstanceobject
-
withReuseDataClassReferencesAtRestart
public CakeInstance withReuseDataClassReferencesAtRestart(boolean flag)
withReuseDataClassReferencesAtRestart.
- Parameters:
flag- a boolean- Returns:
- a
CakeInstanceobject
-
run
public <T extends DataObject> WriteableObjectPool<T> run()
run.
- Type Parameters:
T- a T class- Returns:
- a
WriteableObjectPoolobject
-
isRunning
public static boolean isRunning()
Check whether an instance of ProCAKE has been started already.- Returns:
- true if ProCAKE is already running
-
start
public static <T extends DataObject> WriteableObjectPool<T> start()
start.
- Type Parameters:
T- a T class- Returns:
- a
WriteableObjectPoolobject
-
start
public static <T extends DataObject> WriteableObjectPool<T> start(String composition)
start.
- Type Parameters:
T- a T class- Parameters:
composition- aStringobject- Returns:
- a
WriteableObjectPoolobject
-
start
public static <T extends DataObject> WriteableObjectPool<T> start(String composition, String casebase)
start.
- Type Parameters:
T- a T class- Parameters:
composition- aStringobjectcasebase- aStringobject- Returns:
- a
WriteableObjectPoolobject
-
start
public static <T extends DataObject> WriteableObjectPool<T> start(String composition, String model, String simModel, String casebase)
start.
- Type Parameters:
T- a T class- Parameters:
composition- aStringobjectmodel- aStringobjectsimModel- aStringobjectcasebase- aStringobject- Returns:
- a
WriteableObjectPoolobject
-
start
public static <T extends DataObject> WriteableObjectPool<T> start(String composition, String model, String simModel, String casebase, String transformationConfig)
start.
-
start
public static <T extends DataObject> WriteableObjectPool<T> start(String composition, String model, String simModel, String casebase, String transformationConfig, boolean reuseDataClassReferencesAtRestart)
start.
-
start
public static <T extends DataObject> WriteableObjectPool<T> start(String composition, String model, String[] simModels, String casebase, String transformationConfig, boolean reuseDataClassReferencesAtRestart)
start.
-
addSimModel
public static boolean addSimModel(String simModel)
Add Similarity Model to List.- Parameters:
simModel- is to be added.- Returns:
- true if Model could be added, false if ProCAKE isn't running.
-
extendModel
public static void extendModel(String pathModel, String modelName)
Adds a file containing a model definition (model.xml) to the existing loaded model. This method can be handy if the model information has to be complemented during runtime.- Parameters:
pathModel- the path to the file to loadmodelName- the name of the model to extend. null refers to the default model
-
extendModel
public static void extendModel(InputStream streamModel, String modelName)
Adds an input stream containing a model definition (model.xml) to the existing loaded model. This method can be handy if the model information has to be complemented during runtime.- Parameters:
streamModel- the stream containing the file to loadmodelName- the name of the model to extend. null refers to the default model
-
extendSimilarityModel
public static void extendSimilarityModel(String pathSimModel, String modelName)
Adds a file containing a similarity model definition (sim.xml) to the existing loaded similarity model. This method can be handy if the similarity model information has to be complemented during runtime.- Parameters:
pathSimModel- the path to the file to loadmodelName- the name of the model to extend. null refers to the default model
-
extendSimilarityModel
public static void extendSimilarityModel(InputStream streamSimModel, String modelName)
Adds an input stream containing a similarity model definition (sim.xml) to the existing loaded similarity model. This method can be handy if the similarity model information has to be complemented during runtime.- Parameters:
streamSimModel- the path to the file to loadmodelName- the name of the model to extend. null refers to the default model
-
addSimilarityModel
public static void addSimilarityModel(String path, String name)
Initializes and builds the similarity model with the given name. The data is loaded from the file at the given path.- Parameters:
path- the similarity model file to loadname- the name of the similarity model
-
initDefaultDependencyModel
public static DependencyModel initDefaultDependencyModel(String dependencyModelPath, WriteableObjectPool casebase)
Method, that initializes the dependency model from an XML file.- Parameters:
dependencyModelPath- The path of the xml file of the dependency model.casebase- The casebase, between whose cases the dependencies exists.- Returns:
- The initialized dependency model.
-
getDependencyModel
public static DependencyModel getDependencyModel()
Method, that returns the dependency model. If the model wasn't initialized yet, null will be returned.- Returns:
- The dependency model.
-
validateSimModel
public static void validateSimModel(Model model, SimilarityModel simModel)
Validates the similarity model by checking if a defined class from the data model has a respective measure in the similarity model.- Parameters:
model- the model to checksimModel- the similarity model to check
-
-