Enum EquivalentClassReasoningMode

  • All Implemented Interfaces:
    Serializable, Comparable<EquivalentClassReasoningMode>

    public enum EquivalentClassReasoningMode
    extends Enum<EquivalentClassReasoningMode>
    Created by edouglass on 5/5/17.

    Enum of the three different equivalent class reasoning strategies. ALL means all equivalent classes detected are allowed. NONE means any equivalent class should fail, and ASSERTED_ONLY means that only if the inferred equivalence class has been previously asserted directly in the ontology is the equivalence class allowed.

    This is also how the command line options are detected. For backwards compatibility, the old "true" is a synonym for ALL, and "false" is a synonym for NONE. The #validates(String) method detects if the given String is a synonym or the uncapitalized name of the enum instance. For example, either "all" or "true" would validate to the instance ALL.

    Lastly, one of the enum instances can easily be returned from a string with the static #from(String) method. This is like a constructor. If the given string validates to any of the enum instances, then that instance is returned. By default ALL is returned. This is how a Mode instance should be retrieved from a string (say from the command line).

    • Enum Constant Detail

      • ASSERTED_ONLY

        public static final EquivalentClassReasoningMode ASSERTED_ONLY
        Only allows directly asserted equivalent classes. If there are equivalent classes inferred that do are not already asserted in the ontology, then this is considered an error.
    • Method Detail

      • values

        public static EquivalentClassReasoningMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (EquivalentClassReasoningMode c : EquivalentClassReasoningMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EquivalentClassReasoningMode valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getExplanation

        public String getExplanation()
        Get the explanation.
        Returns:
        explanation
      • written

        public String written()
        Change mode to command line format.
        Returns:
        command-line String
      • validates

        public boolean validates​(String s)
        Checks if the given string counts as this mode. A string validates to a mode if s is the written form or one of the synonyms of this Mode.
        Parameters:
        s - String to validate
        Returns:
        True if the given string s is valid, False if not.
      • from

        public static EquivalentClassReasoningMode from​(String s)
        Canonical way to find make a Mode instance from a String (say from a command line argument). Tries to validate the string against one of the instances and if a mode instance is found, it's returned. If no match is found, ALL is returned by default.
        Parameters:
        s - String to match to a Mode instance.
        Returns:
        Mode enum instance that matches the String, or ALL by default.