org.matheclipse.core.patternmatching
Class PatternMap
- java.lang.Object
-
- org.matheclipse.core.patternmatching.PatternMap
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class PatternMap extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableA map from a pattern to a possibly found value during pattern-matching.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description PatternMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description IExpr[]copyPattern()Copy the current values into a new array.voidcopyPatternValuesFromPatternMatcher(PatternMap patternMap)Copy the found pattern matches from the givenpatternMapback to this maps pattern values.IExprgetValue(IPatternObject pattern)java.util.List<IExpr>getValuesAsList()booleanisAllPatternsAssigned()Check if all symbols in the symbols array have corresponding values assigned.booleanisRuleWithoutPatterns()Returns true if the given expression contains no patternsvoidresetPattern(IExpr[] patternValuesArray)Reset the values to the values in the given arrayvoidsetValue(IPatternObject pattern, IExpr expr)intsize()IExprsubstitutePatternSymbols(IExpr expression)Substitute all symbols in the given expression with the current value of the given arrays
-
-
-
Method Detail
-
copyPattern
public IExpr[] copyPattern()
Copy the current values into a new array.- Returns:
- See Also:
resetPattern(IExpr[])
-
copyPatternValuesFromPatternMatcher
public void copyPatternValuesFromPatternMatcher(PatternMap patternMap)
Copy the found pattern matches from the givenpatternMapback to this maps pattern values.- Parameters:
patternMap-
-
getValue
public IExpr getValue(IPatternObject pattern)
-
getValuesAsList
public java.util.List<IExpr> getValuesAsList()
-
isAllPatternsAssigned
public boolean isAllPatternsAssigned()
Check if all symbols in the symbols array have corresponding values assigned.- Returns:
-
isRuleWithoutPatterns
public boolean isRuleWithoutPatterns()
Returns true if the given expression contains no patterns- Returns:
-
resetPattern
public void resetPattern(IExpr[] patternValuesArray)
Reset the values to the values in the given array- Parameters:
patternValuesArray-- See Also:
copyPattern()
-
setValue
public void setValue(IPatternObject pattern, IExpr expr)
-
size
public int size()
-
-
DMelt 3.0 © DataMelt by jWork.ORG