# Class: com.pnfsoftware.jeb.util.base.Flags

Bit flags object, `int` based \(allow 32 bit flags\).

## Constructor: Flags

Description: Create flags with the initial value 0.

## Constructor: Flags
- parameter: `initial`, type: `int`

Description: Create flags.
parameter: initial: initial flags value

## Constructor: Flags
- parameter: `initialFlags`, type: `int`
- parameter: `allowedFlags`, type: `int`
- parameter: `names`, type: `java.util.Map<java.lang.Integer,java.lang.String>`

Description: Create flags and specify which bits \(0..31\) are legal parts of the flags.
parameter: initialFlags: initial flags value
parameter: allowedFlags: legal bit flags; 0xFFFFFFFF \(\-1\) means all bits are legal and can be accessed
parameter: names: optional bit names

## Method: addTo
- parameter: `f`, type: `int`
- return type: `boolean`

Description: Add \(set\) bits to the current flags.
parameter: f: flags to be added
return: true if the overall flags have changed, false otherwise

## Method: get
- return type: `int`

Description: Get the current flags.
return: current flags

## Method: hasAll
- parameter: `f`, type: `int`
- return type: `boolean`

Description: Determine if all of the provided bits are currently set.
parameter: f: bits to test
return: true if all bits are set

## Method: hasNone
- parameter: `f`, type: `int`
- return type: `boolean`

Description: Determine if none of the provided bits are currently set.
parameter: f: bits to test
return: true if none of the bits are set

## Method: hasSome
- parameter: `f`, type: `int`
- return type: `boolean`

Description: Determine if some of the provided bits are currently set.
parameter: f: bits to test
return: true if at least one bit is set

## Method: isValidBit
- parameter: `bit`, type: `int`
- return type: `boolean`

Description: Determine whether a bit index is legal for this flag set.
parameter: bit: bit index, from 0 to 31
return: true if the bit is in range and allowed

## Method: removeFrom
- parameter: `f`, type: `int`
- return type: `boolean`

Description: Remove \(reset\) bits from the current flags.
parameter: f: flags to be removed
return: true if the overall flags have changed, false otherwise

## Method: set
- parameter: `flags`, type: `int`
- return type: `boolean`

Description: Set the flags.
parameter: flags: new flags value
return: true if the flags have changed, false otherwise

## Method: testBit
- parameter: `bit`, type: `int`
- return type: `boolean`

Description: Determine whether a bit is currently set.
parameter: bit: bit index, from 0 to 31
return: true if the bit is set
throws: if the bit index is out of range

## Method: toString
- return type: `java.lang.String`


## Method: update
- parameter: `f`, type: `int`
- parameter: `add`, type: `boolean`
- return type: `boolean`

Description: Add or remove bits to the current flags.
parameter: f: flags to be added or remove
parameter: add: true to add flags, false to remove flags
return: true if the overall flags have changed, false otherwise

## Method: verify
- parameter: `f`, type: `int`

Description: Verify that the provided flags only contain allowed bits.
parameter: f: flags to verify
throws: if an illegal bit is set

## Static Method: has
- parameter: `flags`, type: `int`
- parameter: `bits`, type: `int`
- return type: `boolean`

Description: Flags utility: determine if the provided bit\(s\) is/are set
parameter: flags: current flags
parameter: bits: bits to check
return: true if the provided bits are all set, false otherwise

## Static Method: set
- parameter: `flags`, type: `int`
- parameter: `bits`, type: `int`
- parameter: `enabled`, type: `boolean`
- return type: `int`

Description: Flags utility: set or reset bits.
parameter: flags: current flags
parameter: bits: bit\(s\) to set or reset
parameter: enabled: true to set, false to reset
return: updated flags

