lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
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

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Grant Ingersoll [mailto:gsingers@apache.org]
> Sent: Wednesday, September 23, 2009 1:33 AM
> To: java-dev@lucene.apache.org
> 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: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message