Class Pattern<A>
- Direct Known Subclasses:
Pattern.Contravariant
,Pattern.Variable
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Deprecated.static class
Deprecated.static class
Deprecated.class
Deprecated.static class
Deprecated.static class
Deprecated.static class
Deprecated.Pattern variable. -
Field Summary
Modifier and TypeFieldDescriptionstatic final Pattern.Contravariant<Object>
Deprecated.static final Pattern.Contravariant<Object>
Deprecated.static final Pattern.Contravariant<Object>
Deprecated. -
Constructor Summary
ModifierConstructorDescriptionprotected
Pattern()
Deprecated.Base constructor with notoString
representation. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.static final <A> Pattern.Contravariant<A>
any()
Deprecated.Return a pattern that matches anything.abstract boolean
Deprecated.static final <A> Pattern.Contravariant<A>
Deprecated.Combine two patterns conjunctively.void
clear
(boolean recursively) Deprecated.void
cut
(boolean recursively) Deprecated.abstract boolean
Deprecated.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 boolean
Deprecated.limit
(int n) Deprecated.abstract boolean
Deprecated.Attempt to match this pattern against a given object.boolean
Deprecated.Attempt to re-match this pattern against a previously matched object.boolean
Deprecated.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 thenull
reference.abstract boolean
Deprecated.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
-
any
Deprecated. -
none
Deprecated. -
p_null
Deprecated.
-
-
Constructor Details
-
Pattern
protected Pattern()Deprecated.Base constructor with notoString
representation. Creates an inactive pattern.
-
-
Method Details
-
match
Deprecated.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. -
matchAgain
public 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
-
cut
public void cut(boolean recursively) Deprecated. -
clear
public void clear(boolean recursively) Deprecated. -
matchOnce
Deprecated. -
bindsVariable
Deprecated. -
disturbsVariable
Deprecated. -
savesVariable
Deprecated. -
isDeterministic
public abstract boolean isDeterministic()Deprecated. -
variable
Deprecated.Creates a new anonymous pattern variable. -
variable
Deprecated.Creates a new named pattern variable. -
uniquely
Deprecated.Returns a pattern that matches if and only if this pattern has a unique match.A patterns of this class is deterministic.
-
limit
Deprecated. -
any
Deprecated.Return a pattern that matches anything. A pattern returned by this method is deterministic and binds no variables. -
none
Deprecated.Return a pattern that matches nothing.A pattern returned by this method is vacuously deterministic and binds all variables.
-
eq
Deprecated.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==
ifnull
is given instead.A pattern returned by this method is deterministic and bings no variables.
- Parameters:
a
- an object to compare with ornull
.
-
p_null
Deprecated.Return a pattern that matches only thenull
reference.A pattern returned by this method is deterministic and binds no variables.
-
and
Deprecated. -
or
Deprecated. -
both
Deprecated.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 patternq
- 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.
-
either
Deprecated.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 patternq
- 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.
-
first
Deprecated. -
somewhere
Deprecated.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
-
transform
Deprecated. -
forInstancesOf
Deprecated.
-