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.commonfoundation.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/Java/core/Anywhere/src/org/litesoft/commonfoundation/typeutils/Bits.java

Diff revisions: vs.
Revision Author Commited Message
939 Diff Diff GeorgeS picture GeorgeS Mon 02 Jun, 2014 21:30:31 +0000

Extracting commonfoundation

822 GeorgeS picture GeorgeS Sun 19 Aug, 2012 01:03:51 +0000