SVN__Cache.st
changeset 633 21f34d8b860d
child 881 6b57d7f2ee17
equal deleted inserted replaced
632:4b434a3cfa6d 633:21f34d8b860d
       
     1 "
       
     2  Copyright (c) 2007-2010 Jan Vrany
       
     3  Copyright (c) 2009-2010 eXept Software AG
       
     4 
       
     5  Permission is hereby granted, free of charge, to any person
       
     6  obtaining a copy of this software and associated documentation
       
     7  files (the 'Software'), to deal in the Software without
       
     8  restriction, including without limitation the rights to use,
       
     9  copy, modify, merge, publish, distribute, sublicense, and/or sell
       
    10  copies of the Software, and to permit persons to whom the
       
    11  Software is furnished to do so, subject to the following
       
    12  conditions:
       
    13 
       
    14  The above copyright notice and this permission notice shall be
       
    15  included in all copies or substantial portions of the Software.
       
    16 
       
    17  THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
       
    18  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
       
    19  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
       
    20  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
       
    21  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
       
    22  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
       
    23  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
       
    24  OTHER DEALINGS IN THE SOFTWARE.
       
    25 "
       
    26 "{ Package: 'stx:libsvn' }"
       
    27 
       
    28 "{ NameSpace: SVN }"
       
    29 
       
    30 Dictionary subclass:#Cache
       
    31 	instanceVariableNames:''
       
    32 	classVariableNames:''
       
    33 	poolDictionaries:''
       
    34 	category:'SVN-Private'
       
    35 !
       
    36 
       
    37 !Cache class methodsFor:'documentation'!
       
    38 
       
    39 copyright
       
    40 "
       
    41  Copyright (c) 2007-2010 Jan Vrany
       
    42  Copyright (c) 2009-2010 eXept Software AG
       
    43 
       
    44  Permission is hereby granted, free of charge, to any person
       
    45  obtaining a copy of this software and associated documentation
       
    46  files (the 'Software'), to deal in the Software without
       
    47  restriction, including without limitation the rights to use,
       
    48  copy, modify, merge, publish, distribute, sublicense, and/or sell
       
    49  copies of the Software, and to permit persons to whom the
       
    50  Software is furnished to do so, subject to the following
       
    51  conditions:
       
    52 
       
    53  The above copyright notice and this permission notice shall be
       
    54  included in all copies or substantial portions of the Software.
       
    55 
       
    56  THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
       
    57  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
       
    58  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
       
    59  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
       
    60  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
       
    61  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
       
    62  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
       
    63  OTHER DEALINGS IN THE SOFTWARE.
       
    64 
       
    65 "
       
    66 ! !
       
    67 
       
    68 !Cache methodsFor:'accessing'!
       
    69 
       
    70 at: key ifAbsent: exceptionBlock
       
    71 
       
    72     ^(super at: key ifAbsent: exceptionBlock) value
       
    73 
       
    74     "Modified: / 22-12-2009 / 20:27:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    75 !
       
    76 
       
    77 at: key ifAbsentPut: anObject
       
    78 
       
    79     | entry |
       
    80     (self includesKey: key) ifTrue:[^self at: key].
       
    81     entry := CacheEntry getter: anObject.
       
    82     super at: key ifAbsentPut: [entry].
       
    83     ^entry value
       
    84 
       
    85     "Created: / 22-12-2009 / 20:27:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    86 !
       
    87 
       
    88 at: key put: anObject
       
    89 
       
    90     ^super 
       
    91         at: key 
       
    92         put: (CacheEntry getter: anObject)
       
    93 
       
    94     "Created: / 22-12-2009 / 20:26:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    95 ! !
       
    96 
       
    97 !Cache class methodsFor:'documentation'!
       
    98 
       
    99 version
       
   100     ^ '$Header$'
       
   101 !
       
   102 
       
   103 version_CVS
       
   104     ^ '$Header$'
       
   105 !
       
   106 
       
   107 version_SVN
       
   108     ^ '§Id: SVN__Cache.st 350 2011-07-07 18:42:56Z vranyj1 §'
       
   109 ! !