Class TruthValues

java.lang.Object
com.pervasive.datarush.encoding.text.TruthValues
Direct Known Subclasses:
ExactTruthMapping, InsensitiveTruthMapping

public abstract class TruthValues extends Object
A mapping between boolean values and strings. Any number of strings may be mapped to a boolean value, but each boolean value must have a single canonical string representation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final String
    Text representing a value of false.
    protected final String
    Text representing a value of true.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    TruthValues(String truth, String falsity)
    Defines a new mapping, specifying the canonical representations of true and false.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the string value for false.
    abstract boolean
    Indicates whether the given string is a representation for false.
    abstract boolean
    isTrue(String text)
    Indicates whether the given string is a representation for true.
    Gets the string value for true.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • truth

      protected final String truth
      Text representing a value of true.
    • falsity

      protected final String falsity
      Text representing a value of false.
  • Constructor Details

    • TruthValues

      protected TruthValues(String truth, String falsity)
      Defines a new mapping, specifying the canonical representations of true and false.
      Parameters:
      truth - the canonical string representation of true.
      falsity - the canonical string representation of false.
  • Method Details

    • falseValue

      public String falseValue()
      Gets the string value for false.
      Returns:
      the canonical string representation of false.
    • trueValue

      public String trueValue()
      Gets the string value for true.
      Returns:
      the canonical string representation of true.
    • isTrue

      public abstract boolean isTrue(String text)
      Indicates whether the given string is a representation for true.
      Parameters:
      text - the string to check
      Returns:
      true if the string represents truth
    • isFalse

      public abstract boolean isFalse(String text)
      Indicates whether the given string is a representation for false.
      Parameters:
      text - the string to check
      Returns:
      true if the string represents falsity