[Pocketgames-devel] SF.net SVN: pocketgames: [228] libraries/unsigned/src/org/pocketgames/ unsigned
Status: Beta
Brought to you by:
idominguez
|
From: <ido...@us...> - 2008-01-12 12:59:10
|
Revision: 228
http://pocketgames.svn.sourceforge.net/pocketgames/?rev=228&view=rev
Author: idominguez
Date: 2008-01-12 04:59:15 -0800 (Sat, 12 Jan 2008)
Log Message:
-----------
Style changes
Modified Paths:
--------------
libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java
Modified: libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java
===================================================================
--- libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java 2008-01-12 12:58:50 UTC (rev 227)
+++ libraries/unsigned/src/org/pocketgames/unsigned/UnsignedByte.java 2008-01-12 12:59:15 UTC (rev 228)
@@ -34,19 +34,19 @@
* A constant holding the maximum value an <code>unsigned byte</code> can
* have, 2^8.
*/
- public static int MAX_VALUE = 256;
+ public static final int MAX_VALUE = 256;
/**
* A constant holding the minimum value an <code>unsigned byte</code> can
* have, 0.
*/
- public static int MIN_VALUE = 0;
+ public static final int MIN_VALUE = 0;
/**
* The number of bits used to represent an <code>UnsignedByte</code> value
* in two's complement binary form.
*/
- public static int SIZE = Short.SIZE;
+ public static final int SIZE = Short.SIZE;
/**
* The value stored in this UnsignedByte.
@@ -63,11 +63,13 @@
public UnsignedByte (byte b)
{
if (b >= 0)
+ {
this.val = (short) b;
+ }
else
{
short l = (short) b;
- short max = (short)(Math.pow(2,8));
+ short max = (short) (Math.pow(2, 8));
this.val = (short) (l + max);
}
}
@@ -80,7 +82,7 @@
public UnsignedByte (short s)
throws IllegalArgumentException
{
- if (s < MIN_VALUE || s >= MAX_VALUE)
+ if ((s < MIN_VALUE) || (s >= MAX_VALUE))
throw new IllegalArgumentException();
else
this.val = s;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|