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 Details

    • getInstance

      public static CakeInstance getInstance()

      Getter for the field instance.

      Returns:
      a CakeInstance object
    • 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 WriteableObjectPool object
    • start

      public static <T extends DataObject> WriteableObjectPool<T> start(String composition)

      start.

      Type Parameters:
      T - a T class
      Parameters:
      composition - a String object
      Returns:
      a WriteableObjectPool object
    • start

      public static <T extends DataObject> WriteableObjectPool<T> start(InputStream inputStreamCompositon)

      start.

      Type Parameters:
      T - a T class
      Parameters:
      inputStreamCompositon - a InputStream object
      Returns:
      a WriteableObjectPool object
    • start

      public static <T extends DataObject> WriteableObjectPool<T> start(String composition, String casebase)

      start.

      Type Parameters:
      T - a T class
      Parameters:
      composition - a String object
      casebase - a String object
      Returns:
      a WriteableObjectPool object
    • start

      public static <T extends DataObject> WriteableObjectPool<T> start(InputStream inputStreamCompositon, InputStream inputStreamCasebase)

      start.

      Type Parameters:
      T - a T class
      Parameters:
      inputStreamCompositon - a InputStream object
      inputStreamCasebase - a InputStream object
      Returns:
      a WriteableObjectPool object
    • 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 - a String object
      model - a String object
      simModel - a String object
      casebase - a String object
      Returns:
      a WriteableObjectPool object
    • start

      public static <T extends DataObject> WriteableObjectPool<T> start(InputStream inputStreamCompositon, InputStream inputStreamModel, InputStream inputStreamSimModel, InputStream inputStreamCasebase)

      start.

      Type Parameters:
      T - a T class
      Parameters:
      inputStreamCompositon - a InputStream object
      inputStreamModel - a InputStream object
      inputStreamSimModel - a InputStream object
      inputStreamCasebase - a InputStream object
      Returns:
      a WriteableObjectPool object
    • start

      public static <T extends DataObject> WriteableObjectPool<T> start(String composition, String model, String simModel, String casebase, String transformationConfig)

      start.

      Type Parameters:
      T - a T class
      Parameters:
      composition - a String object
      model - a String object
      simModel - a String object
      casebase - a String object
      transformationConfig - a String object
      Returns:
      a WriteableObjectPool object
    • start

      public static <T extends DataObject> WriteableObjectPool<T> start(InputStream inputStreamCompositon, InputStream inputStreamModel, InputStream inputStreamSimModel, InputStream inputStreamCasebase, InputStream transformationConfig)

      start.

      Type Parameters:
      T - a T class
      Parameters:
      inputStreamCompositon - a InputStream object
      inputStreamModel - a InputStream object
      inputStreamSimModel - a InputStream object
      inputStreamCasebase - a InputStream object
      transformationConfig - a InputStream object
      Returns:
      a WriteableObjectPool object
    • start

      public static <T extends DataObject> WriteableObjectPool<T> start(String composition, String model, String simModel, String casebase, String transformationConfig, boolean reuseDataClassReferencesAtRestart)

      start.

      Type Parameters:
      T - a T class
      Parameters:
      composition - a String object
      model - a String object
      simModel - a String object
      casebase - a String object
      transformationConfig - a String object
      reuseDataClassReferencesAtRestart - a boolean
      Returns:
      a WriteableObjectPool object
    • start

      public static <T extends DataObject> WriteableObjectPool<T> start(String composition, String model, String[] simModels, String caseBase, String transformationConfig, boolean reuseDataClassReferencesAtRestart)

      start.

      Type Parameters:
      T - a T class
      Parameters:
      composition - a String object
      model - a String object
      simModels - an array of String objects
      caseBase - a String object
      transformationConfig - a String object
      reuseDataClassReferencesAtRestart - a boolean
      Returns:
      a WriteableObjectPool object
    • start

      public static <T extends DataObject> WriteableObjectPool<T> start(InputStream composition, InputStream model, InputStream[] simModels, InputStream casebase, InputStream transformationConfig, boolean reuseDataClassReferencesAtRestart)

      start.

      Type Parameters:
      T - a T class
      Parameters:
      composition - a InputStream object
      model - a InputStream object
      simModels - an array of InputStream objects
      casebase - a InputStream object
      transformationConfig - a InputStream object
      reuseDataClassReferencesAtRestart - a boolean
      Returns:
      a WriteableObjectPool object
    • start

      public static <T extends DataObject> WriteableObjectPool<T> start(InputStream composition, InputStream model, InputStream simModel, InputStream casebase, InputStream transformationConfig, boolean reuseDataClassReferencesAtRestart)

      start.

      Type Parameters:
      T - a T class
      Parameters:
      composition - a InputStream object
      model - a InputStream object
      simModel - a InputStream object
      casebase - a InputStream object
      transformationConfig - a InputStream object
      reuseDataClassReferencesAtRestart - a boolean
      Returns:
      a WriteableObjectPool object
    • addSimModel

      public static void addSimModel(String path)
      Add Similarity Measures in SimilarityModel to default SimilarityModel.
      Parameters:
      path - the path to the file to add and validate.
    • 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 load
      modelName - 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 load
      modelName - 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 load
      modelName - 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 load
      modelName - 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 load
      name - 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 check
      simModel - the similarity model to check
    • withComposition

      public CakeInstance withComposition(String path)

      withComposition.

      Parameters:
      path - a String object
      Returns:
      a CakeInstance object
    • withModel

      public CakeInstance withModel(String path)

      withModel.

      Parameters:
      path - a String object
      Returns:
      a CakeInstance object
    • withSimModel

      public CakeInstance withSimModel(String path)

      withSimModel.

      Parameters:
      path - a String object
      Returns:
      a CakeInstance object
    • withCaseBase

      public CakeInstance withCaseBase(String path)

      withCaseBase.

      Parameters:
      path - a String object
      Returns:
      a CakeInstance object
    • withReuseDataClassReferencesAtRestart

      public CakeInstance withReuseDataClassReferencesAtRestart(boolean flag)

      withReuseDataClassReferencesAtRestart.

      Parameters:
      flag - a boolean
      Returns:
      a CakeInstance object
    • run

      public <T extends DataObject> WriteableObjectPool<T> run()

      run.

      Type Parameters:
      T - a T class
      Returns:
      a WriteableObjectPool object