Class ExactTruthMapping


  • public class ExactTruthMapping
    extends TruthValues
    A one-to-one mapping of strings to boolean values which does case-sensitive comparisons.
    • Constructor Detail

      • ExactTruthMapping

        public ExactTruthMapping​(String truth,
                                 String falsity)
        Creates a new case-sensitive mapping with the given values.
        Parameters:
        truth - the string representation of true
        falsity - the string representation of false
    • Method Detail

      • falseValue

        public String falseValue()
        Description copied from class: TruthValues
        Gets the string value for false.
        Overrides:
        falseValue in class TruthValues
        Returns:
        the canonical string representation of false.
      • trueValue

        public String trueValue()
        Description copied from class: TruthValues
        Gets the string value for true.
        Overrides:
        trueValue in class TruthValues
        Returns:
        the canonical string representation of true.
      • isTrue

        public boolean isTrue​(String text)
        Description copied from class: TruthValues
        Indicates whether the given string is a representation for true.
        Specified by:
        isTrue in class TruthValues
        Parameters:
        text - the string to check
        Returns:
        true if the string represents truth
      • isFalse

        public boolean isFalse​(String text)
        Description copied from class: TruthValues
        Indicates whether the given string is a representation for false.
        Specified by:
        isFalse in class TruthValues
        Parameters:
        text - the string to check
        Returns:
        true if the string represents falsity