Package | Description |
---|---|
eu.bandm.tools.paisley |
A modular implementation of pattern matching on arbitrary objects.
|
Modifier and Type | Class and Description |
---|---|
class |
Adaptive<A>
Abstract base class for patterns that delegate to some other
pattern, chosen dynamically per target.
|
class |
Atomic<A>
Abstract base class for patterns that contain no subpatterns.
|
class |
Binary<A,B,C>
Abstract base class for patterns that contain two subpatterns.
|
class |
CachedTransform<A,B>
Abstract base class for patterns that delegate expensively
transformed targets to a subpattern.
|
class |
Constraint |
class |
EnumBranch<A,E extends Enum<E>> |
class |
Filter<A>
Abstract base class for patterns that match only a subset of the
target type.
|
class |
IntBranch<A> |
class |
Lazy<A>
Wrapper class for a pattern that is to be created on demand.
|
class |
MultiTransform<A,B>
Abstract base class for patterns that delegate transformed targets
to a subpattern.
|
class |
Observable<A> |
class |
Observer |
class |
Proxy<A>
Base class for patterns that contain one subpattern of the same target type.
|
class |
Search<A>
Abstract base class for patterns that delegate matching
dynamically to a number of alternative subpatterns.
|
class |
Theme<A,B> |
class |
Transform<A,B>
Abstract base class for patterns that delegate transformed targets
to a subpattern.
|
class |
Unary<A,B>
Abstract base class for patterns that contain one subpattern.
|
Modifier and Type | Field and Description |
---|---|
static Contravariant<Double> |
PrimitivePatterns.finiteDouble
A pattern that matches finite floating-point values.
|
static Contravariant<Double> |
PrimitivePatterns.infiniteDouble
A pattern that matches infinite floating-point values.
|
static Contravariant<Boolean> |
PrimitivePatterns.isFalse
A pattern that matches the value
false . |
static Contravariant<Boolean> |
PrimitivePatterns.isTrue
A pattern that matches the value
true . |
static Contravariant<Double> |
PrimitivePatterns.nanDouble
A pattern that matches the floating-point value
NaN . |
static Contravariant<Double> |
PrimitivePatterns.negativeDouble
A pattern that matches negative floating-point values.
|
static Contravariant<Integer> |
PrimitivePatterns.negativeInteger
A pattern that matches negative integer values.
|
static Contravariant<Double> |
PrimitivePatterns.positiveDouble
A pattern that matches positive floating-point values.
|
static Contravariant<Integer> |
PrimitivePatterns.positiveInteger
A pattern that matches positive integer values.
|
static Contravariant<Double> |
PrimitivePatterns.zeroDouble
A pattern that matches the floating-point value zero.
|
static Contravariant<Integer> |
PrimitivePatterns.zeroInteger
A pattern that matches the integer value zero.
|
Modifier and Type | Method and Description |
---|---|
<B extends A> |
Pattern.and(Pattern<? super B> p)
Combines this patterns conjunctively with another pattern.
|
static <A> Contravariant<A> |
Pattern.any()
Returns a pattern that matches anything.
|
static <A> Contravariant<A[]> |
CollectionPatterns.anyArrayElement(Pattern<? super A> p)
Returns a pattern that matches a given pattern for any element
of an array successively.
|
static <A> Contravariant<Iterable<? extends A>> |
CollectionPatterns.anyElement(Pattern<? super A> p)
Returns a pattern that matches a given pattern for any element
of an
Iterable successively. |
static <A> Contravariant<A> |
Pattern.aside(Runnable r) |
static <A> Contravariant<A> |
Pattern.both(Pattern<? super A> left,
Pattern<? super A> right)
Combines two patterns conjunctively.
|
Contravariant<B> |
Unary.clone() |
Contravariant<A> |
Atomic.clone() |
Contravariant<A> |
Adaptive.clone() |
Contravariant<C> |
Binary.clone() |
Contravariant<A> |
IntBranch.clone() |
Contravariant<A> |
EnumBranch.clone() |
static <A extends Comparable<? super A>> |
Pattern.compareTo(A other,
Pattern<? super Integer> body)
Deprecated.
Use the method
PrimitivePatterns.compareTo(Comparable, Pattern) instead. |
static <A extends Comparable<? super A>> |
PrimitivePatterns.compareTo(A other,
Pattern<? super Integer> body)
Returns a pattern that matches objects based on comparison with
a given object.
|
static <A> Contravariant<A> |
Pattern.either(Pattern<? super A> p,
Pattern<? super A> q)
Combines two patterns disjunctively.
|
static <A> Contravariant<List<? extends A>> |
CollectionPatterns.elementwise(List<? extends Pattern<? super A>> ps)
Returns a pattern that matches a given list of patterns
element-by-element against a list.
|
static <A> Contravariant<A[]> |
CollectionPatterns.elementwise(Pattern<? super A>... ps)
Returns a pattern that matches a given array of patterns
element-by-element against an array.
|
static <A> Contravariant<A> |
Pattern.eq(A a)
Deprecated.
Use the method
PrimitivePatterns.eq(A) instead. |
static <A> Contravariant<A> |
PrimitivePatterns.eq(A a)
Returns a pattern that matches objects identically equal to a
given reference.
|
static <A> Contravariant<A> |
Pattern.eqNull()
Deprecated.
Use the method
PrimitivePatterns.eqNull() instead. |
static <A> Contravariant<A> |
PrimitivePatterns.eqNull()
Returns a pattern that matches only the
null reference. |
static <A> Contravariant<A> |
Pattern.equal(A a)
Deprecated.
Use the method
PrimitivePatterns.equal(A) instead. |
static <A> Contravariant<A> |
PrimitivePatterns.equal(A a)
Returns a pattern that matches objects equal to a given
reference.
|
Contravariant<A> |
Pattern.filter(Predicate<? super A> pred)
Deprecated.
Use the method
FunctionPatterns.filter(java.util.function.Predicate, Pattern)
instead. |
static <A> Contravariant<A> |
OpsPatterns.filter(Predicate<? super A> pred,
Pattern<? super A> body)
Deprecated.
Use the method
FunctionPatterns.filter(java.util.function.Predicate, Pattern)
instead. |
static <A> Contravariant<A> |
FunctionPatterns.filter(Predicate<? super A> pred,
Pattern<? super A> body) |
static Contravariant<String> |
StringPatterns.find(String regex,
Pattern<? super String>... ps) |
static <A> Contravariant<A[]> |
CollectionPatterns.firstArrayElement(Pattern<? super A> p)
Returns a pattern that matches a given pattern for the first
matching element of an array.
|
static <A> Contravariant<Iterable<? extends A>> |
CollectionPatterns.firstElement(Pattern<? super A> p)
Returns a pattern that matches a given pattern for the first
matching element of an
Iterable . |
Contravariant<Object> |
Pattern.forInstancesOf(Class<? extends A> cls)
Deprecated.
Use the method
ReflectionPatterns.forInstancesOf(Class, Pattern) instead. |
static <A,B extends A> |
ReflectionPatterns.forInstancesOf(Class<? extends B> cls,
Pattern<? super B> body)
Returns a pattern that delegates to a given pattern after dynamic
type checking.
|
static <A> Contravariant<A> |
CollectionPatterns.from(Set<? super A> set)
Returns a pattern that matches against elements from a given
set.
|
static <A,B> Contravariant<Map<A,B>> |
CollectionPatterns.get(A key,
Pattern<? super B> body)
Returns a pattern that matches a given pattern against the
element for a given key in a
Map . |
static <A> Contravariant<List<? extends A>> |
CollectionPatterns.get(int index,
Pattern<? super A> body)
Returns a pattern that matches a given pattern against the
element at a given index in a
List . |
static <A> Contravariant<A[]> |
CollectionPatterns.getArray(int index,
Pattern<? super A> body)
Returns a pattern that matches a given pattern against the
element at a given index in an array.
|
static <A> Contravariant<A> |
OpsPatterns.ifThenElse(Predicate<? super A> condition,
Pattern<? super A> thenBody,
Pattern<? super A> elseBody) |
static <A> Contravariant<A> |
FunctionPatterns.ifThenElse(Predicate<? super A> condition,
Pattern<? super A> thenBody,
Pattern<? super A> elseBody) |
static <A,B> Contravariant<A> |
OpsPatterns.image(Multimap<A,B> items,
Pattern<? super B> body) |
static Contravariant<Object> |
ReflectionPatterns.isInstanceOf(Class<?>... cls) |
static Contravariant<Object> |
ReflectionPatterns.isInstanceOf(Class<?> cls)
Returns a pattern that matches objects of a given class.
|
static <A> Contravariant<Map<A,?>> |
CollectionPatterns.keySet(Pattern<? super Set<? extends A>> p)
Returns a pattern that matches a given pattern against the key set of a map.
|
static Contravariant<String> |
StringPatterns.length(Pattern<? super Integer> body) |
static <A> Contravariant<A[]> |
CollectionPatterns.length(Pattern<? super Integer> body)
Returns a pattern that matches a given pattern against the length
of an array.
|
static <A extends Annotation> |
ReflectionPatterns.matchAnnotation(Class<? extends A> cls,
Pattern<? super A> body)
Returns a pattern that matches a given pattern against an annotation
of the target object.
|
static <A> Contravariant<A> |
ReflectionPatterns.matchClass(Pattern<? super Class<? extends A>> p)
Returns a pattern that matches a given pattern against the class
of the target object.
|
static Contravariant<String> |
StringPatterns.matches(String regex,
Pattern<? super String>... ps) |
static Contravariant<Object> |
ReflectionPatterns.matchField(Field field,
Pattern<Object> body)
Returns a pattern that matches a given pattern against the value
of a field of the target object.
|
static Contravariant<Object> |
ReflectionPatterns.matchMethod(Method method,
Pattern<Object> body,
Object... args)
Returns a pattern that matches a given pattern against the
return value of a method of the target object.
|
<B extends A> |
Contravariant.narrow()
Returns an equivalent pattern with narrower type parameter.
|
static <A> Contravariant<A> |
Pattern.neq(A a)
Deprecated.
Use the method
PrimitivePatterns.neq(A) instead. |
static <A> Contravariant<A> |
PrimitivePatterns.neq(A a)
Returns a pattern that matches objects not identically equal to a
given reference.
|
static <A> Contravariant<A> |
Pattern.neqNull()
Deprecated.
Use the method
PrimitivePatterns.neqNull() instead. |
static <A> Contravariant<A> |
PrimitivePatterns.neqNull()
Returns a pattern that matches anything but the
null
reference. |
static <A> Contravariant<A> |
PrimitivePatterns.nequal(A a)
Returns a pattern that matches objects not equal to a given
reference.
|
static <A> Contravariant<A> |
Pattern.newAll(Pattern<? super A>... ps) |
Contravariant<A> |
Pattern.noMatch()
Returns a pattern that matches if and only if this pattern has
no match.
|
static <A> Contravariant<A> |
Pattern.none()
Returns a pattern that matches nothing.
|
<B extends A> |
Pattern.or(Pattern<? super B> p)
Combines this patterns disjunctively with another pattern.
|
static Contravariant<Character> |
PrimitivePatterns.range(char from,
char to)
Returns a pattern that matches characters in a given range.
|
static <A> Contravariant<A> |
Pattern.repeat() |
static <A> Contravariant<Collection<? extends A>> |
CollectionPatterns.size(Pattern<? super Integer> body)
Returns a pattern that matches a given pattern against the size
of a
Collection . |
Contravariant<A> |
Pattern.someMatch() |
static <A> Contravariant<A> |
OpsPatterns.test(Predicate<? super A> pred)
Deprecated.
Use the method
FunctionPatterns.test(java.util.function.Predicate) instead. |
static <A> Contravariant<A> |
FunctionPatterns.test(Predicate<? super A> pred) |
static <A> Contravariant<A> |
Pattern.test(Predicate<? super A> pred)
Deprecated.
Use the method
FunctionPatterns.test(java.util.function.Predicate) instead. |
static Contravariant<String> |
StringPatterns.tokenize(Pattern<? super String> body) |
static Contravariant<String> |
StringPatterns.tokenize(String delim,
boolean returnDelims,
Pattern<? super String> body) |
static Contravariant<String> |
StringPatterns.tokenize(String delim,
Pattern<? super String> body) |
static <A,B> Contravariant<A> |
OpsPatterns.transform(Function<? super A,? extends B> fun,
Pattern<? super B> body)
Deprecated.
Use the method
FunctionPatterns.transform(java.util.function.Function, Pattern)
instead. |
static <A,B> Contravariant<A> |
FunctionPatterns.transform(Function<? super A,? extends B> fun,
Pattern<? super B> body) |
<B> Contravariant<B> |
Pattern.transform(Function<? super B,? extends A> fun)
Deprecated.
Use the method
FunctionPatterns.transform(java.util.function.Function, Pattern)
instead. |
static <A> Contravariant<Map<?,A>> |
CollectionPatterns.values(Pattern<? super Collection<? extends A>> p)
Returns a pattern that matches a given pattern against the values of a map.
|
see also the complete user documentation .