|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.query.conditions.Condition org.eclipse.emf.query.conditions.DataTypeCondition<N> org.eclipse.emf.query.conditions.numbers.NumberCondition<N>
public class NumberCondition<N extends Number & Comparable<? super N>>
A Condition
object that tests for numeric arguments. The
arguments being evaluated are adapted to a Number
first using
a NumberAdapter
and then compared to the initialization value
of this NumberCondition
. It evaluates to true
when the values are equal or if the value is within the range of supplied
lower-bound and upper-bound.
Since the 1.2 release, this class is no longer abstract, serving as a generic number condition, applicable to any number type. Indeed, the nested subclasses specific to different precisions are obsolete (though not deprecated).
Nested Class Summary | |
---|---|
static class |
NumberCondition.ByteValue
A subclass of NumberCondition to be used to test for byte
values Clients can either use the default implementation supplied or have
their own. |
static class |
NumberCondition.DoubleValue
A subclass of NumberCondition to be used to test for
double values Clients can either use the default implementation supplied
or have their own. |
static class |
NumberCondition.FloatValue
A subclass of NumberCondition to be used to test for float
values Clients can either use the default implementation supplied or have
their own. |
static class |
NumberCondition.IntegerValue
A subclass of NumberCondition to be used to test for
integer values Clients can either use the default implementation supplied
or have their own. |
static class |
NumberCondition.LongValue
A subclass of NumberCondition to be used to test for long
values Clients can either use the default implementation supplied or have
their own. |
static class |
NumberCondition.RelationalOperator
The relational operator that a NumberCondition applies to test
input values against its own value or, in the case of NumberCondition.RelationalOperator.BETWEEN ,
its upper and lower bounds. |
static class |
NumberCondition.ShortValue
A subclass of NumberCondition to be used to test for short
values Clients can either use the default implementation supplied or have
their own. |
Field Summary | |
---|---|
static NumberCondition.RelationalOperator |
BETWEEN
The numeric "between" operator. |
static NumberCondition.RelationalOperator |
EQUAL_TO
The numeric = operator. |
static NumberCondition.RelationalOperator |
GREATER_THAN
The numeric > operator. |
static NumberCondition.RelationalOperator |
GREATER_THAN_OR_EQUAL_TO
The numeric >= operator. |
static NumberCondition.RelationalOperator |
LESS_THAN
The numeric < operator. |
static NumberCondition.RelationalOperator |
LESS_THAN_OR_EQUAL_TO
The numeric <= operator. |
protected N |
lowerBound
The lower bound of a range condition. |
protected boolean |
lowerInclusive
Whether the lower bound is inclusive. |
static NumberCondition.RelationalOperator |
NOT_EQUAL_TO
The numeric {@literal ! |
protected NumberCondition.RelationalOperator |
operator
The operator of a relational condition. |
protected N |
upperBound
The upper bound of a range condition. |
protected boolean |
upperInclusive
Whether the upper bound is inclusive. |
Fields inherited from class org.eclipse.emf.query.conditions.DataTypeCondition |
---|
adapter, value |
Fields inherited from class org.eclipse.emf.query.conditions.Condition |
---|
FALSE, TRUE |
Constructor Summary | |
---|---|
NumberCondition(N number)
Initializes me with a single number against which to test input values, assuming that they will be numbers of the appropriate kind. |
|
NumberCondition(N lowerBound,
boolean lowerInclusive,
N upperBound,
boolean upperInclusive)
Initializes me with upper and lower bounds against which to test input values, assuming that they will be numbers of the appropriate kind. |
|
NumberCondition(N lowerBound,
boolean lowerInclusive,
N upperBound,
boolean upperInclusive,
NumberAdapter<? extends N> adapter)
Initializes me with upper and lower bounds against which to test input values, and an adapter to convert those inputs to numbers. |
|
NumberCondition(N lowerBound,
N upperBound)
Initializes me with upper and lower bounds against which to test input values, assuming that they will be numbers of the appropriate kind. |
|
NumberCondition(N lowerBound,
N upperBound,
NumberAdapter<? extends N> adapter)
Initializes me with upper and lower bounds against which to test input values, and an adapter to convert those inputs to numbers. |
|
NumberCondition(N number,
NumberAdapter<? extends N> adapter)
Initializes me with a single number against which to test input values, and an adapter to convert those inputs to numbers. |
|
NumberCondition(N number,
NumberCondition.RelationalOperator operator)
Initializes me with a number against which to test input values and a relational operator to apply in comparisons. |
|
NumberCondition(N number,
NumberCondition.RelationalOperator operator,
NumberAdapter<? extends N> adapter)
Initializes me with a number against which to test input values, a relational operator to apply in comparisons, and an adapter to convert those inputs to numbers. |
Method Summary | ||
---|---|---|
static
|
between(N lowerBound,
boolean lowerInclusive,
N upperBound,
boolean upperInclusive)
Obtains a condition checking for values in the range to the specified lowerBound and upperBound. |
|
static
|
between(N lowerBound,
N upperBound)
Obtains a condition checking for values in the range to the specified lowerBound and upperBound (inclusive). |
|
static
|
equals(N number)
Obtains a condition checking for values equal to the specified number. |
|
static
|
greaterThan(N number)
Obtains a condition checking for values greater than the specified number. |
|
static
|
greaterThanOrEquals(N number)
Obtains a condition checking for values greater than or equal to the specified number. |
|
boolean |
isSatisfied(byte byteValue)
Tests if the argument's value equals/in-range the initialization number(s) |
|
boolean |
isSatisfied(Byte byteNumber)
Tests if the argument's value equals/in-range the initialization number(s) |
|
boolean |
isSatisfied(double doubleValue)
Tests if the argument's value equals/in-range the initialization number(s) |
|
boolean |
isSatisfied(Double doubleNumber)
Tests if the argument's value equals/in-range the initialization number(s) |
|
boolean |
isSatisfied(float floatValue)
Tests if the argument's value equals/in-range the initialization number(s) |
|
boolean |
isSatisfied(Float floatNumber)
Tests if the argument's value equals/in-range the initialization number(s) |
|
boolean |
isSatisfied(int intValue)
Tests if the argument's value equals/in-range the initialization number(s) |
|
boolean |
isSatisfied(Integer intNumber)
Tests if the argument's value equals/in-range the initialization number(s) |
|
boolean |
isSatisfied(long longValue)
Tests if the argument's value equals/in-range the initialization number(s) |
|
boolean |
isSatisfied(Long longNumber)
Tests if the argument's value equals/in-range the initialization number(s) |
|
boolean |
isSatisfied(Object object)
This operation is the evaluation operation of this Condition
in regard to the argument Object. |
|
boolean |
isSatisfied(short shortValue)
Tests if the argument's value equals/in-range the initialization number(s) |
|
boolean |
isSatisfied(Short shortNumber)
Tests if the argument's value equals/in-range the initialization number(s) |
|
static
|
lessThan(N number)
Obtains a condition checking for values less than the specified number. |
|
static
|
lessThanOrEquals(N number)
Obtains a condition checking for values less than or equal to the specified number. |
|
static
|
notEquals(N number)
Obtains a condition checking for values not equal equal to the specified number. |
Methods inherited from class org.eclipse.emf.query.conditions.Condition |
---|
AND, EQUIVALENT, IMPLIES, OR, XOR |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static NumberCondition.RelationalOperator EQUAL_TO
public static NumberCondition.RelationalOperator NOT_EQUAL_TO
public static NumberCondition.RelationalOperator LESS_THAN
public static NumberCondition.RelationalOperator LESS_THAN_OR_EQUAL_TO
public static NumberCondition.RelationalOperator GREATER_THAN
public static NumberCondition.RelationalOperator GREATER_THAN_OR_EQUAL_TO
public static NumberCondition.RelationalOperator BETWEEN
protected N extends Number & Comparable<? super N> upperBound
protected boolean upperInclusive
protected N extends Number & Comparable<? super N> lowerBound
protected boolean lowerInclusive
protected NumberCondition.RelationalOperator operator
Constructor Detail |
---|
public NumberCondition(N number)
number
- the number to match against input valuespublic NumberCondition(N number, NumberAdapter<? extends N> adapter)
number
- the number to match against input valuesadapter
- to convert input values to the appropriate number kindpublic NumberCondition(N number, NumberCondition.RelationalOperator operator)
number
- the number to match against input valuesoperator
- the relational operator to testpublic NumberCondition(N number, NumberCondition.RelationalOperator operator, NumberAdapter<? extends N> adapter)
number
- the number to match against input valuesoperator
- the relational operator to testadapter
- to convert input values to the appropriate number kindpublic NumberCondition(N lowerBound, N upperBound)
lowerBound
- the lower bound to testupperBound
- the upper bound to testpublic NumberCondition(N lowerBound, N upperBound, NumberAdapter<? extends N> adapter)
lowerBound
- the lower bound to testupperBound
- the upper bound to testadapter
- to convert input values to the appropriate number kindpublic NumberCondition(N lowerBound, boolean lowerInclusive, N upperBound, boolean upperInclusive)
lowerBound
- the lower bound to testlowerInclusive
- whether the lower bound is inclusiveupperBound
- the upper bound to testupperInclusive
- whether the upper bound is inclusivepublic NumberCondition(N lowerBound, boolean lowerInclusive, N upperBound, boolean upperInclusive, NumberAdapter<? extends N> adapter)
lowerBound
- the lower bound to testlowerInclusive
- whether the lower bound is inclusiveupperBound
- the upper bound to testupperInclusive
- whether the upper bound is inclusiveadapter
- to convert input values to the appropriate number kindMethod Detail |
---|
public static <N extends Number & Comparable<? super N>> NumberCondition<N> equals(N number)
number
- a number to check for
public static <N extends Number & Comparable<? super N>> NumberCondition<N> notEquals(N number)
number
- a number to check for
public static <N extends Number & Comparable<? super N>> NumberCondition<N> lessThan(N number)
number
- a number to check for
public static <N extends Number & Comparable<? super N>> NumberCondition<N> lessThanOrEquals(N number)
number
- a number to check for
public static <N extends Number & Comparable<? super N>> NumberCondition<N> greaterThan(N number)
number
- a number to check for
public static <N extends Number & Comparable<? super N>> NumberCondition<N> greaterThanOrEquals(N number)
number
- a number to check for
public static <N extends Number & Comparable<? super N>> NumberCondition<N> between(N lowerBound, N upperBound)
lowerBound
- the lower bound of numbers to check for (inclusive)upperBound
- the upper bound of numbers to check for (inclusive)
public static <N extends Number & Comparable<? super N>> NumberCondition<N> between(N lowerBound, boolean lowerInclusive, N upperBound, boolean upperInclusive)
lowerBound
- the lower bound of numbers to check forlowerInclusive
- whether the lower bound is inclusiveupperBound
- the upper bound of numbers to check forupperInclusive
- whether the upper bound is inclusive
public boolean isSatisfied(Byte byteNumber)
byteNumber
- The Byte
object whose value will be used in
testing
public boolean isSatisfied(byte byteValue)
byteValue
- The byte value which will be used in testing
public boolean isSatisfied(Double doubleNumber)
doubleNumber
- The Double
object whose value will be used in
testing
public boolean isSatisfied(double doubleValue)
doubleValue
- The double value which will be used in testing
public boolean isSatisfied(Float floatNumber)
floatNumber
- The Float
object whose value will be used in
testing
public boolean isSatisfied(float floatValue)
floatValue
- The float value which will be used in testing
public boolean isSatisfied(Integer intNumber)
intNumber
- The Integer
object whose value will be used in
testing
public boolean isSatisfied(int intValue)
intValue
- The int value which will be used in testing
public boolean isSatisfied(Long longNumber)
longNumber
- The Long
object whose value will be used in
testing
public boolean isSatisfied(long longValue)
longValue
- The long value which will be used in testing
public boolean isSatisfied(Short shortNumber)
shortNumber
- The Short
object whose value will be used in
testing
public boolean isSatisfied(short shortValue)
shortValue
- The short value which will be used in testing
public boolean isSatisfied(Object object)
Condition
Condition
in regard to the argument Object. In other words, the operation answers
whether the argument Object satisfied this Condition
or
not.
isSatisfied
in class DataTypeCondition<N extends Number & Comparable<? super N>>
object
- an Object to check if it satisfies this Condition
true
if the argument Object satisfies this
Condition
,false
otherwise.
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |