org.matheclipse.core.expression
Class PatternSequence
- java.lang.Object
-
- org.matheclipse.core.expression.ExprImpl
-
- org.matheclipse.core.expression.PatternSequence
-
- All Implemented Interfaces:
- AbelianGroupElem<IExpr>, Element<IExpr>, MonoidElem<IExpr>, RingElem<IExpr>, java.io.Serializable, java.lang.Comparable<IExpr>, IExpr, IPatternObject, IPatternSequence
public class PatternSequence extends ExprImpl implements IPatternSequence
A concrete pattern sequence 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 pattern sequences 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 sequence patternbooleanisCase(IExpr that)Groovy operator overloadingbooleanisConditionMatchedSequence(IAST sequence)Returntrue, if all of the elements in thesequencefulfill the pattern sequences additional conditionbooleanisDefault()Use default value, if no matching was found.booleanisPatternExpr()Test if this expression or a subexpression is a pattern object.booleanisPatternSequence()Test if this expression is a pattern sequence objectvoidsetIndex(int i)Set the pattern-matchers index in thePatternMapjava.lang.StringtoString()static PatternSequencevalueOf(ISymbol symbol)static PatternSequencevalueOf(ISymbol symbol, IExpr check)static PatternSequencevalueOf(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, isPattern, 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, isPattern, 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 PatternSequence valueOf(ISymbol symbol, IExpr check, boolean def)
-
valueOf
public static PatternSequence valueOf(ISymbol symbol, IExpr check)
- Parameters:
numerator-- Returns:
-
valueOf
public static PatternSequence valueOf(ISymbol symbol)
-
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:IPatternSequenceGet the additional pattern sequences condition expression- Specified by:
getConditionin interfaceIPatternSequence- 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()
A unique integer ID for the implementation of this expression
-
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".
-
setIndex
public void setIndex(int i)
Description copied from interface:IPatternObjectSet the pattern-matchers index in thePatternMap- Specified by:
setIndexin interfaceIPatternObject
-
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:IPatternSequenceReturntrue, if the expression is a blank sequence pattern- Specified by:
isBlankin interfaceIPatternSequence- Returns:
-
isConditionMatchedSequence
public boolean isConditionMatchedSequence(IAST sequence)
Description copied from interface:IPatternSequenceReturntrue, if all of the elements in thesequencefulfill the pattern sequences additional condition- Specified by:
isConditionMatchedSequencein interfaceIPatternSequence- 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 no matching was found.- Specified by:
isDefaultin interfaceIPatternSequence- Returns:
-
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
-
isPatternSequence
public final boolean isPatternSequence()
Test if this expression is a pattern sequence object- Specified by:
isPatternSequencein interfaceIExpr- Overrides:
isPatternSequencein classExprImpl
-
isCase
public boolean isCase(IExpr that)
Groovy operator overloading
-
-
DMelt 3.0 © DataMelt by jWork.ORG