Menu

#214 Please adjust collection methods to match new structure ...

v3.2.0
closed
5
2012-08-14
2007-07-24
No

Hi David,

as you may have seen I just incorporated the RFE's https://sourceforge.net/tracker/?func=detail&atid=684733&aid=1754740&group_id=119701,
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=1754742&group_id=119701,
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=1754744&group_id=119701,
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=1754745&group_id=119701,
https://sourceforge.net/tracker/?func=detail&atid=684733&aid=1754746&group_id=119701, and https://sourceforge.net/tracker/?func=detail&atid=684733&aid=1754747&group_id=119701.

These RFE's define abstract methods for the collection classes, give default implementations and refactor some methods.

This is an attempt to help you gain an overview about the needed documentation changes:

Add the following methods to 'Collection':

  • [] - abstract method
  • []= - abstract method

  • allIndexes (-> copy description from any collection class)

  • allItems (-> copy description from any collection class)
  • at - abstract method
  • difference (===> copy description from Directory, Stem, or Table)
  • hasIndex (-> copy description from any collection class)
  • hasItem (-> copy description from any collection class)
  • interSection (===> copy description from Directory, Stem, or Table)
  • items (-> copy description from any collection class)
  • makeArray (===> copy description from Directory, Stem, or Table)
  • put - abstract method
  • subSet (===> copy description from Directory, Stem, or Table)
  • supplier - abstract method
  • union (===> copy description from Directory, Stem, or Table)
  • xor (===> copy description from Directory, Stem, or Table)

Add the following methods to 'OrderedCollection':

  • append - abstract method
  • appendAll (===> copy description from Array, List, or Queue)
  • difference (===> copy description from Array, List, or Queue)
  • interSection (===> copy description from Array, List, or Queue)
  • makeArray (===> copy description from Array, List, or Queue)
  • subSet (===> copy description from Array, List, or Queue)
  • union (===> copy description from Array, List, or Queue)
  • xor (===> copy description from Array, List, or Queue)

Add the following method to 'MapCollection':

  • putAll (===> copy description from Directory, Stem, or Table)

Add the following methods to 'SetCollection':

  • []= (===> copy description from 'Bag' or 'Set')
  • put (===> copy description from 'Bag' or 'Set')

Remove the following descriptions from 'Array':

  • appendAll
  • difference
  • interSection
  • subSet
  • union
  • xor

Remove the following methods from 'Bag':

  • []=
  • put

Remove the following descriptions from 'Directory':

  • difference
  • interSection
  • putAll
  • subSet
  • union
  • xor

Remove the following descriptions from 'List':

  • appendAll
  • difference
  • interSection
  • subSet
  • union
  • xor

Remove the following descriptions from 'Queue':

  • appendAll
  • difference
  • interSection
  • subSet
  • union
  • xor

Remove the following descriptions from 'Relation':

  • putAll

Remove the following methods from 'Set':

  • []=
  • put

Remove the following descriptions from 'Stem':

  • difference
  • interSection
  • putAll
  • subSet
  • union
  • xor

Remove the following descriptions from 'Table':

  • difference
  • interSection
  • putAll
  • subSet
  • union
  • xor

Discussion

  • Rick McGuire

    Rick McGuire - 2007-07-24

    Logged In: YES
    user_id=1125291
    Originator: NO

    Rony, I commented on the first RFE you committed changes to, but you might have missed it. You missed the "index" method on the Collection class.

     
  • Rony G. Flatscher

    Logged In: YES
    user_id=662126
    Originator: YES

    Rick, thanks for the hint, I did miss your earlier post (it relates to 'item', but I think you meant 'index' as in this comment).

    This is what I would propose then as a default implementation for the method "index" for the 'Collection' class:

    ----------- cut here ------------
    ::method 'index'
    use strict arg item
    idx=self~supplier~allItems~index(item)
    if .nil=idx then / item not in collection, return .nil /
    return .nil

      /* return index item from allIndexes array */
    

    return self~supplier~allIndexes~at(idx)
    ----------- cut here ------------

    If this is o.k. I would commit this change.

     
  • David Ashley

    David Ashley - 2007-07-26

    Logged In: YES
    user_id=931756
    Originator: NO

    Fixed in several revisions, the last one was 630.

     

Anonymous
Anonymous

Add attachments
Cancel