Added files and folders for TARGET_JVM code base
[mono.git] / mcs / class / System.Data / System.Data.SqlTypes.jvm / SqlByte.cs
1  /*\r
2   * Copyright (c) 2002-2004 Mainsoft Corporation.\r
3   *\r
4   * Permission is hereby granted, free of charge, to any person obtaining a\r
5   * copy of this software and associated documentation files (the "Software"),\r
6   * to deal in the Software without restriction, including without limitation\r
7   * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
8   * and/or sell copies of the Software, and to permit persons to whom the\r
9   * Software is furnished to do so, subject to the following conditions:\r
10   *\r
11   * The above copyright notice and this permission notice shall be included in\r
12   * all copies or substantial portions of the Software.\r
13   *\r
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
19   * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
20   * DEALINGS IN THE SOFTWARE.\r
21   */\r
22 namespace System.Data.SqlTypes\r
23 {\r
24 \r
25     using System;\r
26     using System.Data;\r
27 \r
28     /**\r
29      *\r
30      */\r
31     public struct SqlByte : INullable, IComparable\r
32     {\r
33         private byte _value; // = -1;\r
34         private bool _isNull;\r
35 \r
36         public static readonly SqlByte MaxValue = new SqlByte((byte)0xFF);\r
37         public static readonly SqlByte MinValue = new SqlByte((byte)0);\r
38         public static readonly SqlByte Zero = new SqlByte((byte)0);\r
39         public static readonly SqlByte Null = new SqlByte(true);\r
40 \r
41         \r
42         private SqlByte(bool isNull)\r
43         {\r
44             _isNull = isNull;\r
45             _value = 0;\r
46         }\r
47         /**\r
48          * Initializes a new instance of the SqlByte instance using the specified byte value.\r
49          * @param value A byte value to be stored in the Value property of the new SqlByte instance.\r
50          */\r
51         public SqlByte(byte value)\r
52         {\r
53             _value = value;\r
54             _isNull = false;\r
55         }\r
56 \r
57 \r
58         public override int GetHashCode()\r
59         {\r
60             if (IsNull)\r
61                 return 0;\r
62         \r
63             return _value;\r
64         }\r
65 \r
66         /**\r
67          * Indicates whether or not Value is null.\r
68          * @return true if Value is null, otherwise false.\r
69          */\r
70         public bool IsNull\r
71         {\r
72             get\r
73             {\r
74                 return _isNull;\r
75             }\r
76         }\r
77 \r
78         /**\r
79          * Gets the value of the SqlByte instance.\r
80          * @return the value of this instance\r
81          */\r
82         public byte Value\r
83         {\r
84             get\r
85             {\r
86                 if (IsNull)\r
87                 {\r
88                     throw new SqlNullValueException();\r
89                 }\r
90 \r
91                 return _value;\r
92             }\r
93         }\r
94 \r
95         /**\r
96          * Computes the sum of the two specified SqlByte instances.\r
97          * @param x A SqlByte instance.\r
98          * @param y A SqlByte instance.\r
99          * @return A SqlByte instance whose Value property contains the results of the addition.\r
100          */\r
101         public static SqlByte Add(SqlByte x, SqlByte y)\r
102         {\r
103             if (x.IsNull || y.IsNull)\r
104                 return SqlByte.Null;\r
105 \r
106             int res  = x._value + y._value;\r
107 \r
108             if (res > 255)\r
109                 throw new OverflowException("Arithmetic Overflow");\r
110 \r
111             return new SqlByte((byte)res);\r
112         }\r
113 \r
114         /**\r
115          * Computes the bitwise AND of its SqlByte operands.\r
116          * @param x A SqlByte instance.\r
117          * @param y A SqlByte instance.\r
118          * @return The results of the bitwise AND operation.\r
119          */\r
120         public static SqlByte BitwiseAnd(SqlByte x, SqlByte y)\r
121         {\r
122             if (x.IsNull || y.IsNull)\r
123                 return SqlByte.Null;\r
124 \r
125             int res  = x._value & y._value;\r
126             return new SqlByte((byte)res);\r
127         }\r
128 \r
129         /**\r
130          * Computes the bitwise OR of its SqlByte operands.\r
131          * @param x A SqlByte instance.\r
132          * @param y A SqlByte instance.\r
133          * @return The results of the bitwise OR operation.\r
134          */\r
135         public static SqlByte BitwiseOr(SqlByte x, SqlByte y)\r
136         {\r
137             if (x.IsNull || y.IsNull)\r
138                 return SqlByte.Null;\r
139 \r
140             int res  = x._value | y._value;\r
141             return new SqlByte((byte)res);\r
142         }\r
143 \r
144         /**\r
145          * Compares this instance to the supplied object and returns an indication of their relative values.\r
146          * @param obj The object to compare.\r
147          * @return A signed number indicating the relative values of the instance and the object.\r
148          * Less than zero This instance is less than object.\r
149          * Zero This instance is the same as object.\r
150          * Greater than zero This instance is greater than object -or-\r
151          * object is a null reference.\r
152          */\r
153         public int CompareTo(Object obj)\r
154         {\r
155             if (obj == null)\r
156                 return 1;\r
157 \r
158             if ((obj is SqlByte) == false)\r
159             {\r
160                 throw new ArgumentException("Wrong value type " + \r
161                     obj.GetType().Name + "in SqlByte.CompareTo");\r
162             }\r
163 \r
164             SqlByte val = (SqlByte)obj;\r
165 \r
166             if (IsNull)\r
167             {\r
168                 if (val.IsNull)\r
169                     return 0;\r
170                 return -1;\r
171             }\r
172             else if (val.IsNull)\r
173                 return 1;\r
174 \r
175             if (_value > val._value)\r
176                 return 1;\r
177 \r
178             if (_value < val._value)\r
179                 return -1;\r
180 \r
181             return 0;\r
182         }\r
183 \r
184 \r
185         /**\r
186          * The division operator divides the first SqlByte operand by the second.\r
187          * @param x A SqlByte instance.\r
188          * @param y A SqlByte instance.\r
189          * @return A SqlByte instance containing the results of the division operation.\r
190          * If one of the parameters is null or null value - return SqlDouble.Null.\r
191          */\r
192         public static SqlByte Divide(SqlByte x, SqlByte y)\r
193         {\r
194             if (x.IsNull || y.IsNull)\r
195                 return SqlByte.Null;\r
196 \r
197             if (y._value == 0)\r
198                 throw new DivideByZeroException("Divide by zero error encountered.");\r
199 \r
200             int val = x._value / y._value;\r
201             return new SqlByte((byte)val);\r
202         }\r
203 \r
204         public override bool Equals(Object obj)\r
205         {\r
206             if (obj == null)\r
207                 return false;\r
208 \r
209             if (obj is SqlByte)\r
210             {\r
211                 if (((SqlByte)obj)._value == this._value)\r
212                     return true;\r
213             }\r
214 \r
215             return false;\r
216         }\r
217 \r
218         /**\r
219          * Performs a logical comparison on two instances of SqlByte to determine if they are equal.\r
220          * @param x A SqlByte instance.\r
221          * @param y A SqlByte instance.\r
222          * @return true if the two values are equal, otherwise false.\r
223          * If one of the parameters is null or null value return SqlBoolean.Null.\r
224          */\r
225         public static SqlBoolean Equals(SqlByte x, SqlByte y)\r
226         {\r
227             if (x.IsNull || y.IsNull)\r
228                 return SqlBoolean.Null;\r
229 \r
230             if (x._value == y._value)\r
231                 return SqlBoolean.True;\r
232 \r
233             return SqlBoolean.False;\r
234         }\r
235 \r
236         /**\r
237          * Compares two instances of SqlByte to determine if the first is greater than the second.\r
238          * @param x A SqlByte instance\r
239          * @param y A SqlByte instance\r
240          * @return A SqlBoolean that is True if the first instance is greater than the second instance, otherwise False.\r
241          * If either instance of SqlByte is null, the Value of the SqlBoolean will be Null.\r
242          */\r
243         public static SqlBoolean GreaterThan(SqlByte x, SqlByte y)\r
244         {\r
245             if (x.IsNull || y.IsNull)\r
246                 return SqlBoolean.Null;\r
247 \r
248             if (x._value > y._value)\r
249                 return SqlBoolean.True;\r
250 \r
251             return SqlBoolean.False;\r
252         }\r
253 \r
254         /**\r
255          * Compares two instances of SqlByte to determine if the first is greater than or equal to the second.\r
256          * @param x A SqlByte instance\r
257          * @param y A SqlByte instance\r
258          * @return A SqlBoolean that is True if the first instance is greaater than or equal to the second instance, otherwise False.\r
259          * If either instance of SqlByte is null, the Value of the SqlBoolean will be Null.\r
260          */\r
261         public static SqlBoolean GreaterThanOrEqual(SqlByte x, SqlByte y)\r
262         {\r
263             if (x.IsNull || y.IsNull)\r
264                 return SqlBoolean.Null;\r
265 \r
266             if (x._value >= y._value)\r
267                 return SqlBoolean.True;\r
268 \r
269             return SqlBoolean.False;\r
270         }\r
271 \r
272         /**\r
273          * Compares two instances of SqlByte to determine if the first is less than the second.\r
274          * @param x A SqlByte instance\r
275          * @param y A SqlByte instance\r
276          * @return A SqlBoolean that is True if the first instance is less than the second instance, otherwise False.\r
277          * If either instance of SqlByte is null, the Value of the SqlBoolean will be Null.\r
278          */\r
279         public static SqlBoolean LessThan(SqlByte x, SqlByte y)\r
280         {\r
281             if (x.IsNull || y.IsNull)\r
282                 return SqlBoolean.Null;\r
283 \r
284             if (x._value < y._value)\r
285                 return SqlBoolean.True;\r
286 \r
287             return SqlBoolean.False;\r
288         }\r
289 \r
290         /**\r
291          * Compares two instances of SqlByte to determine if the first is less than or equal to the second.\r
292          * @param x A SqlByte instance\r
293          * @param y A SqlByte instance\r
294          * @return A SqlBoolean that is True if the first instance is less than or equal to the second instance, otherwise False.\r
295          * If either instance of SqlByte is null, the Value of the SqlBoolean will be Null.\r
296          */\r
297         public static SqlBoolean LessThanOrEqual(SqlByte x, SqlByte y)\r
298         {\r
299             if (x.IsNull || y.IsNull)\r
300                 return SqlBoolean.Null;\r
301 \r
302             if (x._value <= y._value)\r
303                 return SqlBoolean.True;\r
304 \r
305             return SqlBoolean.False;\r
306         }\r
307 \r
308         /**\r
309          * Computes the remainder after dividing its first SqlByte operand by its second.\r
310          * @param x A SqlByte instance\r
311          * @param y A SqlByte instance\r
312          * @return A SqlByte instance whose Value contains the remainder.\r
313          */\r
314         public static SqlByte Mod(SqlByte x, SqlByte y)\r
315         {\r
316             if (x.IsNull || y.IsNull)\r
317                 return SqlByte.Null;\r
318 \r
319             if (y._value == 0)\r
320                 throw new DivideByZeroException("Divide by zero error encountered.");\r
321 \r
322             int mod = x._value % y._value;\r
323             return new SqlByte((byte)mod);\r
324         }\r
325 \r
326         /**\r
327          * The multiplication operator computes the product of the two SqlByte operands.\r
328          * @param x A SqlByte instance\r
329          * @param y A SqlByte instance\r
330          * @return The product of the two SqlByte operands.\r
331          */\r
332         public static SqlByte Multiply(SqlByte x, SqlByte y)\r
333         {\r
334             if (x.IsNull || y.IsNull)\r
335                 return SqlByte.Null;\r
336 \r
337             int res = x._value * y._value;\r
338 \r
339             if (res > 255)\r
340                 throw new OverflowException("Arithmetic Overflow.");\r
341 \r
342             return new SqlByte((byte)res);\r
343         }\r
344 \r
345         /**\r
346          * Compares two instances of SqlByte to determine if they are equal.\r
347          * @param x A SqlByte instance\r
348          * @param y A SqlByte instance\r
349          * @return A SqlBoolean that is True if the two instances are not equal or False if the two instances are equal.\r
350          * If either instance of SqlByte is null, the Value of the SqlBoolean will be Null.\r
351          */\r
352         public static SqlBoolean NotEquals(SqlByte x, SqlByte y)\r
353         {\r
354             if (x.IsNull || y.IsNull)\r
355                 return SqlBoolean.Null;\r
356 \r
357             if (x._value != y._value)\r
358                 return SqlBoolean.True;\r
359 \r
360             return SqlBoolean.False;\r
361         }\r
362 \r
363         /**\r
364          * The ones complement operator performs a bitwise one's complement operation on its SqlByte operand.\r
365          * @param x A SqlByte instance\r
366          * @return A SqlByte instance whose Value property contains the ones complement of the SqlByte parameter.\r
367          */\r
368         public static SqlByte OnesComplement(SqlByte x)\r
369         {\r
370             if (x.IsNull)\r
371                 return SqlByte.Null;\r
372 \r
373             int res  = x._value ^ 0xFF; /*@TODO Ma ze ??? */\r
374 \r
375             return new SqlByte((byte)res);\r
376         }\r
377 \r
378         /**\r
379          * Converts the String representation of a number to its byte equivalent.\r
380          * @param s The String to be parsed.\r
381          * @return A SqlByte containing the value represented by the String.\r
382          */\r
383         public static SqlByte Parse(String s)\r
384         {\r
385             byte val = byte.Parse(s);\r
386             return new SqlByte(val);\r
387         }\r
388 \r
389         /**\r
390          * The subtraction operator the second SqlByte operand from the first.\r
391          * @param x A SqlByte instance\r
392          * @param y A SqlByte instance\r
393          * @return The results of the subtraction operation.\r
394          */\r
395         public static SqlByte Subtract(SqlByte x, SqlByte y)\r
396         {\r
397             if (x.IsNull || y.IsNull)\r
398                 return SqlByte.Null;\r
399 \r
400             int res = x._value - y._value;\r
401 \r
402             if (res < 0)\r
403                 throw new OverflowException("Arithmetic Overflow.");\r
404 \r
405             return new SqlByte((byte)res);\r
406         }\r
407 \r
408 \r
409         /**\r
410          * Converts this SqlByte instance to SqlBoolean.\r
411          * @return A SqlBoolean instance whose Value will be True if the SqlByte instance's Value is non-zero,\r
412          * False if the SqlByte is zero\r
413          * and Null if the SqlByte instance is Null.\r
414          */\r
415         public SqlBoolean ToSqlBoolean()\r
416         {\r
417             if (IsNull)\r
418                 return SqlBoolean.Null;\r
419 \r
420             return new SqlBoolean(Value);\r
421         }\r
422 \r
423         /**\r
424          * Converts this SqlByte instance to SqlDecimal.\r
425          * @return A SqlDecimal instance whose Value equals the Value of this SqlByte instance.\r
426          */\r
427         public SqlDecimal ToSqlDecimal()\r
428         {\r
429             if (IsNull)\r
430                 return SqlDecimal.Null;\r
431 \r
432             return new SqlDecimal(Value);\r
433         }\r
434 \r
435         /**\r
436          * Converts this SqlByte instance to SqlDouble.\r
437          * @return A SqlDouble instance whose Value equals the Value of this SqlByte instance.\r
438          */\r
439         public SqlDouble ToSqlDouble()\r
440         {\r
441             if (IsNull)\r
442                 return SqlDouble.Null;\r
443 \r
444             return new SqlDouble(Value);\r
445         }\r
446 \r
447         /**\r
448          * Converts this SqlByte instance to SqlSingle.\r
449          * @return A SqlSingle instance whose Value equals the Value of this SqlByte instance.\r
450          */\r
451         public SqlSingle ToSqlSingle()\r
452         {\r
453             if (IsNull)\r
454                 return SqlSingle.Null;\r
455 \r
456             return new SqlSingle(Value);\r
457         }\r
458 \r
459         /**\r
460          * Converts this SqlByte structure to SqlInt32.\r
461          * @return A SqlInt32 structure whose Value equals the Value of this SqlByte structure.\r
462          */\r
463         public SqlInt32 ToSqlInt32()\r
464         {\r
465             if (IsNull)\r
466                 return SqlInt32.Null;\r
467 \r
468             return new SqlInt32(Value);\r
469         }\r
470 \r
471         /**\r
472          * Converts this SqlByte structure to SqlInt32.\r
473          * @return A SqlInt32 structure whose Value equals the Value of this SqlByte structure.\r
474          */\r
475         public SqlInt64 ToSqlInt64()\r
476         {\r
477             if (IsNull)\r
478                 return SqlInt64.Null;\r
479 \r
480             return new SqlInt64(Value);\r
481         }\r
482 \r
483         /**\r
484          * Converts this SqlByte structure to SqlInt16.\r
485          * @return A SqlInt16 structure whose Value equals the Value of this SqlByte structure.\r
486          */\r
487         public SqlInt16 ToSqlInt16()\r
488         {\r
489             if (IsNull)\r
490                 return SqlInt16.Null;\r
491 \r
492             return new SqlInt16(Value);\r
493         }\r
494 \r
495         /**\r
496          * Converts this SqlByte instance to SqlDecimal.\r
497          * @return A SqlDecimal instance whose Value equals the Value of this SqlByte instance.\r
498          */\r
499         public SqlMoney ToSqlMoney()\r
500         {\r
501             if (IsNull)\r
502                 return SqlMoney.Null;\r
503 \r
504             return new SqlMoney(Value);\r
505         }\r
506 \r
507         /**\r
508          * Converts this SqlByte structure to SqlString.\r
509          * @return A SqlString structure whose value is a string representing the date and time contained in this SqlByte structure.\r
510          */\r
511         public SqlString ToSqlString()\r
512         {\r
513             if (IsNull)\r
514                 return SqlString.Null;\r
515 \r
516             return new SqlString(_value.ToString());\r
517         }\r
518 \r
519         /**\r
520          * Performs a bitwise exclusive-OR operation on the supplied parameters.\r
521          * @param x A SqlByte instance\r
522          * @param y A SqlByte instance\r
523          * @return The results of the XOR operation.\r
524          */\r
525         public static SqlByte Xor(SqlByte x, SqlByte y)\r
526         {\r
527             if (x.IsNull || y.IsNull)\r
528                 return SqlByte.Null;\r
529 \r
530             int res  = x._value ^ y._value;\r
531 \r
532             return new SqlByte((byte)res);\r
533         }\r
534 \r
535         public override String ToString()\r
536         {\r
537             if (IsNull)\r
538                 return "null";\r
539 \r
540             return _value.ToString();\r
541         }\r
542 \r
543         public static SqlByte op_Implicit(byte x)\r
544         {\r
545             return new SqlByte(x);\r
546         }\r
547 \r
548         public static int op_Explicit(SqlByte x)\r
549         {\r
550             return x.Value;\r
551         }\r
552 \r
553         public static SqlByte op_OnesComplement(SqlByte x)\r
554         {\r
555             return OnesComplement(x);\r
556         }\r
557 \r
558         public static SqlByte op_Addition(SqlByte x, SqlByte y)\r
559         {\r
560             return Add(x, y);\r
561         }\r
562 \r
563         public static SqlByte op_Subtraction(SqlByte x, SqlByte y)\r
564         {\r
565             return Subtract(x, y);\r
566         }\r
567 \r
568         public static SqlByte op_Multiply(SqlByte x, SqlByte y)\r
569         {\r
570             return Multiply(x, y);\r
571         }\r
572 \r
573         public static SqlByte op_Division(SqlByte x, SqlByte y)\r
574         {\r
575             return Divide(x, y);\r
576         }\r
577 \r
578         public static SqlByte op_Modulus(SqlByte x, SqlByte y)\r
579         {\r
580             return Mod(x, y);\r
581         }\r
582 \r
583         public static SqlByte op_BitwiseAnd(SqlByte x, SqlByte y)\r
584         {\r
585             return BitwiseAnd(x, y);\r
586         }\r
587 \r
588         public static SqlByte op_BitwiseOr(SqlByte x, SqlByte y)\r
589         {\r
590             return BitwiseOr(x, y);\r
591         }\r
592 \r
593         public static SqlByte op_ExclusiveOr(SqlByte x, SqlByte y)\r
594         {\r
595             return Xor(x, y);\r
596         }\r
597 \r
598         public static SqlByte op_Explicit(SqlBoolean x)\r
599         {\r
600             if(x.IsNull)\r
601                 return SqlByte.Null;\r
602 \r
603             return new SqlByte((byte)x.ByteValue);\r
604         }\r
605 \r
606         public static SqlByte op_Explicit(SqlMoney x)\r
607         {\r
608             if(x.IsNull)\r
609                 return SqlByte.Null;\r
610 \r
611             int val = x.ToSqlInt32().Value;\r
612             if (val < 0 || val > 255)\r
613                 throw new OverflowException("Arithmetic Overflow.");\r
614 \r
615             return new SqlByte((byte)val);\r
616         }\r
617 \r
618         public static SqlByte op_Explicit(SqlInt16 x)\r
619         {\r
620             if(x.IsNull)\r
621                 return SqlByte.Null;\r
622 \r
623             short val = x.Value;\r
624             if (val < 0 || val > 255)\r
625                 throw new OverflowException("Arithmetic Overflow.");\r
626 \r
627             return new SqlByte((byte)val);\r
628         }\r
629 \r
630         public static SqlByte op_Explicit(SqlInt32 x)\r
631         {\r
632             if(x.IsNull)\r
633                 return SqlByte.Null;\r
634 \r
635             int val = x.Value;\r
636             if (val < 0 || val > 255)\r
637                 throw new OverflowException("Arithmetic Overflow.");\r
638 \r
639             return new SqlByte((byte)val);\r
640         }\r
641 \r
642         public static SqlByte op_Explicit(SqlInt64 x)\r
643         {\r
644             if(x.IsNull)\r
645                 return SqlByte.Null;\r
646 \r
647             long val = x.Value;\r
648             if (val < 0 || val > 255)\r
649                 throw new OverflowException("Arithmetic Overflow.");\r
650 \r
651             return new SqlByte((byte)val);\r
652         }\r
653 \r
654         public static SqlByte op_Explicit(SqlSingle x)\r
655         {\r
656             if(x.IsNull)\r
657                 return SqlByte.Null;\r
658 \r
659             float val = x.Value;\r
660             if (val < 0 || val > 255)\r
661                 throw new OverflowException("Arithmetic Overflow.");\r
662 \r
663             return new SqlByte((byte)val);\r
664         }\r
665 \r
666         public static SqlByte op_Explicit(SqlDouble x)\r
667         {\r
668             if(x.IsNull)\r
669                 return SqlByte.Null;\r
670 \r
671             double val = x.Value;\r
672             if (val < 0 || val > 255)\r
673                 throw new OverflowException("Arithmetic Overflow.");\r
674 \r
675             return new SqlByte((byte)val);\r
676         }\r
677 \r
678         public static SqlByte op_Explicit(SqlDecimal x)\r
679         {\r
680             if(x.IsNull)\r
681                 return SqlByte.Null;\r
682 \r
683             double val = x.ToDouble();\r
684             if (val < 0 || val > 255)\r
685                 throw new OverflowException("Arithmetic Overflow.");\r
686 \r
687             return new SqlByte((byte)val);\r
688         }\r
689 \r
690         public static SqlByte op_Explicit(SqlString x)\r
691         {\r
692             if (x.IsNull)\r
693                 return SqlByte.Null;\r
694 \r
695             return Parse(x.Value);\r
696         }\r
697 \r
698         public static SqlBoolean op_Equality(SqlByte x, SqlByte y)\r
699         {\r
700             return Equals(x, y);\r
701         }\r
702 \r
703         public static SqlBoolean op_Inequality(SqlByte x, SqlByte y)\r
704         {\r
705             return NotEquals(x, y);\r
706         }\r
707 \r
708         public static SqlBoolean op_LessThan(SqlByte x, SqlByte y)\r
709         {\r
710             return LessThan(x, y);\r
711         }\r
712 \r
713         public static SqlBoolean op_GreaterThan(SqlByte x, SqlByte y)\r
714         {\r
715             return GreaterThan(x, y);\r
716         }\r
717 \r
718         public static SqlBoolean op_LessThanOrEqual(SqlByte x, SqlByte y)\r
719         {\r
720             return LessThanOrEqual(x, y);\r
721         }\r
722 \r
723         public static SqlBoolean op_GreaterThanOrEqual(SqlByte x, SqlByte y)\r
724         {\r
725             return GreaterThanOrEqual(x, y);\r
726         }\r
727 \r
728         public static void main(String[] args)\r
729         {\r
730             SqlByte b = new SqlByte((byte)1);\r
731             Console.WriteLine(b);\r
732 \r
733             Console.WriteLine(OnesComplement(b));\r
734         }\r
735     }}\r