CommandFileParser.Bitmask

static class CommandFileParser.Bitmask
extends Object

java.lang.Object
   ↳ com.android.tradefed.command.CommandFileParser.Bitmask


Represents a bitmask. Useful because it caches the number of bits which are set.

Summary

Public constructors

CommandFileParser.Bitmask(int nBits)
CommandFileParser.Bitmask(int nBits, boolean initialValue)

Public methods

void add(int idx, boolean val)
void addN(int idx, int count, boolean val)

Insert a bunch of identical values in the specified spot in the mask

boolean get(int idx)
int getSetCount()

Return the number of bits which are set (rather than unset)

boolean remove(int idx)
boolean set(int idx)
boolean unset(int idx)

Public constructors

CommandFileParser.Bitmask

CommandFileParser.Bitmask (int nBits)

Parameters
nBits int

CommandFileParser.Bitmask

CommandFileParser.Bitmask (int nBits, 
                boolean initialValue)

Parameters
nBits int

initialValue boolean

Public methods

add

void add (int idx, 
                boolean val)

Parameters
idx int

val boolean

addN

void addN (int idx, 
                int count, 
                boolean val)

Insert a bunch of identical values in the specified spot in the mask

Parameters
idx int: the index where the first new value should be set.

count int: the number of new values to insert

val boolean: the parity of the new values

get

boolean get (int idx)

Parameters
idx int

Returns
boolean

getSetCount

int getSetCount ()

Return the number of bits which are set (rather than unset)

Returns
int

remove

boolean remove (int idx)

Parameters
idx int

Returns
boolean

set

boolean set (int idx)

Parameters
idx int

Returns
boolean

unset

boolean unset (int idx)

Parameters
idx int

Returns
boolean