ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject RE: FileCollections WAS FileSets with optional basedir and absolute paths for includes
Date Wed, 09 Mar 2005 22:55:12 GMT

--- Dominique Devienne <DDevienne@lgc.com> wrote:
> > From: Matt Benson [mailto:gudnabrsam@yahoo.com]
> > 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:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message