public class Predicates
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Predicates.IsBinaryFalse
Check if the evaluation of a binary AST object gives
False |
static class |
Predicates.IsBinaryTrue
Check if the evaluation of a binary AST object gives
True |
Modifier and Type | Method and Description |
---|---|
static java.util.function.Predicate<IExpr> |
in(IAST ast)
Returns a predicate that evaluates to
true if the object
reference being tested is one of the arguments of the given
ast . |
static java.util.function.Predicate<IExpr> |
in(IExpr expr)
Returns a predicate that evaluates to
true if the object
reference being tested is one of the arguments of the given
ast . |
static java.util.function.Predicate<IExpr> |
isAST(ISymbol[] heads)
Returns a predicate that evaluates to
true if the
input is an AST list, which contains one of the given
header elements at index position 0 . |
static java.util.function.BiPredicate<IExpr,IExpr> |
isBinaryFalse(IExpr expr)
Check if the evaluation of the
expr object gives
False . |
static java.util.function.BiPredicate<IExpr,IExpr> |
isBinaryTrue(IExpr expr)
Check if the evaluation of the
expr object gives
True . |
static java.util.function.Predicate<IExpr> |
isFree(IExpr expr)
Returns a predicate that evaluates to
true if the object
reference being tested is free of the arguments of the given
ast . |
static java.util.function.Predicate<IExpr> |
isNumber()
Returns a predicate that evaluates to
true if
input.isNumber() gives true . |
static java.util.function.Predicate<IExpr> |
isNumeric()
Returns a predicate that evaluates to
true if
input.isNumeric() gives true . |
static java.util.function.Predicate<IExpr> |
isNumericFunction()
Returns a predicate that evaluates to
true if
input.isNumericFunction() gives true . |
static java.util.function.Predicate<IExpr> |
isPattern()
Returns a predicate that evaluates to
true if the input is an
instanceof IPattern . |
static java.util.function.Predicate<IExpr> |
isSignedNumber()
Returns a predicate that evaluates to
true if
input.isSignedNumber() gives true . |
static java.util.function.Predicate<IExpr> |
isTrue(EvalEngine engine,
IExpr head)
Check if the evaluation of the
expr object gives
True . |
static java.util.function.Predicate<IExpr> |
isTrue(IExpr expr)
Check if the evaluation of the
expr object gives
True . |
static java.util.function.Predicate<IExpr> |
isUnaryVariableOrPattern() |
public static java.util.function.Predicate<IExpr> in(IAST ast)
true
if the object
reference being tested is one of the arguments of the given
ast
. It does not defensively copy the collection passed in,
so future changes to it will alter the behavior of the predicate.ast
- the AST those arguments may contain the function inputpublic static java.util.function.Predicate<IExpr> in(IExpr expr)
true
if the object
reference being tested is one of the arguments of the given
ast
. It does not defensively copy the collection passed in,
so future changes to it will alter the behavior of the predicate.expr
- the expr which may match the function inputpublic static java.util.function.Predicate<IExpr> isAST(ISymbol[] heads)
true
if the
input
is an AST list, which contains one of the given
header elements at index position 0
.public static java.util.function.BiPredicate<IExpr,IExpr> isBinaryFalse(IExpr expr)
expr
object gives
False
. A IsBinaryFalse
predicate will be
returned.expr
- IsUnaryTrue
public static java.util.function.BiPredicate<IExpr,IExpr> isBinaryTrue(IExpr expr)
expr
object gives
True
. A IsUnaryTrue
predicate will be returned.expr
- IsUnaryTrue
public static java.util.function.Predicate<IExpr> isFree(IExpr expr)
true
if the object
reference being tested is free of the arguments of the given
ast
. Calls IExpr#isFree(expr, true)
.expr
- the expr which may match the function inputpublic static java.util.function.Predicate<IExpr> isNumber()
true
if
input.isNumber()
gives true
.public static java.util.function.Predicate<IExpr> isNumeric()
true
if
input.isNumeric()
gives true
. The predicates test if
an input expression is a numeric number (i.e. an instance of type INum or
type IComplexNumpublic static java.util.function.Predicate<IExpr> isNumericFunction()
true
if
input.isNumericFunction()
gives true
. The predicates
test if an input expression is a numeric function (i.e. a number, a
symbolic constant or a function (with attribute NumericFunction) where
all arguments are also "numeric functions")public static java.util.function.Predicate<IExpr> isPattern()
true
if the input is an
instanceof IPattern
.public static java.util.function.Predicate<IExpr> isSignedNumber()
true
if
input.isSignedNumber()
gives true
.public static java.util.function.Predicate<IExpr> isTrue(EvalEngine engine, IExpr head)
expr
object gives
True
. If expr
is a symbol, which has an
assigned Predicate
evaluator object, the predicate will be
returned. Otherwise a IsUnaryTrue
predicate will be
returned.engine
- head
- IsUnaryTrue
public static java.util.function.Predicate<IExpr> isTrue(IExpr expr)
expr
object gives
True
. If expr
is a symbol, which has an
assigned Predicate
evaluator object, the predicate will be
returned. Otherwise a IsUnaryTrue
predicate will be
returned.expr
- IsUnaryTrue
public static java.util.function.Predicate<IExpr> isUnaryVariableOrPattern()