Interface ICaseBase

All Known Subinterfaces:
IMutableCaseBase
All Known Implementing Classes:
CaseBase

public interface ICaseBase
The casebase interface defines the methods that can be used to retrieve cases of a specific type. A casebase contains only entities of the type the casebase is defined for. When an entity is specified to have sub types, the instances of those cases will be contained in their own casebase. Consider a model with person entities and the derived types employee and customer. The resulting casebase model would consist of casebases for each type, where the person casebase would be the root node having the customer and employee casebases as leaf nodes.
Since:
6.2
Author:
O. Kerpershoek
  • Method Summary

    Modifier and Type
    Method
    Description
    getCase(String caseName)
    This method locates the case with the given name within this casebase or it's parent case base.
    getCases(boolean includeSubTypes)
    This method returns all the cases of this casebase.
    int
    This method returns the threshold that will be used for cases when the match request does not specify a threshold.
    This method returns the name of the attribute whose values should be used to group the results on.
    int
    This method returns the maximum number of values that may be grouped on one unique key value.
    int
    This method returns the maximum number of result that will be returned by a match action when the match request does not specify a maximum.
    This method returns the entity name for which the cases in this casebase are defined.
    This returns all the match definitions that should be used to match the values of a case from this casebase.
    This method returns an array of casebases containing the casebases of the sub types of the entity this casebase is defined for.
    This method returns the casebase for the super type of the entity this casebase is defined for.
  • Method Details

    • getEntityName

      String getEntityName()
      This method returns the entity name for which the cases in this casebase are defined.
      Returns:
      the entity name for which the cases in this casebase are defined.
    • getDefaultMaxResults

      int getDefaultMaxResults()
      This method returns the maximum number of result that will be returned by a match action when the match request does not specify a maximum.
      Returns:
      The maximum number of results from a match action.
    • getDefaultCaseThreshold

      int getDefaultCaseThreshold()
      This method returns the threshold that will be used for cases when the match request does not specify a threshold.
      Returns:
      the threshold that will be used for cases when the match request does not specify a threshold.
    • getDefaultKeyField

      String getDefaultKeyField()
      This method returns the name of the attribute whose values should be used to group the results on. The key field is optional, so this method may return null when no key field has been specified. Note: Only attributes that are matched may be used as key field.
      Returns:
      the name of the attribute whose values should be used to group the results on.
    • getDefaultMaxKeyResults

      int getDefaultMaxKeyResults()
      This method returns the maximum number of values that may be grouped on one unique key value.
      Returns:
      the maximum number of values that may be grouped on one unique key value.
    • getSuperType

      ICaseBase getSuperType()
      This method returns the casebase for the super type of the entity this casebase is defined for. When the entity of this casebase does not have a super type defined, this method will return null.
      Returns:
      The casebase for the super type of the entity, or null when the entity does not have a super type.
    • getSubTypes

      ICaseBase[] getSubTypes()
      This method returns an array of casebases containing the casebases of the sub types of the entity this casebase is defined for. When the entity does not have any sub types, this method will return an empty array.
      Returns:
      An array containing the casebases for the sub types of the entity this casebase is defined for.
    • getCases

      ICase[] getCases(boolean includeSubTypes)
      This method returns all the cases of this casebase. The boolean argument 'includeSubTypes' may be used to request only the cases that are defined for the entity type of this casebase, or to retrieve all cases that match the current type.
      Parameters:
      includeSubTypes - Boolean that may be used to request all the cases matching the entity type (true), or just the cases defined in this casebase (false).
      Returns:
      Array containing the cases defined for the entity type of this casebase.
    • getMatchDefinitions

      IMatchDefinition[] getMatchDefinitions()
      This returns all the match definitions that should be used to match the values of a case from this casebase. The array of the match definition matches the order of the array from ICase.getValues.

      Important note: This ordering of the output array is a design v.s. optimization issue which has favored to the optimization side. Since a casebase consisting of 1,000,000 cases matching over 20 attributes per case will result in 20 million hash map lookups. Since the order is known from the clients point of view one can access this array directly resulting in a much faster process.

      Returns:
      The match definitions that should be used to match the values of a case from this casebase.
    • getCase

      ICase getCase(String caseName)
      This method locates the case with the given name within this casebase or it's parent case base.
      Parameters:
      caseName - The case name, the lookup will be case insensitive.
      Returns:
      The matching case, never null.
      Throws:
      UnknownCaseException - When the case could not be found.