OrderedSet.st
changeset 24618 1cb472ae5a65
parent 24177 4353bb77db07
child 25065 d341dc629f81
equal deleted inserted replaced
24617:c76a07d160a4 24618:1cb472ae5a65
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 2001 by eXept Software AG
     4  COPYRIGHT (c) 2001 by eXept Software AG
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
   236 addOrReplace:anObject 
   238 addOrReplace:anObject 
   237     "Add the argument, anObject to the receiver.
   239     "Add the argument, anObject to the receiver.
   238      If it is already included, replace it by anObject.
   240      If it is already included, replace it by anObject.
   239      Return nil, if anObject was not present in the receiver, 
   241      Return nil, if anObject was not present in the receiver, 
   240      otherwise the element that has been replaced.
   242      otherwise the element that has been replaced.
       
   243      Notice: this sounds like a useless operation, but because sets compare by equality, 
       
   244              the old object may be replaced by another object when equeal, but not identical.
       
   245              For example, a string by a symbol or a float by an integer...
   241 
   246 
   242      Also, remember in the order (i.e. add to the end)
   247      Also, remember in the order (i.e. add to the end)
   243      If anObject is already present in the set,
   248      If anObject is already present in the set,
   244      the order will not be changed."
   249      the order will not be changed."
   245 
   250