lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <>
Subject RE: NumericRangeQuery "static" constructors
Date Tue, 22 Sep 2009 23:42:06 GMT
It is just for some type safety (with generics it would be better to
handle). The problem is, that overloading the ctor with long, int, float,
double makes it really hard to choose the right one (you miss an L when
passing anumber and get an int range query and so on, especially when Java
5's autoboxing is on). With the static "ctor" methods, it is clear what you
create (and conforms to API of NumericField).


Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen

> -----Original Message-----
> From: Grant Ingersoll []
> Sent: Wednesday, September 23, 2009 1:33 AM
> To:
> Subject: NumericRangeQuery "static" constructors
> I was wondering what was the reason for the "static" constructors on
> the NumericRangeQuery?  I don't get the point of a static method call
> that simply passes through to a normal constructor.  Are people
> somehow magically more capable of discerning the meaning of a static
> method than simply calling new NumericRangeQuery() and passing in the
> same parameters?
> -Grant
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message