org.matheclipse.core.expression
Class Pattern
- java.lang.Object
-
- org.matheclipse.core.expression.ExprImpl
-
- org.matheclipse.core.expression.Pattern
-
- All Implemented Interfaces:
- AbelianGroupElem<IExpr>, Element<IExpr>, MonoidElem<IExpr>, RingElem<IExpr>, java.io.Serializable, java.lang.Comparable<IExpr>, IExpr, IPattern, IPatternObject
public class Pattern extends ExprImpl implements IPattern
A concrete pattern implementation.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.matheclipse.core.interfaces.IExpr
ASTID, COMPLEXID, DOUBLECOMPLEXID, DOUBLEID, FRACTIONID, INTEGERID, METHODSYMBOLID, PATTERNID, STRINGID, SYMBOLID
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description <T> Taccept(IVisitor<T> visitor)Accept a visitor with return type Tbooleanaccept(IVisitorBoolean visitor)Accept a visitor with return typebooleanintaccept(IVisitorInt visitor)Accept a visitor with return typeintintcompareTo(IExpr obj)Compares this expression with the specified expression for order.booleanequals(java.lang.Object obj)Test if this is equal to b.java.lang.StringfullFormString()Return the FullForm of this expressionIExprgetCondition()Get the additional patterns condition expressionintgetIndex()Get the pattern-matchers index in thePatternMapISymbolgetSymbol()Get the associated symbol for this pattern-objectinthashCode()Hashcode of this Element.ISymbolhead()If this object is an instance ofIASTget the first element (offset 0) of theIASTlist (i.e.inthierarchy()A unique integer ID for the implementation of this expressionjava.lang.StringinternalFormString(boolean symbolsAsFactoryMethod, int depth)Return the internal Java form of this expression.booleanisBlank()Returntrue, if the expression is a blank patternbooleanisCase(IExpr that)Groovy operator overloadingbooleanisConditionMatched(IExpr expr)Returntrue, if the expression fullfills the patterns additional conditionbooleanisDefault()Use default value, if not matching was found.booleanisPattern()Test if this expression is a pattern objectbooleanisPatternExpr()Test if this expression or a subexpression is a pattern object.voidsetIndex(int i)Set the pattern-matchers index in thePatternMapjava.lang.StringtoString()static IPatternvalueOf(ISymbol symbol)static IPatternvalueOf(ISymbol symbol, IExpr check)static IPatternvalueOf(ISymbol symbol, IExpr check, boolean def)IExprvariables2Slots(java.util.Map<IExpr,IExpr> map, java.util.List<IExpr> variableList)Convert the variables (i.e.-
Methods inherited from class org.matheclipse.core.expression.ExprImpl
abs, and, apply, apply, asType, copy, divide, egcd, evaluate, factory, gcd, getAt, inverse, isAnd, isArcCos, isArcCosh, isArcSin, isArcSinh, isArcTan, isArcTanh, isAST, isAST, isAST, isAST, isAST, isAST, isASTSizeGE, isAtom, isComplex, isComplexInfinity, isComplexNumeric, isCondition, isConstant, isCos, isCosh, isDirectedInfinity, isFalse, isFlatAST, isFraction, isFree, isFree, isFunction, isGEOrdered, isGTOrdered, isInfinity, isInteger, isLEOrdered, isList, isListOfLists, isLog, isLTOrdered, isMatrix, isMember, isMember, isMinusOne, isModule, isNegative, isNegativeInfinity, isNot, isNumber, isNumEqualInteger, isNumeric, isNumericFunction, isNumIntValue, isOne, isONE, isOr, isOrderlessAST, isPatternSequence, isPlus, isPositive, isPower, isRational, isRealFunction, isRuleAST, isSame, isSame, isSequence, isSignedNumber, isSin, isSinh, isSlot, isSlotSequence, isSymbol, isTan, isTanh, isTimes, isTrue, isUnit, isValue, isVector, isZero, isZERO, leaves, minus, mod, multiply, negate, negative, opposite, or, plus, power, power, remainder, replaceAll, replaceAll, replacePart, replaceRepeated, replaceRepeated, replaceRepeated, replaceSlots, signum, subtract, sum, times, topHead, toScript, toScriptFactory
-
Methods inherited from interface org.matheclipse.core.interfaces.IExpr
and, apply, apply, asType, evaluate, getAt, inverse, isAnd, isArcCos, isArcCosh, isArcSin, isArcSinh, isArcTan, isArcTanh, isAST, isAST, isAST, isAST, isAST, isAST, isASTSizeGE, isAtom, isComplex, isComplexInfinity, isComplexNumeric, isCondition, isConstant, isCos, isCosh, isDirectedInfinity, isFalse, isFlatAST, isFraction, isFree, isFree, isFunction, isGEOrdered, isGTOrdered, isInfinity, isInteger, isLEOrdered, isList, isListOfLists, isLog, isLTOrdered, isMatrix, isMember, isMember, isMinusOne, isModule, isNegative, isNegativeInfinity, isNot, isNumber, isNumEqualInteger, isNumeric, isNumericFunction, isNumIntValue, isOne, isOr, isOrderlessAST, isPatternSequence, isPlus, isPositive, isPower, isRational, isRealFunction, isRuleAST, isSame, isSame, isSequence, isSignedNumber, isSin, isSinh, isSlot, isSlotSequence, isSymbol, isTan, isTanh, isTimes, isTrue, isValue, isVector, isZero, leaves, minus, mod, multiply, negative, or, plus, power, power, replaceAll, replaceAll, replacePart, replaceRepeated, replaceRepeated, replaceSlots, signum, times, topHead
-
Methods inherited from interface edu.jas.structure.AbelianGroupElem
abs, isZERO, negate, subtract, sum
-
Methods inherited from interface edu.jas.structure.MonoidElem
divide, isONE, isUnit, remainder
-
Methods inherited from interface edu.jas.structure.Element
copy, factory, toScript, toScriptFactory
-
-
-
-
Method Detail
-
valueOf
public static IPattern valueOf(ISymbol symbol, IExpr check)
- Parameters:
numerator-- Returns:
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:ElementTest if this is equal to b.
-
getCondition
public IExpr getCondition()
Description copied from interface:IPatternGet the additional patterns condition expression- Specified by:
getConditionin interfaceIPattern- Returns:
- may return null;
-
getIndex
public int getIndex()
Description copied from interface:IPatternObjectGet the pattern-matchers index in thePatternMap- Specified by:
getIndexin interfaceIPatternObject- Returns:
-
getSymbol
public ISymbol getSymbol()
Description copied from interface:IPatternObjectGet the associated symbol for this pattern-object- Specified by:
getSymbolin interfaceIPatternObject- Returns:
-
hashCode
public int hashCode()
Description copied from interface:ElementHashcode of this Element.
-
hierarchy
public int hierarchy()
Description copied from interface:IExprA unique integer ID for the implementation of this expression
-
setIndex
public void setIndex(int i)
Description copied from interface:IPatternObjectSet the pattern-matchers index in thePatternMap- Specified by:
setIndexin interfaceIPatternObject
-
internalFormString
public java.lang.String internalFormString(boolean symbolsAsFactoryMethod, int depth)Description copied from interface:IExprReturn the internal Java form of this expression.- Specified by:
internalFormStringin interfaceIExpr- Overrides:
internalFormStringin classExprImpl- Parameters:
symbolsAsFactoryMethod- iftrueuse theF.symbol()method, otherwise print the symbol name.depth- the recursion depth of this call.0indicates "recurse without a limit".
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
fullFormString
public java.lang.String fullFormString()
Description copied from interface:IExprReturn the FullForm of this expression- Specified by:
fullFormStringin interfaceIExpr- Overrides:
fullFormStringin classExprImpl
-
compareTo
public int compareTo(IExpr obj)
Compares this expression with the specified expression for order. Returns a negative integer, zero, or a positive integer as this expression is canonical less than, equal to, or greater than the specified expression.
-
head
public ISymbol head()
Description copied from interface:IExprIf this object is an instance ofIASTget the first element (offset 0) of theIASTlist (i.e. get(0) ).
-
isBlank
public boolean isBlank()
Description copied from interface:IPatternReturntrue, if the expression is a blank pattern
-
isConditionMatched
public boolean isConditionMatched(IExpr expr)
Description copied from interface:IPatternReturntrue, if the expression fullfills the patterns additional condition- Specified by:
isConditionMatchedin interfaceIPattern- Returns:
-
variables2Slots
public IExpr variables2Slots(java.util.Map<IExpr,IExpr> map, java.util.List<IExpr> variableList)
Description copied from interface:IExprConvert the variables (i.e. ISymbol's with lower case character in the 0-th position of their name) in this expression into Slot[] s.- Specified by:
variables2Slotsin interfaceIExpr- Overrides:
variables2Slotsin classExprImpl- Returns:
nullif the expression contains a variable with a '$' character in the 0-th position of its name and the math engine runs in server mode.
-
accept
public <T> T accept(IVisitor<T> visitor)
Accept a visitor with return type T
-
accept
public boolean accept(IVisitorBoolean visitor)
Accept a visitor with return typeboolean
-
accept
public int accept(IVisitorInt visitor)
Accept a visitor with return typeint
-
isDefault
public boolean isDefault()
Use default value, if not matching was found.
-
isPattern
public final boolean isPattern()
Test if this expression is a pattern object
-
isPatternExpr
public final boolean isPatternExpr()
Test if this expression or a subexpression is a pattern object. Used in pattern-matching; checks flags inIASTwith flagIAST.CONTAINS_PATTERN_EXPR.- Specified by:
isPatternExprin interfaceIExpr- Overrides:
isPatternExprin classExprImpl
-
isCase
public boolean isCase(IExpr that)
Groovy operator overloading
-
-
DMelt 3.0 © DataMelt by jWork.ORG