SignalSet.st
branchjv
changeset 19478 1f5aa87f6170
parent 18120 e3a375d5f6a8
parent 19445 d103fd253688
child 20342 219a5a47e8b1
equal deleted inserted replaced
19477:af82888ceb72 19478:1f5aa87f6170
     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 "{ Package: 'stx:libbasic' }"
    12 "{ Package: 'stx:libbasic' }"
    13 
    13 
       
    14 "{ NameSpace: Smalltalk }"
       
    15 
    14 IdentitySet subclass:#SignalSet
    16 IdentitySet subclass:#SignalSet
    15 	instanceVariableNames:''
    17 	instanceVariableNames:''
    16 	classVariableNames:''
    18 	classVariableNames:''
    17 	poolDictionaries:''
    19 	poolDictionaries:''
    18 	category:'Kernel-Exceptions'
    20 	category:'Kernel-Exceptions'
   113 
   115 
   114 !SignalSet methodsFor:'queries'!
   116 !SignalSet methodsFor:'queries'!
   115 
   117 
   116 accepts:anExceptionHandler
   118 accepts:anExceptionHandler
   117     "return true, if the receiver accepts the argument, aSignal.
   119     "return true, if the receiver accepts the argument, aSignal.
   118      (i.e. if any of the receivers elements is aSignal or a parent of it).
   120      (i.e. if any of the receiver's elements is aSignal or a parent of it).
   119      False otherwise."
   121      False otherwise."
   120 
   122 
   121     self do:[:eachExceptionHandler |
   123     self do:[:eachExceptionHandler |
   122 	(eachExceptionHandler==anExceptionHandler
   124         (eachExceptionHandler==anExceptionHandler
   123 	 or:[eachExceptionHandler accepts:anExceptionHandler]) ifTrue:[^ true].
   125          or:[eachExceptionHandler accepts:anExceptionHandler]) ifTrue:[^ true].
   124     ].
   126     ].
   125     ^ false
   127     ^ false
   126 !
   128 !
   127 
   129 
   128 exceptionHandlerFor:anException in:aContext
   130 exceptionHandlerFor:anException in:aContext
   173     "Created: / 25.7.1999 / 23:46:48 / stefan"
   175     "Created: / 25.7.1999 / 23:46:48 / stefan"
   174 !
   176 !
   175 
   177 
   176 handles:anException
   178 handles:anException
   177     "return true, if the receiver handles the argument, anException.
   179     "return true, if the receiver handles the argument, anException.
   178      (i.e. if any of the receivers elements handles anException)."
   180      (i.e. if any of the receiver's elements handles anException)."
   179 
   181 
   180     self do:[:eachExceptionHandler|
   182     self do:[:eachExceptionHandler|
   181 	(eachExceptionHandler handles:anException) ifTrue:[^ true]
   183         (eachExceptionHandler handles:anException) ifTrue:[^ true]
   182     ].
   184     ].
   183     ^ false
   185     ^ false
   184 !
   186 !
   185 
   187 
   186 isExceptionHandler
   188 isExceptionHandler
   376 
   378 
   377 !SignalSet::SetOfAnySignal methodsFor:'queries'!
   379 !SignalSet::SetOfAnySignal methodsFor:'queries'!
   378 
   380 
   379 accepts:anExceptionHandler
   381 accepts:anExceptionHandler
   380     "return true, if the receiver accepts the argument, aSignal.
   382     "return true, if the receiver accepts the argument, aSignal.
   381      (i.e. if any of the receivers elements is aSignal or a parent of it).
   383      (i.e. if any of the receiver's elements is aSignal or a parent of it).
   382      False otherwise. I, the special SetOfAnySignal accepts any (non-query) signal."
   384      False otherwise. I, the special SetOfAnySignal accepts any (non-query) signal."
   383 
   385 
   384     ^ anExceptionHandler isExceptionHandler and:[anExceptionHandler isQuerySignal not]
   386     ^ anExceptionHandler isExceptionHandler and:[anExceptionHandler isQuerySignal not]
   385 !
   387 !
   386 
   388 
   387 handles:anException
   389 handles:anException
   388     "return true, if the receiver handles the argument, anException.
   390     "return true, if the receiver handles the argument, anException.
   389      (i.e. if any of the receivers elements handles anException).
   391      (i.e. if any of the receiver's elements handles anException).
   390      I, the special SetOfAnySignal handle any (non-query) signal."
   392      I, the special SetOfAnySignal handle any (non-query) signal."
   391 
   393 
   392     ^ anException isNotification not
   394     ^ anException isNotification not
   393 !
   395 !
   394 
   396 
   400 ! !
   402 ! !
   401 
   403 
   402 !SignalSet class methodsFor:'documentation'!
   404 !SignalSet class methodsFor:'documentation'!
   403 
   405 
   404 version
   406 version
   405     ^ '$Header: /cvs/stx/stx/libbasic/SignalSet.st,v 1.47 2014-06-10 10:20:23 cg Exp $'
   407     ^ '$Header$'
   406 !
   408 !
   407 
   409 
   408 version_CVS
   410 version_CVS
   409     ^ '$Header: /cvs/stx/stx/libbasic/SignalSet.st,v 1.47 2014-06-10 10:20:23 cg Exp $'
   411     ^ '$Header$'
   410 ! !
   412 ! !
       
   413