--- a/Interval.st Wed Oct 31 15:57:14 2001 +0100
+++ b/Interval.st Wed Oct 31 15:57:48 2001 +0100
@@ -12,7 +12,7 @@
"{ Package: 'stx:libbasic' }"
-SequenceableCollection subclass:#Interval
+ReadOnlySequenceableCollection subclass:#Interval
instanceVariableNames:'start stop step'
classVariableNames:''
poolDictionaries:''
@@ -87,7 +87,8 @@
Re-redefined, since the implementation in SeqColl creates instances with an initial
size, which is not allowed for intevals."
- ^ self new fromLiteralArrayEncoding:anArray.! !
+ ^ self new fromLiteralArrayEncoding:anArray.
+! !
!Interval methodsFor:'accessing'!
@@ -100,14 +101,6 @@
^ self subscriptBoundsError:index
!
-at:index put:anObject
- "{ Pragma: +optSpace }"
-
- "catch at:put: message - intervals cannot store elements"
-
- self error:'you cannot store into an interval'
-!
-
first
"return the first element of the collection"
@@ -172,24 +165,6 @@
stop := aNumber
! !
-!Interval methodsFor:'adding & removing'!
-
-add:newObject
- "{ Pragma: +optSpace }"
-
- "catch add message - intervals cannot add elements"
-
- self error:'elements cannot be added to an interval'
-!
-
-remove:anObject
- "{ Pragma: +optSpace }"
-
- "catch remove message - intervals cannot remove elements"
-
- self error:'elements cannot be removed from an interval'
-! !
-
!Interval methodsFor:'converting'!
fromLiteralArrayEncoding:encoding
@@ -206,7 +181,8 @@
Interval new fromLiteralArrayEncoding:((1 to:10) literalArrayEncoding)
Interval new fromLiteralArrayEncoding:((1 to:10 by:2) literalArrayEncoding)
Interval decodeFromLiteralArray:((1 to:10 by:2) literalArrayEncoding)
- "!
+ "
+!
literalArrayEncoding
"encode myself as an array literal, from which a copy of the receiver
@@ -221,7 +197,8 @@
"
(1 to:10) literalArrayEncoding
(1 to:10 by:2) literalArrayEncoding
- "! !
+ "
+! !
!Interval methodsFor:'enumerating'!
@@ -378,5 +355,5 @@
!Interval class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Interval.st,v 1.28 2000-10-24 14:31:26 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Interval.st,v 1.29 2001-10-31 14:57:48 cg Exp $'
! !