- 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.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TruthValues(String truth, String falsity)
Defines a new mapping, specifying the canonical representations oftrue
andfalse
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
falseValue()
Gets the string value forfalse
.abstract boolean
isFalse(String text)
Indicates whether the given string is a representation forfalse
.abstract boolean
isTrue(String text)
Indicates whether the given string is a representation fortrue
.String
trueValue()
Gets the string value fortrue
.
-
-
-
Method Detail
-
falseValue
public String falseValue()
Gets the string value forfalse
.- Returns:
- the canonical string representation of
false
.
-
trueValue
public String trueValue()
Gets the string value fortrue
.- Returns:
- the canonical string representation of
true
.
-
isTrue
public abstract boolean isTrue(String text)
Indicates whether the given string is a representation fortrue
.- 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 forfalse
.- Parameters:
text
- the string to check- Returns:
true
if the string represents falsity
-
-