Hmmmm, well the whole reason for the second method is to make sure that
implementations do not make assumptions about what the return value
should look like. So all the work should really be done in
evaluate(Object), and then just converted on the fly by
evaluate(Object,Class). Making the method final enforces this nicley :).

Can you give a more concrete example of what you need to do. If need be
we can break out a protected methods call eval( Object, Class ), which
does what evaluate( Object, Class ) does now, and then allow the latter
to be overridden by subclasses.

-Justin

Cory Horner wrote:
> public abstract class ExpressionAbstract implements Expression {
>     
>     /** Subclass should overide, default implementation returns null */
>     public Object evaluate(Object object) {
>         return null;
>     }
>     
>     public final Object evaluate(Object object, Class context) {
>         Value value = new Value( evaluate( object ) );
>         return value.value( context );
>     }
> ...
> 
> Can we lift "final" from the second evaluate method? It seems that some 
> implementions may want to return different results based on the return 
> type, looking like this:
> 
> public Object evaluate(Object object) {
>   return evaluate(object, String.class);
> }
> 
> public Object evaluate(Object object, Class context) {
>   ... < real code here >
> }
> 
> Cheers,
> Cory.
> 
> -------------------------------------------------------------------------
> SF.net email is sponsored by: A Better Job is Waiting for You - Find it Now.
> Check out Slashdot's new job board. Browse through tons of technical jobs
> posted by companies looking to hire people just like you.
> http://jobs.slashdot.org/
> _______________________________________________
> Geotools-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
> 
> !DSPAM:1004,455a01ec76971365099012!
> 


-- 
Justin Deoliveira
[EMAIL PROTECTED]
The Open Planning Project
http://topp.openplans.org

-------------------------------------------------------------------------
SF.net email is sponsored by: A Better Job is Waiting for You - Find it Now.
Check out Slashdot's new job board. Browse through tons of technical jobs
posted by companies looking to hire people just like you.
http://jobs.slashdot.org/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to