@Test public void testGetBitIndexOk() { assertEquals( 8, getBitIndex( 256 ) ); assertEquals( 7, getBitIndex( 128 ) ); assertEquals( 6, getBitIndex( 64 ) ); assertEquals( 5, getBitIndex( 32 ) ); assertEquals( 4, getBitIndex( 16 ) ); assertEquals( 3, getBitIndex( 8 ) ); assertEquals( 2, getBitIndex( 4 ) ); assertEquals( 1, getBitIndex( 2 ) ); assertEquals( 0, getBitIndex( 1 ) ); assertEquals( 1, getBitIndex( 3 ) ); assertEquals( 2, getBitIndex( 5 ) ); assertEquals( 2, getBitIndex( 6 ) ); assertEquals( 2, getBitIndex( 7 ) ); assertEquals( 3, getBitIndex( 9 ) ); }
public static int getBitIndex( final int aMaskValue ) { return ( int )Math.floor( Math.log( aMaskValue ) / Math.log( 2 ) ); }
NumberUtils { public static int getBitIndex( final int aMaskValue ) { return ( int )Math.floor( Math.log( aMaskValue ) / Math.log( 2 ) ); } }
NumberUtils { public static int getBitIndex( final int aMaskValue ) { return ( int )Math.floor( Math.log( aMaskValue ) / Math.log( 2 ) ); } private  NumberUtils(); }
NumberUtils { public static int getBitIndex( final int aMaskValue ) { return ( int )Math.floor( Math.log( aMaskValue ) / Math.log( 2 ) ); } private  NumberUtils(); static int convertBitOrder( final int aValue, final int aBitCount, final BitOrder aBitOrder ); static int convertByteOrder( final int aValue, final int aByteCount, final ByteOrder aByteOrder ); static Comparator<T> createNumberComparator( final boolean aSortAscending ); static int getBitIndex( final int aMaskValue ); static int getBitMask( final int aBitCount ); static int getPercentage( final int aValue, final int aRange ); static int getPercentage( final int aValue, final int aLowerBound, final int aUpperBound ); static int getPercentage( final long aValue, final long aRange ); static int getPercentage( final long aValue, final long aLowerBound, final long aUpperBound ); static boolean isPowerOfTwo( final int aValue ); static int packBytes( final int aValue ); static int reverseBits( final int aValue, final int aBitCount ); static int safeParseInt( final String aText ); static int safeParseInt( final String aText, final int aDefault ); static long safeParseLong( final String aText ); static long safeParseLong( final String aText, final long aDefault ); static int smartParseInt( final String aText ); static int smartParseInt( final String aText, final int aDefault ); static int smartParseInt( final String aText, final UnitDefinition aUnitDefinition ); static int smartParseInt( final String aText, final UnitDefinition aUnitDefinition, final int aDefault ); }
NumberUtils { public static int getBitIndex( final int aMaskValue ) { return ( int )Math.floor( Math.log( aMaskValue ) / Math.log( 2 ) ); } private  NumberUtils(); static int convertBitOrder( final int aValue, final int aBitCount, final BitOrder aBitOrder ); static int convertByteOrder( final int aValue, final int aByteCount, final ByteOrder aByteOrder ); static Comparator<T> createNumberComparator( final boolean aSortAscending ); static int getBitIndex( final int aMaskValue ); static int getBitMask( final int aBitCount ); static int getPercentage( final int aValue, final int aRange ); static int getPercentage( final int aValue, final int aLowerBound, final int aUpperBound ); static int getPercentage( final long aValue, final long aRange ); static int getPercentage( final long aValue, final long aLowerBound, final long aUpperBound ); static boolean isPowerOfTwo( final int aValue ); static int packBytes( final int aValue ); static int reverseBits( final int aValue, final int aBitCount ); static int safeParseInt( final String aText ); static int safeParseInt( final String aText, final int aDefault ); static long safeParseLong( final String aText ); static long safeParseLong( final String aText, final long aDefault ); static int smartParseInt( final String aText ); static int smartParseInt( final String aText, final int aDefault ); static int smartParseInt( final String aText, final UnitDefinition aUnitDefinition ); static int smartParseInt( final String aText, final UnitDefinition aUnitDefinition, final int aDefault );  }