Collection.st
changeset 3381 e1c12fa92fbf
parent 3367 9510bc82d4d6
child 3402 d24e9629cdfb
equal deleted inserted replaced
3380:c73c31b25ac0 3381:e1c12fa92fbf
   853     "
   853     "
   854 ! !
   854 ! !
   855 
   855 
   856 !Collection methodsFor:'copying'!
   856 !Collection methodsFor:'copying'!
   857 
   857 
       
   858 copy
       
   859     "return a copy of the receiver.
       
   860      Redefined to pass the original as argument to tyhe postCopyFrom method."
       
   861 
       
   862     ^ self shallowCopy postCopyFrom:self
       
   863 
       
   864     "Created: / 19.4.1998 / 20:02:53 / cg"
       
   865 !
       
   866 
   858 copyEmpty
   867 copyEmpty
   859     "return a copy of the receiver with no elements.
   868     "return a copy of the receiver with no elements.
   860      This is used by copying and enumeration methods
   869      This is used by copying and enumeration methods
   861      to get a new instance which is similar to the receiver."
   870      to get a new instance which is similar to the receiver."
   862 
   871 
   879     "return a copy of the receiver with size nil elements.
   888     "return a copy of the receiver with size nil elements.
   880      This is used by copying and enumeration methods
   889      This is used by copying and enumeration methods
   881      to get a new instance which is similar to the receiver."
   890      to get a new instance which is similar to the receiver."
   882 
   891 
   883     ^ (self copyEmpty:size) grow:size
   892     ^ (self copyEmpty:size) grow:size
       
   893 !
       
   894 
       
   895 postCopyFrom:original
       
   896     "sent to a freshly copied object to give it a chance to adjust things.
       
   897      Notice, that for Sets/Dicts etc. a rehash is not needed, since the copy
       
   898      will have the same hash key as the receiver (as long as ST/X provides the 
       
   899      setHash: functionality)."
       
   900 
       
   901     "for ST-80 compatibility, we try postCopy here ..."
       
   902     ^ self postCopy
       
   903 
       
   904     "Created: / 19.4.1998 / 19:59:42 / cg"
       
   905     "Modified: / 19.4.1998 / 20:03:57 / cg"
   884 ! !
   906 ! !
   885 
   907 
   886 !Collection methodsFor:'enumerating'!
   908 !Collection methodsFor:'enumerating'!
   887 
   909 
   888 addAllTo:aCollection
   910 addAllTo:aCollection
  1747 ! !
  1769 ! !
  1748 
  1770 
  1749 !Collection class methodsFor:'documentation'!
  1771 !Collection class methodsFor:'documentation'!
  1750 
  1772 
  1751 version
  1773 version
  1752     ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.77 1998-04-07 07:52:59 cg Exp $'
  1774     ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.78 1998-04-19 18:11:05 cg Exp $'
  1753 ! !
  1775 ! !
  1754 Collection initialize!
  1776 Collection initialize!