@@ -32,201 +32,201 @@ using namespace Java::Lang;
3232
3333ByteCache *ByteCache::instance = nullptr ;
3434
35- Bytes::Bytes (byte byteValue) {
35+ Byte::Byte (byte byteValue) {
3636 this ->original = byteValue;
3737 this ->originalString = stringFromInt (this ->original );
3838}
3939
40- Bytes::Bytes (String inputString) {
40+ Byte::Byte (String inputString) {
4141 this ->original = parseByte (inputString, 10 );
4242 this ->originalString = stringFromInt (this ->original );
4343}
4444
45- Bytes::Bytes () {
45+ Byte::Byte () {
4646 this ->original = 0 ;
4747 this ->originalString = stringCopy (" 0" );
4848}
4949
50- Bytes ::~Bytes () {
50+ Byte ::~Byte () {
5151 if (this ->originalString != nullptr ) {
5252 free (this ->originalString );
5353 }
5454}
5555
56- char Bytes ::charValue () const {
56+ char Byte ::charValue () const {
5757 return (char ) this ->original ;
5858}
5959
60- byte Bytes ::byteValue () const {
60+ byte Byte ::byteValue () const {
6161 return this ->original ;
6262}
6363
64- int Bytes ::compare (byte byteA, byte byteB) {
64+ int Byte ::compare (byte byteA, byte byteB) {
6565 return byteA - byteB;
6666}
6767
68- int Bytes ::compareTo (const Bytes &other) const {
68+ int Byte ::compareTo (const Byte &other) const {
6969 return this ->original - other.original ;
7070}
7171
72- Bytes Bytes ::decode (String stringToDecode) {
72+ Byte Byte ::decode (String stringToDecode) {
7373 int value = Integer::decode (stringToDecode).intValue ();
74- if (value < Bytes ::MIN_VALUE || value > Bytes ::MAX_VALUE ) {
74+ if (value < Byte ::MIN_VALUE || value > Byte ::MAX_VALUE ) {
7575 throw NumberFormatException (" out of byte range" );
7676 }
7777 return (byte) value;
7878}
7979
80- double Bytes ::doubleValue () const {
80+ double Byte ::doubleValue () const {
8181 return (double ) this ->original ;
8282}
8383
8484// TODO need instanceof
85- boolean Bytes ::equals (Bytes object) {
86- // boolean isByte = instanceof<Bytes >(object);
85+ boolean Byte ::equals (Byte object) {
86+ // boolean isByte = instanceof<Byte >(object);
8787// if (isByte) {
8888// return this->original == parseByte(object.toString());
8989// }
9090// return false;
9191 return this ->original == parseByte (object.toString ());
9292}
9393
94- float Bytes ::floatValue () const {
94+ float Byte ::floatValue () const {
9595 return (float ) this ->original ;
9696}
9797
98- long Bytes ::hashCode () const {
98+ long Byte ::hashCode () const {
9999 return (long ) this ->original ;
100100}
101101
102- int Bytes ::hashCode (byte value) {
102+ int Byte ::hashCode (byte value) {
103103 return (int ) value;
104104}
105105
106- int Bytes ::intValue () const {
106+ int Byte ::intValue () const {
107107 return (int ) this ->original ;
108108}
109109
110- long Bytes ::longValue () const {
110+ long Byte ::longValue () const {
111111 return (long ) this ->original ;
112112}
113113
114- byte Bytes ::parseByte (String stringToParse) {
114+ byte Byte ::parseByte (String stringToParse) {
115115 return parseByte (stringToParse, 10 );
116116}
117117
118- byte Bytes ::parseByte (String stringToParse, int radix) {
118+ byte Byte ::parseByte (String stringToParse, int radix) {
119119 int value = Integer::parseInt (stringToParse, radix);
120- if (value < Bytes ::MIN_VALUE || value > Bytes ::MAX_VALUE ) {
120+ if (value < Byte ::MIN_VALUE || value > Byte ::MAX_VALUE ) {
121121 throw NumberFormatException (" out of byte range" );
122122 }
123123 return (byte)value;
124124}
125125
126- short Bytes ::shortValue () const {
126+ short Byte ::shortValue () const {
127127 return (short ) this ->original ;
128128}
129129
130- string Bytes ::toString () const {
130+ string Byte ::toString () const {
131131 return this ->originalString ;
132132}
133133
134- String Bytes ::toString (byte byteValue) {
134+ String Byte ::toString (byte byteValue) {
135135 return Integer::toString ((int ) byteValue, 10 );
136136}
137137
138- int Bytes ::toUnsignedInt (byte byteValue) {
138+ int Byte ::toUnsignedInt (byte byteValue) {
139139 return ((int ) byteValue) & 0xff ;
140140}
141141
142- long Bytes ::toUnsignedLong (byte byteValue) {
142+ long Byte ::toUnsignedLong (byte byteValue) {
143143 return ((long ) byteValue) & 0xffL ;
144144}
145145
146- Bytes Bytes ::valueOf (byte byteValue) {
146+ Byte Byte ::valueOf (byte byteValue) {
147147 return ByteCache::getInstance ()->getByteAtIndex ((int ) byteValue);
148148}
149149
150- Bytes Bytes ::valueOf (String stringValue) {
151- return Bytes (parseByte (stringValue));
150+ Byte Byte ::valueOf (String stringValue) {
151+ return Byte (parseByte (stringValue));
152152}
153153
154- Bytes Bytes ::valueOf (String stringValue, int radix) {
155- return Bytes (parseByte (stringValue, radix));
154+ Byte Byte ::valueOf (String stringValue, int radix) {
155+ return Byte (parseByte (stringValue, radix));
156156}
157157
158- Bytes Bytes ::operator +(const Bytes &target) {
158+ Byte Byte ::operator +(const Byte &target) {
159159 return this ->original + target.original ;
160160}
161161
162- Bytes Bytes ::operator -(const Bytes &target) {
162+ Byte Byte ::operator -(const Byte &target) {
163163 return this ->original - target.original ;
164164}
165165
166- Bytes Bytes ::operator /(const Bytes &target) {
166+ Byte Byte ::operator /(const Byte &target) {
167167 if (target.intValue () == 0 ) {
168168 throw ArithmeticException (" Divide by zero" );
169169 }
170170 return this ->original / target.original ;
171171}
172172
173- Bytes Bytes ::operator %(const Bytes &target) {
173+ Byte Byte ::operator %(const Byte &target) {
174174 if (target.intValue () == 0 ) {
175175 throw ArithmeticException (" Divide by zero" );
176176 }
177177 return this ->original % target.original ;
178178}
179179
180- Bytes Bytes ::operator *(const Bytes &target) {
180+ Byte Byte ::operator *(const Byte &target) {
181181 return this ->original * target.original ;
182182}
183183
184- boolean Bytes ::operator ==(const Bytes &target) {
184+ boolean Byte ::operator ==(const Byte &target) {
185185 return this ->original == target.original ;
186186}
187187
188- boolean Bytes ::operator !=(const Bytes &target) {
188+ boolean Byte ::operator !=(const Byte &target) {
189189 return this ->original != target.original ;
190190}
191191
192- boolean Bytes ::operator <(const Bytes &target) {
192+ boolean Byte ::operator <(const Byte &target) {
193193 return this ->original < target.original ;
194194}
195195
196- boolean Bytes ::operator >(const Bytes &target) {
196+ boolean Byte ::operator >(const Byte &target) {
197197 return this ->original > target.original ;
198198}
199199
200- boolean Bytes ::operator <=(const Bytes &target) {
200+ boolean Byte ::operator <=(const Byte &target) {
201201 return this ->original <= target.original ;
202202}
203203
204- boolean Bytes ::operator >=(const Bytes &target) {
204+ boolean Byte ::operator >=(const Byte &target) {
205205 return this ->original >= target.original ;
206206}
207207
208- Bytes &Bytes ::operator -=(const Bytes &target) {
208+ Byte &Byte ::operator -=(const Byte &target) {
209209 free ((this ->originalString ));
210210 this ->original -= target.original ;
211211 this ->originalString = stringFromInt (this ->original );
212212 return *this ;
213213}
214214
215- Bytes &Bytes ::operator +=(const Bytes &target) {
215+ Byte &Byte ::operator +=(const Byte &target) {
216216 free ((this ->originalString ));
217217 this ->original += target.original ;
218218 this ->originalString = stringFromInt (this ->original );
219219 return *this ;
220220}
221221
222- Bytes &Bytes ::operator *=(const Bytes &target) {
222+ Byte &Byte ::operator *=(const Byte &target) {
223223 free ((this ->originalString ));
224224 this ->original *= target.original ;
225225 this ->originalString = stringFromInt (this ->original );
226226 return *this ;
227227}
228228
229- Bytes &Bytes ::operator /=(const Bytes &target) {
229+ Byte &Byte ::operator /=(const Byte &target) {
230230 if (target.intValue () == 0 ) {
231231 throw ArithmeticException (" Divide by zero" );
232232 }
@@ -236,7 +236,7 @@ Bytes &Bytes::operator/=(const Bytes &target) {
236236 return *this ;
237237}
238238
239- Bytes &Bytes ::operator %=(const Bytes &target) {
239+ Byte &Byte ::operator %=(const Byte &target) {
240240 if (target.intValue () == 0 ) {
241241 throw ArithmeticException (" Divide by zero" );
242242 }
@@ -246,14 +246,14 @@ Bytes &Bytes::operator%=(const Bytes &target) {
246246 return *this ;
247247}
248248
249- Bytes &Bytes ::operator =(const Bytes &target) {
249+ Byte &Byte ::operator =(const Byte &target) {
250250 free ((this ->originalString ));
251251 this ->original = target.original ;
252252 this ->originalString = stringFromInt (this ->original );
253253 return *this ;
254254}
255255
256- Bytes::Bytes (const Bytes &anotherBytes ) {
257- this ->original = anotherBytes .original ;
256+ Byte::Byte (const Byte &anotherByte ) {
257+ this ->original = anotherByte .original ;
258258 this ->originalString = stringFromInt (this ->original );
259259}
0 commit comments