ReadOnlySequenceableCollection.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:55:17 +0200
changeset 24417 03b083548da2
parent 8893 99996b25482e
child 17711 39faaaf888b4
permissions -rw-r--r--
#REFACTORING by exept class: Smalltalk class changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6190
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
     1
"
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
     2
 COPYRIGHT (c) 2001 by eXept Software AG
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
     3
              All Rights Reserved
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
     4
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
     5
 This software is furnished under a license and may be used
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
     6
 only in accordance with the terms of that license and with the
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
     8
 be provided or otherwise made available to, or used by, any
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
     9
 other person.  No title to or ownership of the software is
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    10
 hereby transferred.
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    11
"
8453
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    12
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"{ Package: 'stx:libbasic' }"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
SequenceableCollection subclass:#ReadOnlySequenceableCollection
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	instanceVariableNames:''
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	category:'Collections-Abstract'
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
6190
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    22
!ReadOnlySequenceableCollection class methodsFor:'documentation'!
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    23
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    24
copyright
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    25
"
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    26
 COPYRIGHT (c) 2001 by eXept Software AG
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    27
              All Rights Reserved
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    28
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    29
 This software is furnished under a license and may be used
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    30
 only in accordance with the terms of that license and with the
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    32
 be provided or otherwise made available to, or used by, any
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    33
 other person.  No title to or ownership of the software is
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    34
 hereby transferred.
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    35
"
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    36
!
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    37
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    38
documentation
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    39
"
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    40
    Abstract class which blocks some write access operations.
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    41
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    42
    See concrete subclasses (such as Interval).
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    43
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    44
    [author:]
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    45
        Claus Gittinger
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    46
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    47
    [see also:]
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    48
        SequenceableCollection
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    49
"
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    50
! !
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
8893
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
    52
!ReadOnlySequenceableCollection class methodsFor:'queries'!
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
    53
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
    54
isAbstract
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
    55
    ^ self == ReadOnlySequenceableCollection
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
    56
! !
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
    57
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
!ReadOnlySequenceableCollection methodsFor:'blocked access'!
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
add:newObject
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    "{ Pragma: +optSpace }"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    "catch add message - cannot add elements"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    self error:('elements cannot be added to ' , self classNameWithArticle)
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    "
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
     (1 to:10) add:11   
8453
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    69
     (1 to:10) addAll:#(11 12)   
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    70
     (1 to:10) remove:9    
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    71
     (1 to:10) remove:9 ifAbsent:nil   
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    72
     (1 to:10) removeAll:#(1 4)
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    73
     (1 to:10) atAllPut:1
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    "
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
!
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
at:index put:anObject
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    "{ Pragma: +optSpace }"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    "catch at:put: message - cannot store elements"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    self error:('you cannot store into ' , self classNameWithArticle)
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    "
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
     (1 to:10) at:5 put:10   
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
     (1 to:10) atAllPut:5   
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
     (1 to:10) replaceFrom:1 to:4 with:#(10 20 30 40)  
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    "
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    "Created: / 31.10.2001 / 10:05:36 / cg"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    "Modified: / 31.10.2001 / 10:09:19 / cg"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
!
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
8453
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    94
remove:anObject ifAbsent:exceptionalValue
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    "{ Pragma: +optSpace }"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    "catch remove message - cannot remove elements"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    self error:('elements cannot be removed from ' , self classNameWithArticle)
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    "
8453
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   102
     (1 to:10) remove:9 ifAbsent:nil  
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    "
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
! !
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
!ReadOnlySequenceableCollection class methodsFor:'documentation'!
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
version
8893
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
   109
    ^ '$Header: /cvs/stx/stx/libbasic/ReadOnlySequenceableCollection.st,v 1.4 2005-06-27 10:24:03 cg Exp $'
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
! !