public class PatternSequence extends ExprImpl implements IPatternSequence
ASTID, BLANKID, COMPLEXID, DOUBLECOMPLEXID, DOUBLEID, FRACTIONID, INTEGERID, METHODSYMBOLID, PATTERNID, STRINGID, SYMBOLID| Modifier and Type | Method and Description |
|---|---|
<T> T |
accept(IVisitor<T> visitor)
Accept a visitor with return type T
|
boolean |
accept(IVisitorBoolean visitor)
Accept a visitor with return type
boolean |
int |
accept(IVisitorInt visitor)
Accept a visitor with return type
int |
long |
accept(IVisitorLong visitor)
Accept a visitor with return type
long |
int[] |
addPattern(PatternMap patternMap,
java.util.Map<IExpr,java.lang.Integer> patternIndexMap)
Add this pattern to the given
patternMap and patternIndexMap. |
int |
compareTo(IExpr expr)
Compares this expression with the specified expression for order.
|
boolean |
equals(java.lang.Object obj)
Test if this is equal to b.
|
boolean |
equivalent(IPatternObject patternExpr2,
PatternMap pm1,
PatternMap pm2)
Check if the two left-hand-side pattern expressions are equivalent.
|
java.lang.String |
fullFormString()
Return the
FullForm() of this expression |
IExpr |
getCondition()
Get the additional pattern sequences condition expression
|
int |
getEvalFlags()
Get the flags which should be set in an AST structure, if the structure contains a pattern or pattern sequence.
|
int |
getIndex(PatternMap pm)
Get the pattern-matchers index in the
PatternMap |
ISymbol |
getSymbol()
Get the associated symbol for this pattern-object
|
int |
hashCode()
Hashcode of this Element.
|
ISymbol |
head()
If this object is an instance of
IAST get the first element
(offset 0) of the IAST list (i.e. get(0) ). |
int |
hierarchy()
A unique integer ID for the implementation of this expression
|
java.lang.String |
internalJavaString(boolean symbolsAsFactoryMethod,
int depth,
boolean useOperators)
Return the internal Java form of this expression.
|
boolean |
isBlank()
Test if this expression is a
Blank[] object |
boolean |
isCase(IExpr that)
Groovy operator overloading
|
boolean |
isConditionMatchedSequence(IAST sequence,
PatternMap patternMap)
Return
true, if all of the elements in the sequence fulfill the pattern sequences additional
condition |
boolean |
isDefault()
Use default value, if no matching was found.
|
boolean |
isFreeOfPatterns()
Returns
true, if all of the elements in the
subexpressions or the expression itself, are no pattern objects. |
boolean |
isPatternExpr()
Test if this expression or a subexpression is a pattern object.
|
boolean |
isPatternSequence()
Test if this expression is a pattern sequence object
|
boolean |
matchPattern(IExpr expr,
PatternMap patternMap)
Check if this pattern object matches the given
expr. |
boolean |
matchPatternSequence(IAST sequence,
PatternMap patternMap)
Check if this pattern sequence object matches the given
sequence. |
java.lang.String |
toString() |
static PatternSequence |
valueOf(ISymbol symbol) |
static PatternSequence |
valueOf(ISymbol symbol,
IExpr check) |
static PatternSequence |
valueOf(ISymbol symbol,
IExpr check,
boolean def,
boolean zeroArgsAllowed) |
IExpr |
variables2Slots(java.util.Map<IExpr,IExpr> map,
java.util.Collection<IExpr> variableCollector)
Convert the variables (i.e. expressions of type
ISymbol
which aren't constants) in this expression into Slot[] s. |
$div, $minus, $plus, $times, $up, abs, and, apply, apply, asType, conjugate, copy, dec, divide, egcd, evalComplex, evalDouble, evalNumber, evalSignedNumber, factory, gcd, getAt, inc, internalFormString, internalScalaString, inverse, leafCount, leaves, minus, mod, multiply, negate, negative, opposite, optional, or, plus, power, power, remainder, replaceAll, replaceAll, replacePart, replaceRepeated, replaceRepeated, replaceRepeated, replaceSlots, signum, subtract, sum, times, topHead, toScript, toScriptFactoryclone, finalize, getClass, notify, notifyAll, wait, wait, wait$div, $minus, $plus, $times, $up, and, apply, apply, asType, dec, divide, evalComplex, evalDouble, evalNumber, evalSignedNumber, evaluate, evaluateHead, getAt, getField, ifPresent, inc, internalFormString, internalScalaString, inverse, isAllExpanded, isAnd, isArcCos, isArcCosh, isArcSin, isArcSinh, isArcTan, isArcTanh, isAST, isAST, isAST, isAST, isAST, isAST, isAST, isASTSizeGE, isAtom, isComplex, isComplexInfinity, isComplexNumeric, isCondition, isConstant, isCos, isCosh, isDerivative, isDirectedInfinity, isE, isExpanded, isFalse, isFlatAST, isFraction, isFree, isFree, isFree, isFreeAST, isFreeAST, isFunction, isGEOrdered, isGTOrdered, isIndeterminate, isInfinity, isInteger, isIntegerResult, isLEOrdered, isList, isListOfLists, isLog, isLTOrdered, isMatrix, isMember, isMember, isMinusOne, isModule, isNegative, isNegativeInfinity, isNegativeResult, isNonNegativeResult, isNot, isNumber, isNumEqualInteger, isNumEqualRational, isNumeric, isNumericFunction, isNumericMode, isNumIntValue, isOne, isONE, isOr, isOrderlessAST, isPattern, isPatternDefault, isPi, isPlus, isPlusTimesPower, isPolynomial, isPolynomial, isPolynomialOfMaxDegree, isPositive, isPositiveResult, isPower, isPresent, isRational, isRationalResult, isRationalValue, isRealResult, isRuleAST, isSame, isSame, isSequence, isSignedNumber, isSin, isSinh, isSlot, isSlotSequence, isSpan, isSymbol, isTan, isTanh, isTimes, isTrue, isUnit, isValue, isVariable, isVector, isZero, isZERO, leafCount, leaves, minus, mod, multiply, multiply, negative, ofNullable, opposite, optional, or, orElse, orElseGet, orElseThrow, plus, power, power, reciprocal, replaceAll, replaceAll, replacePart, replaceRepeated, replaceRepeated, replaceSlots, signum, subtract, sum, times, timesDistributed, topHeadpublic static PatternSequence valueOf(ISymbol symbol, IExpr check, boolean def, boolean zeroArgsAllowed)
nullAllowed - TODOpublic static PatternSequence valueOf(ISymbol symbol, IExpr check)
numerator - public static PatternSequence valueOf(ISymbol symbol)
public int[] addPattern(PatternMap patternMap, java.util.Map<IExpr,java.lang.Integer> patternIndexMap)
IPatternObjectpatternMap and patternIndexMap.addPattern in interface IPatternObjectpatternMap - a map from a pattern to a possibly found value during pattern-matching.patternIndexMap - a map from the pattern symbol to the intern array indexpublic boolean equals(java.lang.Object obj)
edu.jas.structure.Elementequals in interface edu.jas.structure.Element<IExpr>equals in class java.lang.Objectpublic boolean equivalent(IPatternObject patternExpr2, PatternMap pm1, PatternMap pm2)
f[x_,y_] is equivalent to f[a_,b_] )equivalent in interface IPatternObjectpatternExpr2 - pm1 - pm2 - public boolean matchPattern(IExpr expr, PatternMap patternMap)
IPatternObjectexpr.matchPattern in interface IPatternObjectexpr - the expression which should be matched.patternMap - a map from a pattern to a possibly found value during pattern-matching.public boolean matchPatternSequence(IAST sequence, PatternMap patternMap)
IPatternSequencesequence.matchPatternSequence in interface IPatternSequencesequence - the sequence which should be matched.patternMap - a map from a pattern to a possibly found value during pattern-matching.public IExpr getCondition()
IPatternSequencegetCondition in interface IPatternObjectgetCondition in interface IPatternSequencepublic int getEvalFlags()
IPatternObjectgetEvalFlags in interface IPatternObjectpublic int getIndex(PatternMap pm)
IPatternObjectPatternMapgetIndex in interface IPatternObjectpm - the PatternMap from which we determine the index.public ISymbol getSymbol()
IPatternObjectgetSymbol in interface IPatternObjectpublic int hashCode()
edu.jas.structure.ElementhashCode in interface edu.jas.structure.Element<IExpr>hashCode in class java.lang.Objectpublic int hierarchy()
public java.lang.String internalJavaString(boolean symbolsAsFactoryMethod,
int depth,
boolean useOperators)
ExprImplinternalJavaString in interface IExprinternalJavaString in class ExprImplsymbolsAsFactoryMethod - if true use the F.symbol() method,
otherwise print the symbol name.depth - the recursion depth of this call. 0 indicates
"recurse without a limit".useOperators - use operators instead of function names for representation of
Plus, Times, Power,...public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String fullFormString()
IExprFullForm() of this expressionfullFormString in interface IExprfullFormString in class ExprImplpublic int compareTo(IExpr expr)
public ISymbol head()
ExprImplIAST get the first element
(offset 0) of the IAST list (i.e. get(0) ).public boolean isBlank()
IExprBlank[] objectpublic boolean isConditionMatchedSequence(IAST sequence, PatternMap patternMap)
IPatternSequencetrue, if all of the elements in the sequence fulfill the pattern sequences additional
conditionisConditionMatchedSequence in interface IPatternSequencepublic IExpr variables2Slots(java.util.Map<IExpr,IExpr> map, java.util.Collection<IExpr> variableCollector)
ISymbol
which aren't constants) in this expression into Slot[] s.variables2Slots in interface IExprvariables2Slots in class ExprImplmap - for every given symbol argument return the associated unique
slot from this mapvariableCollector - collects the variables which are used in the replacement
processF.NIL if no variable symbol was found.public <T> T accept(IVisitor<T> visitor)
public boolean accept(IVisitorBoolean visitor)
booleanpublic int accept(IVisitorInt visitor)
intpublic long accept(IVisitorLong visitor)
longpublic boolean isDefault()
isDefault in interface IPatternSequencepublic boolean isFreeOfPatterns()
true, if all of the elements in the
subexpressions or the expression itself, are no pattern objects.isFreeOfPatterns in interface IExprtrue if the expression contains no
IPatternObject.public final boolean isPatternExpr()
IAST with flag
IAST.CONTAINS_PATTERN_EXPR.isPatternExpr in interface IExprpublic final boolean isPatternSequence()
isPatternSequence in interface IExprpublic boolean isCase(IExpr that)