Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Query's NumberConditions don't support GreaterThan/LessThan?
Query's NumberConditions don't support GreaterThan/LessThan? [message #415002] Wed, 28 November 2007 02:34 Go to next message
Jasper is currently offline JasperFriend
Messages: 84
Registered: July 2009
Member
It seems EMF Query's NumberCondition classes only support
Between(upperBound,lowerBound) conditions (with Equals being emulated as
a Between with upperBound and lowerBound set to the same value).
Apparently there's no support for GreaterThan or LessThan... Why is
this? (I supposed they could be emulated by using Type.MAX_VALUE and
Type.MIN_VALUE for the upper and lower bounds, but wouldn't it make more
sense to support > and < explicitly?)
Re: Query's NumberConditions don't support GreaterThan/LessThan? [message #415015 is a reply to message #415002] Wed, 28 November 2007 12:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33139
Registered: July 2009
Senior Member
Jasper,

That would have been handy. I suppose one could argue in favor of
having both inclusive and exclusive ranges (<= verses <) since that's
particularly important for floating point numbers where you can't just
increment the bound to have the same effect. I could imagine using a
boolean (or two) to define inclusiveness for the bound(s) and using null
to represent no bound. We'll see what Christian thinks...


Jasper wrote:
> It seems EMF Query's NumberCondition classes only support
> Between(upperBound,lowerBound) conditions (with Equals being emulated
> as a Between with upperBound and lowerBound set to the same value).
> Apparently there's no support for GreaterThan or LessThan... Why is
> this? (I supposed they could be emulated by using Type.MAX_VALUE and
> Type.MIN_VALUE for the upper and lower bounds, but wouldn't it make
> more sense to support > and < explicitly?)


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Query's NumberConditions don't support GreaterThan/LessThan? [message #415025 is a reply to message #415015] Wed, 28 November 2007 13:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Ed, Jasper,

I think clients in the past have used the fact that the precision of numbers
in Java is limited to express > and < using the maximal positive and
negative values of the number type as bounds, as Jasper suggested.
Arguably not very convenient.

And, this doesn't work in Query 1.2 in which the rework of the
NumberCondition as a generic condition now also supports BigInteger and
BigDecimal.

Sounds to me like a worthwhile enhancement request for our Bugzilla.

cW


Ed Merks wrote:

> Jasper,
>
> That would have been handy. I suppose one could argue in favor of
> having both inclusive and exclusive ranges (<= verses <) since that's
> particularly important for floating point numbers where you can't just
> increment the bound to have the same effect. I could imagine using a
> boolean (or two) to define inclusiveness for the bound(s) and using null
> to represent no bound. We'll see what Christian thinks...
>
>
> Jasper wrote:
>> It seems EMF Query's NumberCondition classes only support
>> Between(upperBound,lowerBound) conditions (with Equals being emulated
>> as a Between with upperBound and lowerBound set to the same value).
>> Apparently there's no support for GreaterThan or LessThan... Why is
>> this? (I supposed they could be emulated by using Type.MAX_VALUE and
>> Type.MIN_VALUE for the upper and lower bounds, but wouldn't it make
>> more sense to support > and < explicitly?)
Re: Query's NumberConditions don't support GreaterThan/LessThan? [message #415156 is a reply to message #415025] Mon, 03 December 2007 02:43 Go to previous message
Jasper is currently offline JasperFriend
Messages: 84
Registered: July 2009
Member
Opened Bugzilla #211707.

Christian W. Damus wrote:
> Hi, Ed, Jasper,
>
> I think clients in the past have used the fact that the precision of numbers
> in Java is limited to express > and < using the maximal positive and
> negative values of the number type as bounds, as Jasper suggested.
> Arguably not very convenient.
>
> And, this doesn't work in Query 1.2 in which the rework of the
> NumberCondition as a generic condition now also supports BigInteger and
> BigDecimal.
>
> Sounds to me like a worthwhile enhancement request for our Bugzilla.
>
> cW
>
>
> Ed Merks wrote:
>
>> Jasper,
>>
>> That would have been handy. I suppose one could argue in favor of
>> having both inclusive and exclusive ranges (<= verses <) since that's
>> particularly important for floating point numbers where you can't just
>> increment the bound to have the same effect. I could imagine using a
>> boolean (or two) to define inclusiveness for the bound(s) and using null
>> to represent no bound. We'll see what Christian thinks...
>>
>>
>> Jasper wrote:
>>> It seems EMF Query's NumberCondition classes only support
>>> Between(upperBound,lowerBound) conditions (with Equals being emulated
>>> as a Between with upperBound and lowerBound set to the same value).
>>> Apparently there's no support for GreaterThan or LessThan... Why is
>>> this? (I supposed they could be emulated by using Type.MAX_VALUE and
>>> Type.MIN_VALUE for the upper and lower bounds, but wouldn't it make
>>> more sense to support > and < explicitly?)
>
Previous Topic:extend the navigator
Next Topic:Hacking on EMF
Goto Forum:
  


Current Time: Sat Apr 20 16:30:42 GMT 2024

Powered by FUDForum. Page generated in 0.03667 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top