author | mkobetic |
Tue, 31 Jan 2012 03:47:19 +0000 | |
changeset 90 | 59f68d289949 |
parent 74 | 752e2d88fe73 |
child 109 | 9587e2df7029 |
permissions | -rw-r--r-- |
2 | 1 |
"{ Package: 'stx:goodies/xtreams/core' }" |
2 |
||
3 |
"{ NameSpace: Xtreams }" |
|
4 |
||
5 |
Error subclass:#Incomplete |
|
6 |
instanceVariableNames:'collection count start' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
20
51de794993c3
added XtreamsPool to fix DefaultBufferSize; set proper category names
mkobetic
parents:
2
diff
changeset
|
9 |
category:'Xtreams-Core' |
2 | 10 |
! |
11 |
||
12 |
Incomplete comment:'This error is raised when a read or write fails to complete. The parameters report the details about successfully written or read elements. |
|
13 |
||
14 |
Instance Variables |
|
15 |
collection <Collection | nil> when possible points at the collection with the successfully processed elements |
|
16 |
count <Integer> number of successfully processed elements |
|
17 |
start <Integer> if collection is set, this is the index where the successfully processed elements start |
|
18 |
||
19 |
' |
|
20 |
! |
|
21 |
||
22 |
||
23 |
!Incomplete class methodsFor:'instance creation'! |
|
24 |
||
25 |
count: anInteger |
|
26 |
^self new on: nil count: anInteger at: nil |
|
27 |
! |
|
28 |
||
29 |
on: collection count: count at: start |
|
30 |
^self new on: collection count: count at: start |
|
31 |
! |
|
32 |
||
33 |
zero |
|
34 |
^self count: 0 |
|
35 |
! ! |
|
36 |
||
37 |
!Incomplete methodsFor:'accessing'! |
|
38 |
||
39 |
collection |
|
40 |
^collection |
|
41 |
! |
|
42 |
||
43 |
collection: anObject |
|
44 |
collection := anObject |
|
45 |
! |
|
46 |
||
47 |
contents |
|
48 |
^collection |
|
49 |
ifNil: [ self originator contentsSpecies withSize: count ] |
|
50 |
ifNotNil: [ collection copyFrom: start to: start + count - 1 ] |
|
51 |
! |
|
52 |
||
53 |
count |
|
54 |
^count |
|
55 |
! |
|
56 |
||
57 |
count: anObject |
|
58 |
count := anObject |
|
59 |
! |
|
60 |
||
61 |
start |
|
62 |
^start |
|
63 |
! |
|
64 |
||
65 |
start: anObject |
|
66 |
start := anObject |
|
67 |
! ! |
|
68 |
||
69 |
!Incomplete methodsFor:'initialize-release'! |
|
70 |
||
71 |
on: aCollection count: aCount at: aStart |
|
72 |
collection := aCollection. |
|
73 |
count := aCount. |
|
74 |
start := aStart |
|
75 |
! ! |
|
76 |
||
77 |
!Incomplete methodsFor:'private'! |
|
78 |
||
79 |
streamingInsert: anInteger into: aWriteStream |
|
80 |
| amount | |
|
81 |
collection ifNil: [(self class on: collection count: 0 at: start) raise]. |
|
82 |
amount := anInteger min: count. |
|
83 |
aWriteStream insert: amount from: collection at: start. |
|
84 |
amount < anInteger ifTrue: [(self class on: collection count: amount at: start) raise]. |
|
85 |
! |
|
86 |
||
87 |
streamingInsertInto: aWriteStream |
|
88 |
collection ifNil: [^0]. |
|
89 |
aWriteStream insert: count from: collection at: start. |
|
90 |
^count |
|
91 |
! |
|
92 |
||
93 |
streamingWrite: anInteger into: aWriteStream |
|
94 |
| amount | |
|
95 |
collection ifNil: [(self class on: collection count: 0 at: start) raise]. |
|
96 |
amount := anInteger min: count. |
|
97 |
aWriteStream write: amount from: collection at: start. |
|
98 |
amount < anInteger ifTrue: [(self class on: collection count: amount at: start) raise]. |
|
99 |
^anInteger |
|
100 |
! |
|
101 |
||
102 |
streamingWriteInto: aWriteStream |
|
103 |
collection ifNil: [^0]. |
|
104 |
aWriteStream write: count from: collection at: start. |
|
105 |
^count |
|
106 |
! ! |
|
107 |
||
108 |
!Incomplete class methodsFor:'documentation'! |
|
109 |
||
110 |
version_SVN |
|
111 |
^ '$Id$' |
|
112 |
! ! |