--- Dominique Devienne <[EMAIL PROTECTED]> wrote:
> > From: Matt Benson [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, March 09, 2005 4:13 PM
> > To: Ant Developers List
> > Subject: FileCollections WAS FileSets with
> optional basedir and
> absolute
> > paths for includes
> >
> > Right now I am leaning toward:
> >
> > public interface oata.types.FileCollection {
> > public Iterator iterator();//of Files
> > }
>
> Traditionally we've been returning arrays.
> The nice things about arrays is that they are typed.
> Since we're stuck to JDK1.2, we can't write
> Iterator<File>. I lean more towards arrays.
>
> > This should have the added benefit of built-in
> support
> > in ac:for, though I suppose wrapping in a path
> would
> > work as well.
>
> OTOH interop with <ac:for> is nice. But since
> <ac:for>
> uses reflection to get at the iterator() method, we
> can very easily put the interoperability in the
> concrete types.
You mean keep the interface as File[] and then
implement iterator() in addition to getFiles()? Maybe
have an abstract IteratorFileCollection { public
Iterator iterator() { return
Arrays.asList(getFiles()).iterator();}} and inherit
most from that. But then you get into the question of
which FileCollections are supported OOTB. Or we could
just make Peter implement support for FileCollection.
:)
>
> > Incidentally, should Path not implement
> > FileCollection?
>
> I guess... I always thought we (and Peter ;-) were
> abusing Path for its FileCollection-like behavior,
> and making it implement FileCollection kind of
> allows
> to abuse Path even more.
>
> Paths is ordered file collection, and remove
> duplicates.
> But in a way, they are also FileCollection too.
> So I'm torn ;-) Practically would say yes.
>
> By the way, what should be the contract for
> FileCollection
> regarding duplicate files?
I think of it as a Set.
>
> > I still need a name for "an absolute collection of
> > files" that is hopefully short enough to make a
> usable
> > XML element name a la FileSet, and am eagerly
> awaiting
> > suggestions.
>
> How about just <files>? --DD
If noone objects that works for me. It's brief enough
to allow <unionfiles>, <intersectfiles>,
<differencefiles>, <sortfiles>...
Thanks for the input,
Matt
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]