@@ -49,16 +49,19 @@ goog.provide('jspb.arith.UInt64');
49
49
* @param {number } lo The low 32 bits.
50
50
* @param {number } hi The high 32 bits.
51
51
* @constructor
52
+ * @export
52
53
*/
53
54
jspb . arith . UInt64 = function ( lo , hi ) {
54
55
/**
55
56
* The low 32 bits.
56
- * @public {number}
57
+ * @type {number }
58
+ * @export
57
59
*/
58
60
this . lo = lo ;
59
61
/**
60
62
* The high 32 bits.
61
- * @public {number}
63
+ * @type {number }
64
+ * @export
62
65
*/
63
66
this . hi = hi ;
64
67
} ;
@@ -69,6 +72,7 @@ jspb.arith.UInt64 = function(lo, hi) {
69
72
* less, +1 if the first is greater, or 0 if both are equal.
70
73
* @param {!jspb.arith.UInt64 } other
71
74
* @return {number }
75
+ * @export
72
76
*/
73
77
jspb . arith . UInt64 . prototype . cmp = function ( other ) {
74
78
if ( this . hi < other . hi || ( this . hi == other . hi && this . lo < other . lo ) ) {
@@ -84,6 +88,7 @@ jspb.arith.UInt64.prototype.cmp = function(other) {
84
88
/**
85
89
* Right-shift this number by one bit.
86
90
* @return {!jspb.arith.UInt64 }
91
+ * @export
87
92
*/
88
93
jspb . arith . UInt64 . prototype . rightShift = function ( ) {
89
94
var hi = this . hi >>> 1 ;
@@ -95,6 +100,7 @@ jspb.arith.UInt64.prototype.rightShift = function() {
95
100
/**
96
101
* Left-shift this number by one bit.
97
102
* @return {!jspb.arith.UInt64 }
103
+ * @export
98
104
*/
99
105
jspb . arith . UInt64 . prototype . leftShift = function ( ) {
100
106
var lo = this . lo << 1 ;
@@ -106,6 +112,7 @@ jspb.arith.UInt64.prototype.leftShift = function() {
106
112
/**
107
113
* Test the MSB.
108
114
* @return {boolean }
115
+ * @export
109
116
*/
110
117
jspb . arith . UInt64 . prototype . msb = function ( ) {
111
118
return ! ! ( this . hi & 0x80000000 ) ;
@@ -115,6 +122,7 @@ jspb.arith.UInt64.prototype.msb = function() {
115
122
/**
116
123
* Test the LSB.
117
124
* @return {boolean }
125
+ * @export
118
126
*/
119
127
jspb . arith . UInt64 . prototype . lsb = function ( ) {
120
128
return ! ! ( this . lo & 1 ) ;
@@ -124,6 +132,7 @@ jspb.arith.UInt64.prototype.lsb = function() {
124
132
/**
125
133
* Test whether this number is zero.
126
134
* @return {boolean }
135
+ * @export
127
136
*/
128
137
jspb . arith . UInt64 . prototype . zero = function ( ) {
129
138
return this . lo == 0 && this . hi == 0 ;
@@ -134,6 +143,7 @@ jspb.arith.UInt64.prototype.zero = function() {
134
143
* Add two 64-bit numbers to produce a 64-bit number.
135
144
* @param {!jspb.arith.UInt64 } other
136
145
* @return {!jspb.arith.UInt64 }
146
+ * @export
137
147
*/
138
148
jspb . arith . UInt64 . prototype . add = function ( other ) {
139
149
var lo = ( ( this . lo + other . lo ) & 0xffffffff ) >>> 0 ;
@@ -148,6 +158,7 @@ jspb.arith.UInt64.prototype.add = function(other) {
148
158
* Subtract two 64-bit numbers to produce a 64-bit number.
149
159
* @param {!jspb.arith.UInt64 } other
150
160
* @return {!jspb.arith.UInt64 }
161
+ * @export
151
162
*/
152
163
jspb . arith . UInt64 . prototype . sub = function ( other ) {
153
164
var lo = ( ( this . lo - other . lo ) & 0xffffffff ) >>> 0 ;
@@ -163,6 +174,7 @@ jspb.arith.UInt64.prototype.sub = function(other) {
163
174
* @param {number } a The first integer: must be in [0, 2^32-1).
164
175
* @param {number } b The second integer: must be in [0, 2^32-1).
165
176
* @return {!jspb.arith.UInt64 }
177
+ * @export
166
178
*/
167
179
jspb . arith . UInt64 . mul32x32 = function ( a , b ) {
168
180
// Directly multiplying two 32-bit numbers may produce up to 64 bits of
@@ -204,6 +216,7 @@ jspb.arith.UInt64.mul32x32 = function(a, b) {
204
216
* truncate the top 32 bits.
205
217
* @param {number } a The multiplier.
206
218
* @return {!jspb.arith.UInt64 }
219
+ * @export
207
220
*/
208
221
jspb . arith . UInt64 . prototype . mul = function ( a ) {
209
222
// Produce two parts: at bits 0-63, and 32-95.
@@ -223,6 +236,7 @@ jspb.arith.UInt64.prototype.mul = function(a) {
223
236
* @param {number } _divisor
224
237
* @return {Array<jspb.arith.UInt64> } array of [quotient, remainder],
225
238
* unless divisor is 0, in which case an empty array is returned.
239
+ * @export
226
240
*/
227
241
jspb . arith . UInt64 . prototype . div = function ( _divisor ) {
228
242
if ( _divisor == 0 ) {
@@ -264,6 +278,7 @@ jspb.arith.UInt64.prototype.div = function(_divisor) {
264
278
* Convert a 64-bit number to a string.
265
279
* @return {string }
266
280
* @override
281
+ * @export
267
282
*/
268
283
jspb . arith . UInt64 . prototype . toString = function ( ) {
269
284
var result = '' ;
@@ -285,6 +300,7 @@ jspb.arith.UInt64.prototype.toString = function() {
285
300
* Parse a string into a 64-bit number. Returns `null` on a parse error.
286
301
* @param {string } s
287
302
* @return {?jspb.arith.UInt64 }
303
+ * @export
288
304
*/
289
305
jspb . arith . UInt64 . fromString = function ( s ) {
290
306
var result = new jspb . arith . UInt64 ( 0 , 0 ) ;
@@ -305,6 +321,7 @@ jspb.arith.UInt64.fromString = function(s) {
305
321
/**
306
322
* Make a copy of the uint64.
307
323
* @return {!jspb.arith.UInt64 }
324
+ * @export
308
325
*/
309
326
jspb . arith . UInt64 . prototype . clone = function ( ) {
310
327
return new jspb . arith . UInt64 ( this . lo , this . hi ) ;
@@ -324,16 +341,19 @@ jspb.arith.UInt64.prototype.clone = function() {
324
341
* @param {number } lo The low 32 bits.
325
342
* @param {number } hi The high 32 bits.
326
343
* @constructor
344
+ * @export
327
345
*/
328
346
jspb . arith . Int64 = function ( lo , hi ) {
329
347
/**
330
348
* The low 32 bits.
331
- * @public {number}
349
+ * @type {number }
350
+ * @export
332
351
*/
333
352
this . lo = lo ;
334
353
/**
335
354
* The high 32 bits.
336
- * @public {number}
355
+ * @type {number }
356
+ * @export
337
357
*/
338
358
this . hi = hi ;
339
359
} ;
@@ -343,6 +363,7 @@ jspb.arith.Int64 = function(lo, hi) {
343
363
* Add two 64-bit numbers to produce a 64-bit number.
344
364
* @param {!jspb.arith.Int64 } other
345
365
* @return {!jspb.arith.Int64 }
366
+ * @export
346
367
*/
347
368
jspb . arith . Int64 . prototype . add = function ( other ) {
348
369
var lo = ( ( this . lo + other . lo ) & 0xffffffff ) >>> 0 ;
@@ -357,6 +378,7 @@ jspb.arith.Int64.prototype.add = function(other) {
357
378
* Subtract two 64-bit numbers to produce a 64-bit number.
358
379
* @param {!jspb.arith.Int64 } other
359
380
* @return {!jspb.arith.Int64 }
381
+ * @export
360
382
*/
361
383
jspb . arith . Int64 . prototype . sub = function ( other ) {
362
384
var lo = ( ( this . lo - other . lo ) & 0xffffffff ) >>> 0 ;
@@ -370,6 +392,7 @@ jspb.arith.Int64.prototype.sub = function(other) {
370
392
/**
371
393
* Make a copy of the int64.
372
394
* @return {!jspb.arith.Int64 }
395
+ * @export
373
396
*/
374
397
jspb . arith . Int64 . prototype . clone = function ( ) {
375
398
return new jspb . arith . Int64 ( this . lo , this . hi ) ;
@@ -380,6 +403,7 @@ jspb.arith.Int64.prototype.clone = function() {
380
403
* Convert a 64-bit number to a string.
381
404
* @return {string }
382
405
* @override
406
+ * @export
383
407
*/
384
408
jspb . arith . Int64 . prototype . toString = function ( ) {
385
409
// If the number is negative, find its twos-complement inverse.
@@ -396,6 +420,7 @@ jspb.arith.Int64.prototype.toString = function() {
396
420
* Parse a string into a 64-bit number. Returns `null` on a parse error.
397
421
* @param {string } s
398
422
* @return {?jspb.arith.Int64 }
423
+ * @export
399
424
*/
400
425
jspb . arith . Int64 . fromString = function ( s ) {
401
426
var hasNegative = ( s . length > 0 && s [ 0 ] == '-' ) ;
0 commit comments