Package net.sf.saxon.pattern
Class UniversalPattern
- java.lang.Object
-
- net.sf.saxon.expr.Expression
-
- net.sf.saxon.expr.PseudoExpression
-
- net.sf.saxon.pattern.Pattern
-
- net.sf.saxon.pattern.UniversalPattern
-
- All Implemented Interfaces:
ExportAgent,Locatable,IdentityComparable,Traceable
public class UniversalPattern extends Pattern
The UniversalPattern matches everything
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.expr.Expression
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD
-
-
Constructor Summary
Constructors Constructor Description UniversalPattern()Create an UniversalPattern that matches all items
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcomputeHashCode()Hashcode supporting equals()Patterncopy(RebindingMap rebindings)Copy a UniversalPattern.booleanequals(java.lang.Object other)Determine whether this pattern is the same as another patternvoidexport(ExpressionPresenter presenter)Diagnostic print of expression structure.intgetFingerprint()Determine the name fingerprint of nodes to which this pattern applies.ItemTypegetItemType()Get a NodeTest that all the nodes matching this pattern must satisfyUTypegetUType()Get a UType indicating which kinds of items this Pattern can match.booleanmatches(Item item, XPathContext context)Determine whether this Pattern matches the given Node.java.lang.Stringreconstruct()Display the pattern for diagnostics-
Methods inherited from class net.sf.saxon.pattern.Pattern
allocateSlots, bindCurrent, convertToTypedPattern, effectiveBooleanValue, getDefaultPriority, getDependencies, getHostLanguage, getOriginalText, handleDynamicError, isLiftable, isMotionless, isRecoverable, make, matchesBeneathAnchor, matchesCurrentGroup, optimize, patternContainsVariable, replaceCurrent, selectNodes, setOriginalText, setPriority, setRecoverable, simplify, toPattern, toShortString, toString, typeCheck
-
Methods inherited from class net.sf.saxon.expr.PseudoExpression
computeCardinality, evaluateAsString, evaluateItem, getImplementationMethod, iterate, process
-
Methods inherited from class net.sf.saxon.expr.Expression
addToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeSpecialProperties, computeStaticProperties, dynamicError, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getCost, getEvaluationMethod, getExpressionName, getExtraProperty, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, getStreamerName, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, markTailFunctionCalls, operandList, operands, operandSparseList, optimizeChildren, prepareForStreaming, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplifyChildren, staticTypeCheck, suppressValidation, typeCheckChildren, typeError, unordered, verifyParentPointers
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.trace.Traceable
gatherProperties
-
-
-
-
Method Detail
-
matches
public boolean matches(Item item, XPathContext context)
Determine whether this Pattern matches the given Node. This is the main external interface for matching patterns: it sets current() to the node being tested
-
getUType
public UType getUType()
Get a UType indicating which kinds of items this Pattern can match.
-
getItemType
public ItemType getItemType()
Get a NodeTest that all the nodes matching this pattern must satisfy- Specified by:
getItemTypein classPattern- Returns:
- an ItemType, as specific as possible, which all the matching items satisfy
-
getFingerprint
public int getFingerprint()
Determine the name fingerprint of nodes to which this pattern applies. Used for optimisation.- Overrides:
getFingerprintin classPattern- Returns:
- A fingerprint that the nodes must match, or -1 if it can match multiple fingerprints
-
reconstruct
public java.lang.String reconstruct()
Display the pattern for diagnostics- Overrides:
reconstructin classPattern
-
export
public void export(ExpressionPresenter presenter)
Description copied from class:ExpressionDiagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.- Specified by:
exportin interfaceExportAgent- Specified by:
exportin classPattern- Parameters:
presenter- the expression presenter used to display the structure
-
equals
public boolean equals(java.lang.Object other)
Determine whether this pattern is the same as another pattern- Overrides:
equalsin classExpression- Parameters:
other- the other object- Returns:
- true if the other operand is an expression and if it can be determined that the two expressions are equivalent, in the sense that they will always return the same result.
-
computeHashCode
public int computeHashCode()
Hashcode supporting equals()- Overrides:
computeHashCodein classExpression- Returns:
- a computed hash code
-
copy
public Pattern copy(RebindingMap rebindings)
Copy a UniversalPattern. Since there is only one, return the same.
-
-