ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <umag...@apache.org>
Subject Re: [SUBMIT] Selector API Implementation
Date Mon, 14 Jan 2002 01:41:03 GMT
From: "Peter Donald" <peter@apache.org>

> > Do we need an explicit method?  Can't the no-arg constructor be used
> > for such things?
>
> no because it has to be after the setOperation and setValue has been
called.

Oh, ok.  I can add such a method, but must we do it at the
interface level?  I mean the isSelected method can still do something like

boolean isSelected(f) {
    if (!cached) {
        fillCache();
    }
    ...
}

This way, we could leave it to the Selector writer to decide
whether such a caching is to be done or not.  Why should it
be the interface's business to impose such a method be used?
I prefer to call the method as fillCache instead of initialize
because it conveys a different meaning to me/possibly to
others.  Any objections/better names?

>
> Thus you have removed all the expensive string operations from isSelected
> which is called for every file. And also check once for value being
> null
>

I have been creating a new instance of Selector for
every file, but I will change it that such that the same
Selector instance can be reused multiple times as
needed.  I didn't do it this way initially was because
I didn't want to create all the selector objects whether
they are used or not, but then, I can see it will be optimal
if I indeed did that.

>
> Pete
>

Magesh




--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message