#97 CircularQueue pushUnique method

v4.0
closed
nobody
Classes (154)
5
2012-08-14
2007-01-05
Jon Wolfers
No

Hi

Could we have pushUnique & queueUnique methods for the CircularQueue Class please.

They would first check to see if the item was already in the queue and remove it before pushing or queueing the item.

This is the sort of behaviour one would expect from a recent files list. If you revisit a file you expect it to appear as the last file visited, but any previous reference to it would be removed from the list.

This could equally well be achieved by a 'unique' parameter to the push & queue methods or a new UniqueCircularQueue class if those methods were felt to be more in keeping with the look & feel of the language.

Thanks,

Jon

PS: Sorry if this appears twice - 1st attempt disappeared.

Discussion

  • Jon Wolfers

    Jon Wolfers - 2008-08-10

    Logged In: YES
    user_id=667060
    Originator: YES

    Code committed in revision 2923 allows the use of a second Parameter 'Unique' (or defaults to 'Normal').

    If unique is present then if the item already exists on the circularQueue it is removed before the Push or Queue operation is performed.

    Documentation to follow shortly

     
  • Jon Wolfers

    Jon Wolfers - 2008-08-10

    Logged In: YES
    user_id=667060
    Originator: YES

    Docs ammended in Rev 2925

     
  • Mark Miesfeld

    Mark Miesfeld - 2010-09-16

    This request for a feature enhancement has been included in a prior release so the tracker item is being closed.

     

Anonymous
Anonymous

Cancel  Add attachments