After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 549149 - gee lacks iterate reversed
gee lacks iterate reversed
Status: RESOLVED OBSOLETE
Product: libgee
Classification: Platform
Component: general
git master
Other All
: Normal enhancement
: 0.12
Assigned To: libgee-maint
libgee-maint
Depends on: 693455
Blocks: 696979
 
 
Reported: 2008-08-23 21:57 UTC by shuerhaaken
Modified: 2019-03-20 10:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Add-reversed-iterators.patch (5.53 KB, patch)
2010-07-12 00:21 UTC, Maciej (Matthew) Piechotka
none Details | Review
0002-Add-reversed_index_of-to-List-G-interface.patch (5.29 KB, patch)
2010-07-12 00:21 UTC, Maciej (Matthew) Piechotka
none Details | Review
0003-Add-reversed_view-to-List-G-interface.patch (10.62 KB, patch)
2010-07-12 00:22 UTC, Maciej (Matthew) Piechotka
none Details | Review

Description shuerhaaken 2008-08-23 21:57:32 UTC
Gee should have a possibility to iterate over a reversed list.

  foreach (sometype xyz in someGeeArrayList.reversed) {
    do_something;
  }
Comment 1 Didier "Ptitjes" 2009-09-11 20:18:13 UTC
We will add a new prototype on the List interface:

public List<G> reversed { owned get; }

and implement it in ArrayList and LinkedList directly.

The field backing the storage of the reversed view will be weak and handled just like _read_only_view is handled currently.
Comment 2 Maciej (Matthew) Piechotka 2009-09-12 11:00:04 UTC
I'm working on bi-directional iterator. Implementing abstract reverse iterator on base on prev method should be trivial.
Comment 3 Maciej (Matthew) Piechotka 2010-07-11 14:57:59 UTC
I have patches prepared (implementing reverse_view for lists). However they required additional methods (also implemented & tested but breaking interface).
Comment 4 Didier "Ptitjes" 2010-07-11 17:09:38 UTC
Hi Maciej. Could you submit the patches ?
Comment 5 Maciej (Matthew) Piechotka 2010-07-11 20:00:29 UTC
(In reply to comment #4)
> Hi Maciej. Could you submit the patches ?

You mean into git. Yes but I had discussion with Jürg today how long we are suppose to keep 0.5.x line. They would have to go into 0.7.x as they break bot ABI and API (latter for implementing List<G>).
Comment 6 Didier "Ptitjes" 2010-07-11 20:15:29 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Hi Maciej. Could you submit the patches ?
> 
> You mean into git. Yes but I had discussion with Jürg today how long we are
> suppose to keep 0.5.x line. They would have to go into 0.7.x as they break bot
> ABI and API (latter for implementing List<G>).

For sure, that's why I said "submit" on this ticket... not to commit it :)
Updating the ABI version was planned for 0.7 as part of adding the collection change signals and view APIs. List.reversed will fit well as part of that.
Comment 7 Maciej (Matthew) Piechotka 2010-07-12 00:21:04 UTC
Created attachment 165702 [details] [review]
0001-Add-reversed-iterators.patch

Currently it is 3 patches:

 - Add reversed iterator: Adds implementation of generic reversed iterator (may be reused for SortedMap & co.) and reversed list iterator (subclass of former)
 - Add reversed_index_of to List<G> interface: First break of API/ABI. Simple method that searches list from the end. last_index_of is probably better name.
 - Add reversed_view to List<G> interface: Actual implementation of reversed view. It contains (indirectly) tests for reversed iterators.
Comment 8 Maciej (Matthew) Piechotka 2010-07-12 00:21:58 UTC
Created attachment 165703 [details] [review]
0002-Add-reversed_index_of-to-List-G-interface.patch
Comment 9 Maciej (Matthew) Piechotka 2010-07-12 00:22:38 UTC
Created attachment 165704 [details] [review]
0003-Add-reversed_view-to-List-G-interface.patch
Comment 10 GNOME Infrastructure Team 2019-03-20 10:36:26 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libgee/issues/3.