> 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. > 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 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 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]