Collection.st
changeset 5359 396b77b6f1d2
parent 5268 88ee7be5c6b7
child 5497 92bb94a53929
equal deleted inserted replaced
5358:79b21b5a4783 5359:396b77b6f1d2
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
       
    12 
       
    13 "{ Package: 'stx:libbasic' }"
    12 
    14 
    13 Object subclass:#Collection
    15 Object subclass:#Collection
    14 	instanceVariableNames:''
    16 	instanceVariableNames:''
    15 	classVariableNames:'InvalidKeySignal EmptyCollectionSignal ValueNotFoundSignal
    17 	classVariableNames:'InvalidKeySignal EmptyCollectionSignal ValueNotFoundSignal
    16 		NotEnoughElementsSignal'
    18 		NotEnoughElementsSignal'
  1849     "Modified: / 11.2.2000 / 11:24:56 / cg"
  1851     "Modified: / 11.2.2000 / 11:24:56 / cg"
  1850 ! !
  1852 ! !
  1851 
  1853 
  1852 !Collection methodsFor:'queries'!
  1854 !Collection methodsFor:'queries'!
  1853 
  1855 
       
  1856 defaultElement
       
  1857     ^  nil
       
  1858 !
       
  1859 
  1854 isCollection
  1860 isCollection
  1855     "return true, if the receiver is some kind of collection;
  1861     "return true, if the receiver is some kind of collection;
  1856      true is returned here - the method is redefined from Object."
  1862      true is returned here - the method is redefined from Object."
  1857 
  1863 
  1858     ^ true
  1864     ^ true
  1867      I.e. you should NEVER depend on that in your application."
  1873      I.e. you should NEVER depend on that in your application."
  1868 
  1874 
  1869     ^ false
  1875     ^ false
  1870 
  1876 
  1871     "Created: 13.4.1996 / 12:35:55 / cg"
  1877     "Created: 13.4.1996 / 12:35:55 / cg"
       
  1878 !
       
  1879 
       
  1880 isSortedBy:aBlock
       
  1881     "return true, if my elements are sorted (already) by the given criterion (sortBlock).
       
  1882      Collections which hold their elements in sorted order
       
  1883      should return true. Some algorithms (quicksort) degenerate when 
       
  1884      operating on sorted collections and can be avoided if this information
       
  1885      is given. The default returned here (false) should not hurt.
       
  1886      I.e. you should NEVER depend on that in your application."
       
  1887 
       
  1888     ^ false
       
  1889 
       
  1890 !
       
  1891 
       
  1892 isSortedCollection
       
  1893     "return true, if the receiver is a sortedCollection."
       
  1894 
       
  1895     ^ false
       
  1896 
  1872 !
  1897 !
  1873 
  1898 
  1874 longestCommonPrefix
  1899 longestCommonPrefix
  1875     "return the longest common prefix of my elements.
  1900     "return the longest common prefix of my elements.
  1876      Typically used with string collections."
  1901      Typically used with string collections."
  2079 ! !
  2104 ! !
  2080 
  2105 
  2081 !Collection class methodsFor:'documentation'!
  2106 !Collection class methodsFor:'documentation'!
  2082 
  2107 
  2083 version
  2108 version
  2084     ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.97 2000-02-17 11:05:15 cg Exp $'
  2109     ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.98 2000-04-07 08:09:58 cg Exp $'
  2085 ! !
  2110 ! !
  2086 Collection initialize!
  2111 Collection initialize!