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