This repository was archived by the owner on Jun 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpreadsheet.XML
553 lines (481 loc) · 26.3 KB
/
Spreadsheet.XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
<?xml version="1.0"?>
<doc>
<assembly>
<name>Spreadsheet</name>
</assembly>
<members>
<member name="T:SS.CircularException">
<summary>
Thrown to indicate that a change to a cell will cause a circular dependency.
</summary>
</member>
<member name="T:SS.InvalidNameException">
<summary>
Thrown to indicate that a name parameter was either null or invalid.
</summary>
</member>
<member name="T:SS.SpreadsheetReadWriteException">
<summary>
Thrown to indicate that a read or write attempt has failed.
</summary>
</member>
<member name="M:SS.SpreadsheetReadWriteException.#ctor(System.String)">
<summary>
Creates the exception with a message
</summary>
</member>
<member name="T:SS.AbstractSpreadsheet">
<summary>
An AbstractSpreadsheet object represents the state of a simple spreadsheet. A
spreadsheet consists of an infinite number of named cells.
A string is a cell name if and only if it consists of one or more letters,
followed by one or more digits AND it satisfies the predicate IsValid.
For example, "A15", "a15", "XY032", and "BC7" are cell names so long as they
satisfy IsValid. On the other hand, "Z", "X_", and "hello" are not cell names,
regardless of IsValid.
Any valid incoming cell name, whether passed as a parameter or embedded in a formula,
must be normalized with the Normalize method before it is used by or saved in
this spreadsheet. For example, if Normalize is s => s.ToUpper(), then
the Formula "x3+a5" should be converted to "X3+A5" before use.
A spreadsheet contains a cell corresponding to every possible cell name.
In addition to a name, each cell has a contents and a value. The distinction is
important.
The contents of a cell can be (1) a string, (2) a double, or (3) a Formula. If the
contents is an empty string, we say that the cell is empty. (By analogy, the contents
of a cell in Excel is what is displayed on the editing line when the cell is selected.)
In a new spreadsheet, the contents of every cell is the empty string.
The value of a cell can be (1) a string, (2) a double, or (3) a FormulaError.
(By analogy, the value of an Excel cell is what is displayed in that cell's position
in the grid.)
If a cell's contents is a string, its value is that string.
If a cell's contents is a double, its value is that double.
If a cell's contents is a Formula, its value is either a double or a FormulaError,
as reported by the Evaluate method of the Formula class. The value of a Formula,
of course, can depend on the values of variables. The value of a variable is the
value of the spreadsheet cell it names (if that cell's value is a double) or
is undefined (otherwise).
Spreadsheets are never allowed to contain a combination of Formulas that establish
a circular dependency. A circular dependency exists when a cell depends on itself.
For example, suppose that A1 contains B1*2, B1 contains C1*2, and C1 contains A1*2.
A1 depends on B1, which depends on C1, which depends on A1. That's a circular
dependency.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.#ctor(System.Func{System.String,System.Boolean},System.Func{System.String,System.String},System.String)">
<summary>
Constructs an abstract spreadsheet by recording its variable validity test,
its normalization method, and its version information. The variable validity
test is used throughout to determine whether a string that consists of one or
more letters followed by one or more digits is a valid cell name. The variable
equality test should be used thoughout to determine whether two variables are
equal.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.GetSavedVersion(System.String)">
<summary>
Returns the version information of the spreadsheetg savd in the named file.
If there are any problems opening, reading, or closing the file, the method
should throw a SpreadsheetReadWriteException with an explanatory message.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.Save(System.String)">
<summary>
Writes the contents of this spreadsheet to the named file using an XML format.
The XML elements should be structured as follows:
<spreadsheet version="version information goes here">
<cell>
<name>
cell name goes here
</name>
<contents>
cell contents goes here
</contents>
</cell>
</spreadsheet>
There should be one cell element for each non-empty cell in the spreadsheet.
If the cell contains a string, it should be written as the contents.
If the cell contains a double d, d.ToString() should be written as the contents.
If the cell contains a Formula f, f.ToString() with "=" prepended should be written as the contents.
If there are any problems opening, writing, or closing the file, the method should throw a
SpreadsheetReadWriteException with an explanatory message.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.GetCellValue(System.String)">
<summary>
If name is null or invalid, throws an InvalidNameException.
Otherwise, returns the value (as opposed to the contents) of the named cell. The return
value should be either a string, a double, or a SpreadsheetUtilities.FormulaError.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.GetNamesOfAllNonemptyCells">
<summary>
Enumerates the names of all the non-empty cells in the spreadsheet.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.GetCellContents(System.String)">
<summary>
If name is null or invalid, throws an InvalidNameException.
Otherwise, returns the contents (as opposed to the value) of the named cell. The return
value should be either a string, a double, or a Formula.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.SetContentsOfCell(System.String,System.String)">
<summary>
If content is null, throws an ArgumentNullException.
Otherwise, if name is null or invalid, throws an InvalidNameException.
Otherwise, if content parses as a double, the contents of the named
cell becomes that double.
Otherwise, if content begins with the character '=', an attempt is made
to parse the remainder of content into a Formula f using the Formula
constructor. There are then three possibilities:
(1) If the remainder of content cannot be parsed into a Formula, a
SpreadsheetUtilities.FormulaFormatException is thrown.
(2) Otherwise, if changing the contents of the named cell to be f
would cause a circular dependency, a CircularException is thrown.
(3) Otherwise, the contents of the named cell becomes f.
Otherwise, the contents of the named cell becomes content.
If an exception is not thrown, the method returns a set consisting of
name plus the names of all other cells whose value depends, directly
or indirectly, on the named cell.
For example, if name is A1, B1 contains A1*2, and C1 contains B1+A1, the
set {A1, B1, C1} is returned.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.SetCellContents(System.String,System.Double)">
<summary>
If name is null or invalid, throws an InvalidNameException.
Otherwise, the contents of the named cell becomes number. The method returns a
set consisting of name plus the names of all other cells whose value depends,
directly or indirectly, on the named cell.
For example, if name is A1, B1 contains A1*2, and C1 contains B1+A1, the
set {A1, B1, C1} is returned.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.SetCellContents(System.String,System.String)">
<summary>
If text is null, throws an ArgumentNullException.
Otherwise, if name is null or invalid, throws an InvalidNameException.
Otherwise, the contents of the named cell becomes text. The method returns a
set consisting of name plus the names of all other cells whose value depends,
directly or indirectly, on the named cell.
For example, if name is A1, B1 contains A1*2, and C1 contains B1+A1, the
set {A1, B1, C1} is returned.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.SetCellContents(System.String,SpreadsheetUtilities.Formula)">
<summary>
If formula parameter is null, throws an ArgumentNullException.
Otherwise, if name is null or invalid, throws an InvalidNameException.
Otherwise, if changing the contents of the named cell to be the formula would cause a
circular dependency, throws a CircularException.
Otherwise, the contents of the named cell becomes formula. The method returns a
Set consisting of name plus the names of all other cells whose value depends,
directly or indirectly, on the named cell.
For example, if name is A1, B1 contains A1*2, and C1 contains B1+A1, the
set {A1, B1, C1} is returned.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.GetDirectDependents(System.String)">
<summary>
If name is null, throws an ArgumentNullException.
Otherwise, if name isn't a valid cell name, throws an InvalidNameException.
Otherwise, returns an enumeration, without duplicates, of the names of all cells whose
values depend directly on the value of the named cell. In other words, returns
an enumeration, without duplicates, of the names of all cells that contain
formulas containing name.
For example, suppose that
A1 contains 3
B1 contains the formula A1 * A1
C1 contains the formula B1 + A1
D1 contains the formula B1 - C1
The direct dependents of A1 are B1 and C1
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.GetCellsToRecalculate(System.Collections.Generic.ISet{System.String})">
<summary>
Requires that names be non-null. Also requires that if names contains s,
then s must be a valid non-null cell name.
If any of the named cells are involved in a circular dependency,
throws a CircularException.
Otherwise, returns an enumeration of the names of all cells whose values must
be recalculated, assuming that the contents of each cell named in names has changed.
The names are enumerated in the order in which the calculations should be done.
For example, suppose that
A1 contains 5
B1 contains 7
C1 contains the formula A1 + B1
D1 contains the formula A1 * C1
E1 contains 15
If A1 and B1 have changed, then A1, B1, and C1, and D1 must be recalculated,
and they must be recalculated in either the order A1,B1,C1,D1 or B1,A1,C1,D1.
The method will produce one of those enumerations.
Please note that this method depends on the abstract GetDirectDependents.
It won't work until GetDirectDependents is implemented correctly.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.GetCellsToRecalculate(System.String)">
<summary>
A convenience method for invoking the other version of GetCellsToRecalculate
with a singleton set of names. See the other version for details.
</summary>
</member>
<member name="M:SS.AbstractSpreadsheet.Visit(System.String,System.String,System.Collections.Generic.ISet{System.String},System.Collections.Generic.LinkedList{System.String})">
<summary>
A helper for the GetCellsToRecalculate method.
</summary>
</member>
<member name="P:SS.AbstractSpreadsheet.Changed">
<summary>
True if this spreadsheet has been modified since it was created or saved
(whichever happened most recently); false otherwise.
</summary>
</member>
<member name="P:SS.AbstractSpreadsheet.IsValid">
<summary>
Method used to determine whether a string that consists of one or more letters
followed by one or more digits is a valid variable name.
</summary>
</member>
<member name="P:SS.AbstractSpreadsheet.Normalize">
<summary>
Method used to convert a cell name to its standard form. For example,
Normalize might convert names to upper case.
</summary>
</member>
<member name="P:SS.AbstractSpreadsheet.Version">
<summary>
Version information
</summary>
</member>
<member name="M:SS.Spreadsheet.GetSavedVersion(System.String)">
<summary>
Returns the version information of the spreadsheetg savd in the named file.
If there are any problems opening, reading, or closing the file, the method
should throw a SpreadsheetReadWriteException with an explanatory message.
</summary>
</member>
<member name="M:SS.Spreadsheet.Save(System.String)">
<summary>
Writes the contents of this spreadsheet to the named file using an XML format.
The XML elements should be structured as follows:
<spreadsheet version="version information goes here">
<cell>
<name>
cell name goes here
</name>
<contents>
cell contents goes here
</contents>
</cell>
</spreadsheet>
There should be one cell element for each non-empty cell in the spreadsheet.
If the cell contains a string, it should be written as the contents.
If the cell contains a double d, d.ToString() should be written as the contents.
If the cell contains a Formula f, f.ToString() with "=" prepended should be written as the contents.
If there are any problems opening, writing, or closing the file, the method should throw a
SpreadsheetReadWriteException with an explanatory message.
</summary>
</member>
<member name="M:SS.Spreadsheet.GetCellValue(System.String)">
<summary>
If name is null or invalid, throws an InvalidNameException.
Otherwise, returns the value (as opposed to the contents) of the named cell. The return
value should be either a string, a double, or a SpreadsheetUtilities.FormulaError.
</summary>
</member>
<member name="M:SS.Spreadsheet.SetContentsOfCell(System.String,System.String)">
<summary>
If content is null, throws an ArgumentNullException.
Otherwise, if name is null or invalid, throws an InvalidNameException.
Otherwise, if content parses as a double, the contents of the named
cell becomes that double.
Otherwise, if content begins with the character '=', an attempt is made
to parse the remainder of content into a Formula f using the Formula
constructor. There are then three possibilities:
(1) If the remainder of content cannot be parsed into a Formula, a
SpreadsheetUtilities.FormulaFormatException is thrown.
(2) Otherwise, if changing the contents of the named cell to be f
would cause a circular dependency, a CircularException is thrown.
(3) Otherwise, the contents of the named cell becomes f.
Otherwise, the contents of the named cell becomes content.
If an exception is not thrown, the method returns a set consisting of
name plus the names of all other cells whose value depends, directly
or indirectly, on the named cell.
For example, if name is A1, B1 contains A1*2, and C1 contains B1+A1, the
set {A1, B1, C1} is returned.
</summary>
</member>
<member name="M:SS.Spreadsheet.GetNamesOfAllNonemptyCells">
<summary>
Enumerates the names of all the non-empty cells in the spreadsheet.
</summary>
</member>
<member name="M:SS.Spreadsheet.GetCellContents(System.String)">
<summary>
If name is null or invalid, throws an InvalidNameException.
Otherwise, returns the contents (as opposed to the value) of the named cell. The return
value should be either a string, a double, or a Formula.
</summary>
<param name="name"></param>
<returns></returns>
</member>
<member name="M:SS.Spreadsheet.SetCellContents(System.String,System.Double)">
<summary>
If name is null or invalid, throws an InvalidNameException.
Otherwise, the contents of the named cell becomes number. The method returns a
set consisting of name plus the names of all other cells whose value depends,
directly or indirectly, on the named cell.
For example, if name is A1, B1 contains A1*2, and C1 contains B1+A1, the
set {A1, B1, C1} is returned.
</summary>
</member>
<member name="M:SS.Spreadsheet.SetCellContents(System.String,System.String)">
<summary>
If text is null, throws an ArgumentNullException.
Otherwise, if name is null or invalid, throws an InvalidNameException.
Otherwise, the contents of the named cell becomes text. The method returns a
set consisting of name plus the names of all other cells whose value depends,
directly or indirectly, on the named cell.
For example, if name is A1, B1 contains A1*2, and C1 contains B1+A1, the
set {A1, B1, C1} is returned.
</summary>
</member>
<member name="M:SS.Spreadsheet.SetCellContents(System.String,SpreadsheetUtilities.Formula)">
<summary>
If formula parameter is null, throws an ArgumentNullException.
Otherwise, if name is null or invalid, throws an InvalidNameException.
Otherwise, if changing the contents of the named cell to be the formula would cause a
circular dependency, throws a CircularException.
Otherwise, the contents of the named cell becomes formula. The method returns a
Set consisting of name plus the names of all other cells whose value depends,
directly or indirectly, on the named cell.
For example, if name is A1, B1 contains A1*2, and C1 contains B1+A1, the
set {A1, B1, C1} is returned.
</summary>
</member>
<member name="M:SS.Spreadsheet.GetDirectDependents(System.String)">
<summary>
If name is null, throws an ArgumentNullException.
Otherwise, if name isn't a valid cell name, throws an InvalidNameException.
Otherwise, returns an enumeration, without duplicates, of the names of all cells whose
values depend directly on the value of the named cell. In other words, returns
an enumeration, without duplicates, of the names of all cells that contain
formulas containing name.
For example, suppose that
A1 contains 3
B1 contains the formula A1 * A1
C1 contains the formula B1 + A1
D1 contains the formula B1 - C1
The direct dependents of A1 are B1 and C1
</summary>
<param name="name"></param>
<returns></returns>
</member>
<member name="M:SS.Spreadsheet.hasCircularDependencies(SpreadsheetUtilities.Formula,System.String)">
<summary>
This will extract the variables used in a given formula and check our spreadsheet to see if any of
these variables currently depend on a cell (original) within our spreadsheet.
</summary>
<param name="formula"></param>
<param name="original"></param>
<returns></returns>
</member>
<member name="M:SS.Spreadsheet.hasCircularDependencies(System.String,System.String)">
<summary>
This will check a particular cell to see if there are any EXISTING circular dependencies that this cell
is a part of. Seeing how circular dependencies are checked before allowing a formula cell to be entered
in, calling this method with the cellName and original being equal should result in false every time.
</summary>
<param name="cellName"></param>
<param name="original"></param>
<returns></returns>
</member>
<member name="M:SS.Spreadsheet.getAllDependents(System.String,System.Collections.Generic.ISet{System.String}@)">
<summary>
Gets all the direct and indirect dependents of a cell and puts them in a provided set.
</summary>
<param name="name"></param>
<param name="output"></param>
</member>
<member name="M:SS.Spreadsheet.SetCellContentsAsObject(System.String,System.Object)">
<summary>
Sets the contents of any cell, given an object and the cell's name.
</summary>
<param name="name"></param>
<param name="contents"></param>
<returns></returns>
</member>
<member name="P:SS.Spreadsheet.Changed">
<summary>
True if this spreadsheet has been modified since it was created or saved
(whichever happened most recently); false otherwise.
</summary>
</member>
<member name="T:SS.Cell">
<summary>
Representation of a spreadsheet cell.
</summary>
</member>
<member name="M:SS.Cell.#ctor(System.String)">
<summary>
Create a new cell with specified name.
9/30 - Removed a check on the name, deemed redundant and not in the scope of the purpose of Cell.
</summary>
<param name="name"></param>
</member>
<member name="M:SS.Cell.#ctor(System.String,System.Object)">
<summary>
Creates a cell with specified contents.
</summary>
<param name="name"></param>
<param name="contents"></param>
</member>
<member name="M:SS.Cell.nameIsValid(System.String@,System.Func{System.String,System.Boolean},System.Func{System.String,System.String})">
<summary>
Validates a spreadsheet cell name.
</summary>
<param name="s"></param>
<param name="isValid"></param>
<param name="normalize"></param>
<returns></returns>
</member>
<member name="M:SS.Cell.nameIsValid(System.String,System.Func{System.String,System.Boolean})">
<summary>
Validates a spreadsheet cell name.
</summary>
<param name="s"></param>
<param name="isValid"></param>
<param name="normalize"></param>
<returns></returns>
</member>
<member name="M:SS.Cell.setContents(System.Object)">
<summary>
Sets the contents of the cell. Contents must be a string, double, or Formula, or nothing will be set.
</summary>
<param name="o">Contents of the cell.</param>
</member>
<member name="M:SS.Cell.getValue">
<summary>
Retrieves the value of the cell contents.
</summary>
<returns></returns>
</member>
<member name="M:SS.Cell.getContents">
<summary>
Returns the contents of the cell.
</summary>
<returns></returns>
</member>
<member name="M:SS.Cell.getContentsAsString">
<summary>
Returns the string representation of the cell contents.
</summary>
<returns></returns>
</member>
<member name="P:SS.Cell.Name">
<summary>
Name of the cell.
</summary>
</member>
</members>
</doc>