This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 31052 - MutableFileSet should implement java.util.List
Summary: MutableFileSet should implement java.util.List
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2003-02-14 09:50 UTC by Pavel Buzek
Modified: 2004-04-19 16:17 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Buzek 2003-02-14 09:50:20 UTC
excerpt from projects-dev:

Jan Pokorsky wrote:
> 
> Pavel Buzek wrote:
> > The documentation of Filesets api says that the mutable filesets created
> > with the following factory methods preserve order.
> >
> > FileSets.createFileObjectSet(boolean, ReferenceResolver)
> > FileSets.createDataObjectSet(boolean, ReferenceResolver)
> >
> 
> Right.
> 
> > On the other hand there is pretty poor support for reordering them. To
> > do an equivvalent of add(int index, Object o) you have to remove all
> > items and add them again in the right order. Would not it be better to
> > provide an additional interface with methods that are in java.util.List?
> > Namely:
> >
> > void add (int index, Object o);
> > int indexOf (Object o);
> > int lastIndexOf (Object o);
> > Object set (int index, Object o);
> > List subList (int indexFrom, int indexTo);
> > Object remove (int index);
> >
> > Thanks,
> > -pavel
> >
> 
> In time of collecting requirements there were no such requirements. We
> agreed thet keeping the order is enough. That's the reason.
> 
> Now you have still a possibility to extend the MutableFileSet with
> required methods on your own and keep a permutation info.
> 
> As a better alternative, if others agree, we could improve the api as
> you suggested. So far I have received a second complaint about the
> missing reordering functionality. I would propose to add the whole set
> of methods by implementing the interface java.util.List. The
> MutableFileSet would consist of all List's methods + current
> addAll(FileSet), removeAll(Content) and you get moreover all benefits of
> Collections API like sorting, ...
> 
> Jan
Comment 1 Dusan Balek 2003-05-05 16:59:47 UTC
Done.
Comment 2 Pavel Buzek 2003-07-02 14:08:19 UTC
i've verified all these issues
Comment 3 Pavel Buzek 2003-07-02 14:19:26 UTC
closing all my verified issues