public abstract class PrimitivePatterns extends Object
All patterns obtainable from this class are deterministic and bind no variables.
Object
,
Comparable
Modifier and Type | Field and Description |
---|---|
static Pattern<Double> |
finiteDouble
A pattern that matches finite floating-point values.
|
static Pattern<Double> |
infiniteDouble
A pattern that matches infinite floating-point values.
|
static Pattern<Boolean> |
isFalse
A pattern that matches the value
false . |
static Pattern<Boolean> |
isTrue
A pattern that matches the value
true . |
static Pattern<Double> |
nanDouble
A pattern that matches the floating-point value
NaN . |
static Pattern<Double> |
negativeDouble
A pattern that matches negative floating-point values.
|
static Pattern<Integer> |
negativeInteger
A pattern that matches negative integer values.
|
static Pattern<Double> |
positiveDouble
A pattern that matches positive floating-point values.
|
static Pattern<Integer> |
positiveInteger
A pattern that matches positive integer values.
|
static Pattern<Double> |
zeroDouble
A pattern that matches the floating-point value zero.
|
static Pattern<Integer> |
zeroInteger
A pattern that matches the integer value zero.
|
Modifier and Type | Method and Description |
---|---|
static <A> Pattern<A> |
compare(Comparator<? super A> comparator,
A other,
Pattern<? super Integer> body) |
static <A extends Comparable<? super A>> |
compareTo(A other,
Pattern<? super Integer> body)
Returns a pattern that matches objects based on comparison with
a given object.
|
static <A> Pattern<A> |
eq(A a)
Returns a pattern that matches objects identically equal to a
given reference.
|
static <A> Pattern<A> |
eqNull()
Returns a pattern that matches only the
null reference. |
static <A> Pattern<A> |
equal(A other)
Returns a pattern that matches objects equal to a given
reference.
|
static <A extends Comparable<? super A>> |
greaterThan(A other) |
static <A> Pattern<A> |
greaterThan(Comparator<? super A> comparator,
A other) |
static <A extends Comparable<? super A>> |
greaterThanOrEqual(A other) |
static <A> Pattern<A> |
greaterThanOrEqual(Comparator<? super A> comparator,
A other) |
static <A extends Comparable<? super A>> |
lessThan(A other) |
static <A> Pattern<A> |
lessThan(Comparator<? super A> comparator,
A other) |
static <A extends Comparable<? super A>> |
lessThanOrEqual(A other) |
static <A> Pattern<A> |
lessThanOrEqual(Comparator<? super A> comparator,
A other) |
static <A> Pattern<A> |
neq(A a)
Returns a pattern that matches objects not identically equal to a
given reference.
|
static <A> Pattern<A> |
neqNull()
Returns a pattern that matches anything but the
null
reference. |
static <A> Pattern<A> |
nequal(A other)
Returns a pattern that matches objects not equal to a given
reference.
|
static Pattern<Character> |
range(char from,
char to)
Returns a pattern that matches characters in a given range.
|
public static final Pattern<Integer> positiveInteger
public static final Pattern<Integer> zeroInteger
public static final Pattern<Integer> negativeInteger
public static final Pattern<Double> positiveDouble
public static final Pattern<Double> zeroDouble
public static final Pattern<Double> negativeDouble
public static final Pattern<Double> nanDouble
NaN
.public static final Pattern<Double> finiteDouble
public static <A> Pattern<A> equal(@Opt A other)
Objects.equals(java.lang.Object, java.lang.Object)
.
A pattern returned by this method is deterministic and binds no variables.
other
- an object to compare with or null
.public static <A> Pattern<A> nequal(@Opt A other)
Objects.equals(java.lang.Object, java.lang.Object)
.
A pattern returned by this method is deterministic and binds no variables.
other
- an object to compare with or null
.public static <A> Pattern<A> eq(@Opt A a)
==
.
A pattern returned by this method is deterministic and binds no variables.
other
- an object to compare with or null
.public static <A> Pattern<A> neq(@Opt A a)
!=
.
A pattern returned by this method is deterministic and binds no variables.
a
- an object to compare with or null
.public static <A extends Comparable<? super A>> Pattern<A> compareTo(@Opt A other, Pattern<? super Integer> body)
Comparable
to a given object matches a given
int
pattern.
A pattern returned by this method inherits determinism and variable bindings from the given pattern.
other
- an object to compare with or null
.body
- a pattern to match the comparison result.public static <A> Pattern<A> compare(Comparator<? super A> comparator, @Opt A other, Pattern<? super Integer> body)
public static <A extends Comparable<? super A>> Pattern<A> lessThan(A other)
public static <A extends Comparable<? super A>> Pattern<A> lessThanOrEqual(A other)
public static <A extends Comparable<? super A>> Pattern<A> greaterThan(A other)
public static <A extends Comparable<? super A>> Pattern<A> greaterThanOrEqual(A other)
public static <A> Pattern<A> lessThan(Comparator<? super A> comparator, @Opt A other)
public static <A> Pattern<A> lessThanOrEqual(Comparator<? super A> comparator, @Opt A other)
public static <A> Pattern<A> greaterThan(Comparator<? super A> comparator, @Opt A other)
public static <A> Pattern<A> greaterThanOrEqual(Comparator<? super A> comparator, @Opt A other)
public static <A> Pattern<A> eqNull()
null
reference.
A pattern returned by this method is deterministic and binds no variables.
public static <A> Pattern<A> neqNull()
null
reference.
A pattern returned by this method is deterministic and binds no variables.
see also the complete user documentation .