Class Pattern<A>
- Direct Known Subclasses:
- Pattern.Contravariant,- Pattern.Variable
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classDeprecated.static classDeprecated.static classDeprecated.classDeprecated.static classDeprecated.static classDeprecated.static classDeprecated.Pattern variable.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Pattern.Contravariant<Object>Deprecated.static final Pattern.Contravariant<Object>Deprecated.static final Pattern.Contravariant<Object>Deprecated.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedPattern()Deprecated.Base constructor with notoStringrepresentation.
- 
Method SummaryModifier and TypeMethodDescriptionDeprecated.static final <A> Pattern.Contravariant<A>any()Deprecated.Return a pattern that matches anything.abstract booleanDeprecated.static final <A> Pattern.Contravariant<A>Deprecated.Combine two patterns conjunctively.voidclear(boolean recursively) Deprecated.voidcut(boolean recursively) Deprecated.abstract booleanDeprecated.static final <A> Pattern.Contravariant<A>Deprecated.Combine two patterns disjunctively.static <A> Pattern.Contravariant<A>eq(A a) Deprecated.Return a pattern that matches objects equal to a given reference.Deprecated.forInstancesOf(Class<? extends A> cls) Deprecated.abstract booleanDeprecated.limit(int n) Deprecated.abstract booleanDeprecated.Attempt to match this pattern against a given object.booleanDeprecated.Attempt to re-match this pattern against a previously matched object.booleanDeprecated.static final <A> Pattern.Contravariant<A>none()Deprecated.Return a pattern that matches nothing.Deprecated.static <A> Pattern.Contravariant<A>p_null()Deprecated.Return a pattern that matches only thenullreference.abstract booleanDeprecated.Deprecated.Return a pattern that attempts to match this pattern successively to all elements of anIterable.<B> Pattern<B>Deprecated.uniquely()Deprecated.Returns a pattern that matches if and only if this pattern has a unique match.static <A> Pattern.Variable<A>variable()Deprecated.Creates a new anonymous pattern variable.static <A> Pattern.Variable<A>Deprecated.Creates a new named pattern variable.
- 
Field Details- 
anyDeprecated.
- 
noneDeprecated.
- 
p_nullDeprecated.
 
- 
- 
Constructor Details- 
Patternprotected Pattern()Deprecated.Base constructor with notoStringrepresentation. Creates an inactive pattern.
 
- 
- 
Method Details- 
matchDeprecated.Attempt to match this pattern against a given object. If the class of this pattern imposes a specific order on matches, the first one is chosen. The pattern is activated on success, but deactivated on failure.- Returns:
- trueif the matching is successful,- falseif it fails. Which- Pattern.Variables are bound by a successful match is class-specific.
 
- 
matchAgainpublic boolean matchAgain()Deprecated.Attempt to re-match this pattern against a previously matched object. If the class of this pattern imposes a specific order on matches, they are chosen in that order, beginning with the second one. The pattern is activated on success, but deactivated on failure. The behaviour of this method is unspecified if the pattern is currently deactivated.Patterns classes that do not overwrite this method guarantee - Returns:
- trueif the matching is successful,- falseif it fails. Which- Pattern.Variables are bound by a successful match is class-specific. The default implementation always returns- false.
 
- 
cutpublic void cut(boolean recursively) Deprecated.
- 
clearpublic void clear(boolean recursively) Deprecated.
- 
matchOnceDeprecated.
- 
bindsVariableDeprecated.
- 
disturbsVariableDeprecated.
- 
savesVariableDeprecated.
- 
isDeterministicpublic abstract boolean isDeterministic()Deprecated.
- 
variableDeprecated.Creates a new anonymous pattern variable.
- 
variableDeprecated.Creates a new named pattern variable.
- 
uniquelyDeprecated.Returns a pattern that matches if and only if this pattern has a unique match.A patterns of this class is deterministic. 
- 
limitDeprecated.
- 
anyDeprecated.Return a pattern that matches anything. A pattern returned by this method is deterministic and binds no variables.
- 
noneDeprecated.Return a pattern that matches nothing.A pattern returned by this method is vacuously deterministic and binds all variables. 
- 
eqDeprecated.Return a pattern that matches objects equal to a given reference. Equality is determined byObject.equals(java.lang.Object)if an object is given, or by==ifnullis given instead.A pattern returned by this method is deterministic and bings no variables. - Parameters:
- a- an object to compare with or- null.
 
- 
p_nullDeprecated.Return a pattern that matches only thenullreference.A pattern returned by this method is deterministic and binds no variables. 
- 
andDeprecated.
- 
orDeprecated.
- 
bothDeprecated.Combine two patterns conjunctively.A pattern returned by this method is deterministic if and only if both argument patterns are deterministic. A pattern returned by this method is ordered if and only if both argument patterns are ordered. It binds all variables bound by either argument pattern. Since the matches of the second argument pattern are repeated for each successful match of the first, it is more efficient to give arguments in decreasing order of matching costs. - Parameters:
- p- an argument pattern
- q- another argument pattern
- Returns:
- a pattern that has a successful match for each combination of successful matches of the argument patterns. If both argument patterns are ordered, the resulting order is the lexical order of the pairs.
 
- 
eitherDeprecated.Combine two patterns disjunctively.A pattern returned by this method is deterministic if and only if both argument patterns are deterministic and mutually exclusive. A pattern returned by this method is ordered if and only if both argument patterns are ordered. It binds all variables bound by both argument patterns. - Parameters:
- p- an argument pattern
- q- another argument pattern
- Returns:
- a pattern that has a successful match for each successful match of either argument pattern. If both argument patterns are ordered, the resulting order is the concatenation.
 
- 
firstDeprecated.
- 
somewhereDeprecated.Return a pattern that attempts to match this pattern successively to all elements of anIterable.A pattern returned by this method is generally nondeterministic. It is ordered if the underlying pattern is ordered. It binds all variables bound by the underlying pattern. - Returns:
- a pattern that
 
- 
transformDeprecated.
- 
forInstancesOfDeprecated.
 
-