Class SimilarityModelFactory

java.lang.Object
de.uni_trier.wi2.procake.similarity.SimilarityModelFactory
All Implemented Interfaces:
Factory

public class SimilarityModelFactory extends Object implements Factory
This Factory class provides the implementation to the SimilarityModel  interfaces. ProCAKE contains one default SimilarityModel that can be accessed via getDefaultSimilarityModel().
Author:
Rainer Maximini, Christian Zeyen
  • Field Details

    • DEFAULT_SIM_MODEL_NAME

      public static String DEFAULT_SIM_MODEL_NAME
  • Method Details

    • bind

      public static boolean bind(SimilarityModelFactoryObject implementation)
    • getDefaultSimilarityModel

      public static SimilarityModel getDefaultSimilarityModel()
      The CAKE system contains one default SimilarityModel that can be accessed via this method.
      Returns:
      The default SimilarityModel instance.
    • getSimilarityModels

      public static Set<SimilarityModel> getSimilarityModels()
      Returns:
      All available similarity models.
    • getSimilarityModelNames

      public static Set<String> getSimilarityModelNames()
      Returns:
      All available similarity model names.
    • getSimilarityModelPaths

      public static Set<String> getSimilarityModelPaths()
      Returns:
      The model path with the given name.
    • getSimilarityModelPath

      public static String getSimilarityModelPath(String name)
      Parameters:
      name - similarity model name defined in composition.xml
      Returns:
      The similarity model path.
    • getSimilarityModel

      public static SimilarityModel getSimilarityModel(String name)
      Parameters:
      name - similarity model name defined in composition.xml
      Returns:
      The similarity model SimilarityModel with the given name.
    • newSimilarityModel

      public static SimilarityModel newSimilarityModel(String name)
      This method creates a new similarity model and may overwrite an existing model with the same name.
      Parameters:
      name - The name of the new similarity model. If name equals DEFAULT_SIM_MODEL_NAME, the new SimilarityModel will be the default Model. It is not possible to go back to the previous model.
    • newSimilarityValuatorForModel

      public static SimilarityValuator newSimilarityValuatorForModel(String modelName)
      Returns:
      A SimilarityValuator instance for the model of the given name SimilarityModel.
    • newSimilarityValuator

      public static SimilarityValuator newSimilarityValuator()
      Returns:
      A SimilarityValuator instance for the default SimilarityModel.
    • newSimilarityValuator

      public static SimilarityValuator newSimilarityValuator(SimilarityModel simModel)
      Parameters:
      simModel - The SimilarityModel that should be used.
      Returns:
      A SimilarityValuator instance for the given SimilarityModel.
    • unbind

      public static boolean unbind(SimilarityModelFactoryObject implementation)
    • reset

      public void reset()
      Description copied from interface: Factory
      This method has to be implemented by every factory in order to allow a proper restart of ProCAKE. For example, this method might reset the default factory object or other stateful variables.
      Specified by:
      reset in interface Factory
    • bind

      public boolean bind(Object implementation)
      Description copied from interface: Factory
      Bind an implementation to the factory.
      Specified by:
      bind in interface Factory
      Parameters:
      implementation - The object to bind.
      Returns:
      true if the factory accept the implementation, otherwise false .
      See Also:
    • unbind

      public boolean unbind(Object implementation)
      Description copied from interface: Factory
      Unbinds an implementation from the factory.
      Specified by:
      unbind in interface Factory
      Parameters:
      implementation - The object to unbind.
      Returns:
      true if the factory accept the implementation, otherwise false .
      See Also: