Method.st
changeset 1477 cbf97261a39c
parent 1436 4eae8fd83654
child 1493 33e226c7d187
equal deleted inserted replaced
1476:02f69251f5bc 1477:cbf97261a39c
  1535 
  1535 
  1536 printStringForBrowserWithSelector:selector
  1536 printStringForBrowserWithSelector:selector
  1537     "return a printString to represent myself to the user in a browser.
  1537     "return a printString to represent myself to the user in a browser.
  1538      Defined here to allow for browsers to deal with nonStandard pseudoMethods"
  1538      Defined here to allow for browsers to deal with nonStandard pseudoMethods"
  1539 
  1539 
  1540     |s moreInfo p em|
  1540     |s moreInfo p em i|
  1541 
  1541 
  1542     moreInfo := ''.
  1542     moreInfo := ''.
  1543 
  1543 
  1544     (p := self privacy) ~~ #public ifTrue:[
  1544     (p := self privacy) ~~ #public ifTrue:[
  1545         moreInfo := Text string:'    (* ' , p , ' *)' emphasis:#italic.
  1545         moreInfo := Text string:'    (* ' , p , ' *)' emphasis:#italic.
  1552             ] ifFalse:[
  1552             ] ifFalse:[
  1553                 moreInfo := moreInfo , 
  1553                 moreInfo := moreInfo , 
  1554                      '    (called ' , (MessageTracer executionCountOfMethod:self) printString , ' times)'.
  1554                      '    (called ' , (MessageTracer executionCountOfMethod:self) printString , ' times)'.
  1555             ]
  1555             ]
  1556         ] ifFalse:[
  1556         ] ifFalse:[
  1557             moreInfo := ' !!'
  1557             (MessageTracer isTiming:self) ifTrue:[
       
  1558                 i := MessageTracer executionTimesOfMethod:self.
       
  1559                 i notNil ifTrue:[
       
  1560                     moreInfo := moreInfo , 
       
  1561                                 '    (avg: ' , (i at:#avgTime) printString,
       
  1562                                 ' min: ' , (i at:#minTime) printString , 
       
  1563                                 ' max: ' , (i at:#maxTime) printString ,
       
  1564                                 ' cnt: ' , (i at:#count) printString , ')'
       
  1565                 ].
       
  1566             ] ifFalse:[
       
  1567                 moreInfo := ' !!'
       
  1568             ]
  1558         ]
  1569         ]
  1559     ].
  1570     ].
  1560 
  1571 
  1561     self isInvalid ifTrue:[
  1572     self isInvalid ifTrue:[
  1562         moreInfo := '    (** not executable **)'.
  1573         moreInfo := '    (** not executable **)'.
  1577         ^ Text string:s emphasis:em
  1588         ^ Text string:s emphasis:em
  1578     ].
  1589     ].
  1579     ^ s
  1590     ^ s
  1580 
  1591 
  1581     "Created: 16.4.1996 / 20:11:12 / cg"
  1592     "Created: 16.4.1996 / 20:11:12 / cg"
  1582     "Modified: 22.5.1996 / 16:43:25 / cg"
  1593     "Modified: 17.6.1996 / 17:16:21 / cg"
  1583 !
  1594 !
  1584 
  1595 
  1585 whoString
  1596 whoString
  1586     "return a string as className>>selector, if this is not an unbound
  1597     "return a string as className>>selector, if this is not an unbound
  1587      method. Otherwise return 'unbound'. Used with debugging."
  1598      method. Otherwise return 'unbound'. Used with debugging."
  2112 ! !
  2123 ! !
  2113 
  2124 
  2114 !Method class methodsFor:'documentation'!
  2125 !Method class methodsFor:'documentation'!
  2115 
  2126 
  2116 version
  2127 version
  2117     ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.89 1996-05-22 14:43:43 cg Exp $'
  2128     ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.90 1996-06-17 15:22:34 cg Exp $'
  2118 ! !
  2129 ! !
  2119 Method initialize!
  2130 Method initialize!