Class Mapping.Predicate
java.lang.Object
edu.uky.cs.nil.sabre.Mapping.Predicate
- All Implemented Interfaces:
Logical, Simplifiable, Typed, Mapping<Disjunction<Clause<Precondition>>>, Serializable, Comparable<Logical>
- Enclosing interface:
Mapping<E extends Expression>
public static class Mapping.Predicate
extends Object
implements Mapping<Disjunction<Clause<Precondition>>>
- Author:
- Stephen G. Ware
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface Mapping
Mapping.Function, Mapping.Predicate -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new predicate.Predicate(ImmutableSet<Character> characters) Constructs a new predicate. -
Method Summary
Modifier and TypeMethodDescriptionApplies a given function to every part of this logical formula and then creates a new logical formula of this same type using the results returned from the function.<T extends Expression>
Mapping<T> Casts the type of expression returned by this mapping to a different type.intbooleanReturns an expression relevant to the given character.inthashCode()booleanTests whether this formula is of a giventype.booleanTests whether this formula is of typeboolean.booleanTests whether this formula is of typecharacter.booleanisEntity()Tests whether this formula is of typeentity.booleanisGround()Tests whether this logical formula is ground, which means that it contains novariables.booleanisNumber()Tests whether this formula is of typenumber.toString()Methods inherited from interface Logical
collect, collect, collect, distinguish, find, find, find, mustBeGround, occurs, substitute, substituteMethods inherited from interface Typed
mustBe, mustBeBoolean, mustBeCharacter, mustBeEntity, mustBeNumber, mustNotBe, mustNotBeBoolean, mustNotBeCharacter, mustNotBeEntity, mustNotBeNumber
-
Constructor Details
-
Predicate
Constructs a new predicate.- Parameters:
characters- the characters for which this mapping should return true
-
Predicate
Constructs a new predicate.- Parameters:
characters- the characters for which this mapping should return true
-
-
Method Details
-
equals
-
hashCode
-
toString
-
compareTo
-
isGround
-
apply
Description copied from interface:LogicalApplies a given function to every part of this logical formula and then creates a new logical formula of this same type using the results returned from the function. If, for every part of this formula, the function always returns its input as output with no changes, this method should return this object (not just any object that isequal tothis object).- Specified by:
applyin interfaceLogical- Specified by:
applyin interfaceMapping<Disjunction<Clause<Precondition>>>- Specified by:
applyin interfaceSimplifiable- Parameters:
function- the function to apply to all parts of this formula- Returns:
- a logical formula of the same type as this formula made from the returned objects, or this object if no parts were changed by the function
-
isBoolean
-
isNumber
-
isEntity
-
isCharacter
public boolean isCharacter()Description copied from interface:TypedTests whether this formula is of typecharacter.- Specified by:
isCharacterin interfaceTyped- Returns:
- true if the formula is of type character, false otherwise
-
is
-
get
Description copied from interface:MappingReturns an expression relevant to the given character.- Specified by:
getin interfaceMapping<Disjunction<Clause<Precondition>>>- Parameters:
character- the character- Returns:
- the expression
-
cast
Description copied from interface:MappingCasts the type of expression returned by this mapping to a different type.- Specified by:
castin interfaceMapping<Disjunction<Clause<Precondition>>>- Type Parameters:
T- the new type of expression this mapping should return- Parameters:
type- the class object for the new type- Returns:
- a mapping that returns expressions of the new type
-