ReadOnlySequenceableCollection.st
author Jan Vrany <jan.vrany@labware.com>
Tue, 01 Jun 2021 20:19:13 +0100
branchjv
changeset 25424 51bd8a6b196f
parent 17911 a99f15c5efa5
permissions -rw-r--r--
Cherry-picked `Context` cherry-picked Context.st from a6b6dda4caff: * 4aaf30c174e9: #DOCUMENTATION by cg, Claus Gittinger <cg@exept.de> * c67311afcc6c: #OTHER by cg, Claus Gittinger <cg@exept.de> * 883f79e7b2a6: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 716f3fbb09e9: Don't mark contexts with `CATCHMARK`, Jan Vrany <jan.vrany@fit.cvut.cz> * cff24fa817b0: #REFACTORING by stefan, Stefan Vogel <sv@exept.de> * 521f0d837330: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * bf1118f0fcca: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * e587cdd22868: #BUGFIX by cg, Claus Gittinger <cg@exept.de> * fe9f9487a3ed: #DOCUMENTATION by cg, Claus Gittinger <cg@exept.de> * d5b781899274: #BUGFIX by cg, Claus Gittinger <cg@exept.de> * 8258751a7465: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 40173e082cbc: Copyright updates, Jan Vrany <jan.vrany@fit.cvut.cz> * 6db5c28207d5: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 871ea64fd5dc: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 4b544a108e4e: #DOCUMENTATION by cg, Claus Gittinger <cg@exept.de> * 9a8d8399e566: #FEATURE by cgexept.de, Claus Gittinger <cg@exept.de> * 170b00be0103: #BUGFIX by stefan, Stefan Vogel <sv@exept.de> * a6c73965eae8: #FEATURE by cg, Claus Gittinger <cg@exept.de> * ce2a0e462ff0: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 46a260a9ca92: #FEATURE by cg, Claus Gittinger <cg@exept.de> * 46cab49167fb: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * 7d52dfd3997d: #DOCUMENTATION by exept, Claus Gittinger <cg@exept.de> * c52eeea62763: Fix `Context >> argAndVarNames` in cases when debug info is not available, Jan Vrany <jan.vrany@labware.com> * b5d6963fe4a9: Backed out changeset c52eeea62763, Jan Vrany <jan.vrany@labware.com> * 6fd3896f8703: #FEATURE by exept, Claus Gittinger <cg@exept.de> * b530ee616256: #REFACTORING by cg, Claus Gittinger <cg@exept.de> * ef9b481d7498: #FEATURE by cg, Claus Gittinger <cg@exept.de> * ea663b72bd51: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 6179572a733c: #FEATURE by exept, Claus Gittinger <cg@exept.de> * 84155b1b6622: #DOCUMENTATION by exept, Claus Gittinger <cg@exept.de> * 37d06602d856: *** empty log message ***, Claus Gittinger <cg@exept.de> * f927b9022fea: *** empty log message ***, Claus Gittinger <cg@exept.de> * 427d3be62d97: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de>
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
"
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic' }"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
SequenceableCollection subclass:#ReadOnlySequenceableCollection
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Collections-Abstract'
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
6190
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    21
!ReadOnlySequenceableCollection class methodsFor:'documentation'!
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    22
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    23
copyright
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    24
"
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    25
 COPYRIGHT (c) 2001 by eXept Software AG
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    26
              All Rights Reserved
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    27
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    28
 This software is furnished under a license and may be used
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    29
 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
    30
 inclusion of the above copyright notice.   This software may not
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    31
 be provided or otherwise made available to, or used by, any
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    32
 other person.  No title to or ownership of the software is
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    33
 hereby transferred.
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    34
"
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
documentation
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    38
"
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    39
    Abstract class which blocks some write access operations.
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    40
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    41
    See concrete subclasses (such as Interval).
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    42
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    43
    [author:]
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    44
        Claus Gittinger
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    45
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    46
    [see also:]
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    47
        SequenceableCollection
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    48
"
7a793b79dc05 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6128
diff changeset
    49
! !
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
8893
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
    51
!ReadOnlySequenceableCollection class methodsFor:'queries'!
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
    52
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
    53
isAbstract
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
    54
    ^ self == ReadOnlySequenceableCollection
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
    55
! !
99996b25482e +isAbstract
Claus Gittinger <cg@exept.de>
parents: 8453
diff changeset
    56
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
!ReadOnlySequenceableCollection methodsFor:'blocked access'!
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
add:newObject
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    "{ Pragma: +optSpace }"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    "catch add message - cannot add elements"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    self error:('elements cannot be added to ' , self classNameWithArticle)
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    "
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
     (1 to:10) add:11   
8453
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    68
     (1 to:10) addAll:#(11 12)   
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    69
     (1 to:10) remove:9    
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    70
     (1 to:10) remove:9 ifAbsent:nil   
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    71
     (1 to:10) removeAll:#(1 4)
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    72
     (1 to:10) atAllPut:1
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    "
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
at:index put:anObject
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    "{ Pragma: +optSpace }"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    "catch at:put: message - cannot store elements"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    self error:('you cannot store into ' , self classNameWithArticle)
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    "
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
     (1 to:10) at:5 put:10   
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
     (1 to:10) atAllPut:5   
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
     (1 to:10) replaceFrom:1 to:4 with:#(10 20 30 40)  
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    "
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    "Created: / 31.10.2001 / 10:05:36 / cg"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    "Modified: / 31.10.2001 / 10:09:19 / cg"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
!
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
8453
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
    93
remove:anObject ifAbsent:exceptionalValue
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    "{ Pragma: +optSpace }"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    "catch remove message - cannot remove elements"
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    self error:('elements cannot be removed from ' , self classNameWithArticle)
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    "
8453
84f1e451fc26 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   101
     (1 to:10) remove:9 ifAbsent:nil  
6128
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
    "
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
!ReadOnlySequenceableCollection class methodsFor:'documentation'!
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
3d1b57ef26ff initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
version
17892
d86c8bd5ece3 Merged with CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17869
diff changeset
   108
    ^ '$Header: /cvs/stx/stx/libbasic/ReadOnlySequenceableCollection.st,v 1.4 2005/06/27 10:24:03 cg Exp $'
17865
598963c6ff8e Recommited from itself
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17846
diff changeset
   109
!
598963c6ff8e Recommited from itself
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17846
diff changeset
   110
598963c6ff8e Recommited from itself
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17846
diff changeset
   111
version_SVN
17911
a99f15c5efa5 Updated with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17910
diff changeset
   112
    ^ '$Id: ReadOnlySequenceableCollection.st 10761 2012-01-19 11:46:00Z vranyj1 $'
17846
24edc476ac18 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17845
diff changeset
   113
! !
17892
d86c8bd5ece3 Merged with CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17869
diff changeset
   114
17910
8d796ca8bd1d Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
   115
17911
a99f15c5efa5 Updated with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17910
diff changeset
   116