SynSoft Java Standard Library

synsoft.org


org.synsoft.base.logic
Class Bits

java.lang.Object
  |
  +--org.synsoft.base.logic.Bits

public class Bits
extends java.lang.Object

This class provides a number of simple bit manipulation utility functions.


Field Summary
static Version scm_version
          Constant instance of version information for class.
 
Method Summary
static int addBits(int value, int add)
          Adds bits to a value
static boolean areAllBitsSet(int value, int flags)
          Returns true iff all bits stipulated in flags are set in value.
static boolean areAnyBitsSet(int value, int flags)
          Returns true if any bits stipulated in flags are set in value.
static int modifyBits(int value, int remove, int add)
          Modifies the bits in a value
static int removeBits(int value, int remove)
          Removes bits in a value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scm_version

public static final Version scm_version
Constant instance of version information for class.
Method Detail

areAllBitsSet

public static final boolean areAllBitsSet(int value,
                                          int flags)
Returns true iff all bits stipulated in flags are set in value.
Parameters:
value - The value against which to test the flags
flags - The flag(s) with which to test the value

areAnyBitsSet

public static final boolean areAnyBitsSet(int value,
                                          int flags)
Returns true if any bits stipulated in flags are set in value.
Parameters:
value - The value against which to test the flags
flags - The flag(s) with which to test the value

modifyBits

public static final int modifyBits(int value,
                                   int remove,
                                   int add)
Modifies the bits in a value
Parameters:
value - The value to modify
remove - The bit values to remove from value
add - The bit values to add to value

removeBits

public static final int removeBits(int value,
                                   int remove)
Removes bits in a value
Parameters:
value - The value to modify
remove - The bit values to remove from value

addBits

public static final int addBits(int value,
                                int add)
Adds bits to a value
Parameters:
value - The value to modify
add - The bit values to add to value

version 2.0.1.231

Copyright © Synesis Software. Licensed according to the Synesis Software Standard Public License