Create code that can guess the return type of an expression
-----------------------------------------------------------

                 Key: GEOT-1807
                 URL: http://jira.codehaus.org/browse/GEOT-1807
             Project: GeoTools
          Issue Type: Improvement
          Components: core filter
    Affects Versions: 2.5-M0, 2.4.2
            Reporter: Andrea Aime


The literal/converter approach we're assuming that a target class is more or 
less always available when it comes to extract a usable value out of a literal.
Unfortunately in many cases that is hard, for example
2 + 5 (7 or  "25")
2.0 + 5 (7.0, 7 or "2.05"?)
5 + (5 + property) -> how do we use the property type when evaluating what the 
first 5 is going to be?

A TypeVisitor is needed that takes an expression and drills down into it trying 
to understand what its resulting type will be. The result should be a type and 
a level of confidence, such as
Integer, Assumption
Double, Fact

In the case 2 + 5 we'd end up with (Integer, Assumption), that is, we assume 
integer is going to be fine, but we have no actual attribute type telling us so.
In the case 5 + (5 + property) we should end up with (Integer, Fact) since we 
know about the property type




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to