Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package org.litesoft.core.typeutils;

public class Bits
{
    /**
     * Calculate the new "AccumulatedBitFlags" by Overriding the appropriate bit flags in
     * pPreviousAccumulatedBitFlags (based on the bits in pValidBitsOfNewBitFlags) from the pNewBitFlags.
     *
     * @param pPreviousAccumulatedBitFlags Bit Flags to be selectively overriden.
     * @param pValidBitsOfNewBitFlags      The '1' bits will indicate which bids to override.
     * @param pNewBitFlags                 The source of the override Bit Flags.
     *
     * @return The new "AccumulatedBitFlags".
     */
    public static int mutateAccumulatedBitFlags( int pPreviousAccumulatedBitFlags, int pValidBitsOfNewBitFlags, int pNewBitFlags )
    {
        return (pPreviousAccumulatedBitFlags & (~pValidBitsOfNewBitFlags)) //
               | (pValidBitsOfNewBitFlags & pNewBitFlags);
    }
}

Commits for litesoft/trunk/DeviceDesktopTest/src/org/litesoft/core/typeutils/Bits.java

Diff revisions: vs.
Revision Author Commited Message
936 GeorgeS picture GeorgeS Sun 01 Jun, 2014 20:19:38 +0000

Language Support