Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: samples/total/client/RowCol.dart

Issue 10635015: Delete proxy and total samples, which have bit-rotted. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/total/client/Reader.dart ('k') | samples/total/client/RowColStyle.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 /**
6 * An object containing a (row, column) reference.
7 *
8 * Objects of this class are immutable: they do not change after creation.
9 */
10 class RowCol implements Hashable {
11
12 static int hashOneValue(int val) {
13 final int fnvPrime = 0x01000193;
14 int output = fnvPrime;
15 int octet1 = val & 0xff;
16 output ^= octet1;
17 output *= fnvPrime;
18 int octet2 = (val >> 8) & 0xff;
19 output ^= octet2;
20 output *= fnvPrime;
21 int octet3 = (val >> 16) & 0xff;
22 output ^= octet3;
23
24 return output;
25 }
26
27 final int _col;
28 final int _row;
29
30 int get col() => _col;
31
32 int get row() => _row;
33
34 RowCol(this._row, this._col) { }
35
36 bool operator ==(RowCol other) {
37 if (!(other is RowCol)) {
38 return false;
39 }
40 return other._row == _row && other._col == _col;
41 }
42
43 RowCol operator +(RowCol other) => new RowCol(_row + other._row, _col + other. _col);
44
45 int hashCode() => (51 + hashOneValue(_row)) * 51 + hashOneValue(_col);
46
47 bool isValidCell() => _row > 0 && _col > 0;
48
49 String toA1String() => "${StringUtils.columnString(_col)}${_row}";
50
51 String toString() => "R${_row}C${_col}";
52
53 RowCol translate(int deltaRow, int deltaCol) => new RowCol(_row + deltaRow, _c ol + deltaCol);
54 }
55
OLDNEW
« no previous file with comments | « samples/total/client/Reader.dart ('k') | samples/total/client/RowColStyle.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698