Set.st
changeset 21553 bd94215744c9
parent 21457 3be1776f3774
child 21652 927a47057848
equal deleted inserted replaced
21552:7732a5719d14 21553:bd94215744c9
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 1991 by Claus Gittinger
     2  COPYRIGHT (c) 1991 by Claus Gittinger
     5 	      All Rights Reserved
     3 	      All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
  1317     "return true if the receiver is empty"
  1315     "return true if the receiver is empty"
  1318 
  1316 
  1319     ^ tally == 0
  1317     ^ tally == 0
  1320 !
  1318 !
  1321 
  1319 
       
  1320 isEmptyOrNil
       
  1321     "return true if the receiver is empty"
       
  1322 
       
  1323     ^ tally == 0
       
  1324 
       
  1325     "Created: / 23-02-2017 / 15:51:50 / stefan"
       
  1326 !
       
  1327 
  1322 isFixedSize
  1328 isFixedSize
  1323     "return true if the receiver cannot grow - this will vanish once
  1329     "return true if the receiver cannot grow - this will vanish once
  1324      Arrays and Strings learn how to grow ..."
  1330      Arrays and Strings learn how to grow ..."
  1325 
  1331 
  1326     ^ false
  1332     ^ false
  1340     ^ tally ~~ 0
  1346     ^ tally ~~ 0
  1341 
  1347 
  1342     "Created: 12.2.1997 / 12:39:02 / cg"
  1348     "Created: 12.2.1997 / 12:39:02 / cg"
  1343 !
  1349 !
  1344 
  1350 
       
  1351 notEmptyOrNil
       
  1352     "return true if the receiver is not empty"
       
  1353 
       
  1354     ^ tally ~~ 0
       
  1355 
       
  1356     "Created: / 23-02-2017 / 15:51:58 / stefan"
       
  1357 !
       
  1358 
  1345 occurrencesOf:anObject
  1359 occurrencesOf:anObject
  1346     "return the number of occurrences of anObject in the receiver.
  1360     "return the number of occurrences of anObject in the receiver.
  1347      As I am a Set, this can only return 0 or 1."
  1361      As I am a Set, this can only return 0 or 1."
  1348 
  1362 
  1349     tally == 0 ifTrue:[^ 0]. 
  1363     tally == 0 ifTrue:[^ 0].