diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
commit | df9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch) | |
tree | 239ae276b82024b140428e6c0fe5d739fdd686a4 /src/java/com/jogamp/common/util/IntBitfield.java | |
parent | eb47aaba63e3b1bf55f274a0f338f1010a017ae4 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/java/com/jogamp/common/util/IntBitfield.java')
-rw-r--r-- | src/java/com/jogamp/common/util/IntBitfield.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/java/com/jogamp/common/util/IntBitfield.java b/src/java/com/jogamp/common/util/IntBitfield.java index 2d2f1ef..74e37ac 100644 --- a/src/java/com/jogamp/common/util/IntBitfield.java +++ b/src/java/com/jogamp/common/util/IntBitfield.java @@ -50,7 +50,7 @@ public class IntBitfield { /** * @param bitCount */ - public IntBitfield(long bitCount) { + public IntBitfield(final long bitCount) { final int units = (int) Math.max(1L, ( bitCount + 7L ) >>> UNIT_SHIFT_L); this.storage = new int[units]; this.bitsCountL = (long)units << UNIT_SHIFT_L ; @@ -60,19 +60,19 @@ public class IntBitfield { /** * @param bitCount */ - public IntBitfield(int bitCount) { + public IntBitfield(final int bitCount) { final int units = Math.max(1, ( bitCount + 7 ) >>> UNIT_SHIFT_I); this.storage = new int[units]; this.bitsCountI = units << UNIT_SHIFT_I; this.bitsCountL = bitsCountI; } - private final void check(long bitnum) { + private final void check(final long bitnum) { if( 0 > bitnum || bitnum >= bitsCountL ) { throw new ArrayIndexOutOfBoundsException("Bitnum should be within [0.."+(bitsCountL-1)+"], but is "+bitnum); } } - private final void check(int bitnum) { + private final void check(final int bitnum) { if( 0 > bitnum || bitnum >= bitsCountI ) { throw new ArrayIndexOutOfBoundsException("Bitnum should be within [0.."+(bitsCountI-1)+"], but is "+bitnum); } @@ -82,7 +82,7 @@ public class IntBitfield { public final long capacity() { return bitsCountL; } /** Return <code>true</code> if the bit at position <code>bitnum</code> is set, otherwise <code>false</code>. */ - public final boolean get(long bitnum) { + public final boolean get(final long bitnum) { check(bitnum); final int u = (int) ( bitnum >>> UNIT_SHIFT_L ); final int b = (int) ( bitnum - ( (long)u << UNIT_SHIFT_L ) ); @@ -90,7 +90,7 @@ public class IntBitfield { } /** Return <code>true</code> if the bit at position <code>bitnum</code> is set, otherwise <code>false</code>. */ - public final boolean get(int bitnum) { + public final boolean get(final int bitnum) { check(bitnum); final int u = bitnum >>> UNIT_SHIFT_I; final int b = bitnum - ( u << UNIT_SHIFT_I ); @@ -101,7 +101,7 @@ public class IntBitfield { * Set or clear the bit at position <code>bitnum</code> according to <code>bit</code> * and return the previous value. */ - public final boolean put(long bitnum, boolean bit) { + public final boolean put(final long bitnum, final boolean bit) { check(bitnum); final int u = (int) ( bitnum >>> UNIT_SHIFT_L ); final int b = (int) ( bitnum - ( (long)u << UNIT_SHIFT_L ) ); @@ -121,7 +121,7 @@ public class IntBitfield { * Set or clear the bit at position <code>bitnum</code> according to <code>bit</code> * and return the previous value. */ - public final boolean put(int bitnum, boolean bit) { + public final boolean put(final int bitnum, final boolean bit) { check(bitnum); final int u = bitnum >>> UNIT_SHIFT_I; final int b = bitnum - ( u << UNIT_SHIFT_I ); |