Package ghidra.program.model.data
Class BitGroup
java.lang.Object
ghidra.program.model.data.BitGroup
Class used to organize long values into sets of values with overlapping bits.
For example, if you had values 1,2,3, 8, 12, you could partition them into two bit groups.
The values 1,2,3, would be in one bit group because they all use the "1" or "2" bit.
(If there was no "3" enum value, then the "1" bit and the "2" bit would be in separate groups
since there are no enum values that share any bits.) Also, the values "8" and "12" are in the same
group since they share the "8" bit.
-
Method Summary
Modifier and TypeMethodDescriptionlong
getMask()
Returns the mask that represents all the bits that are used by the values in this BitGroup.Gets the set of values that make up this BitGroup.boolean
intersects
(BitGroup bitGroup) Tests if this bit group has any overlapping bits with the given bit group.void
Merges the given BitGroup into the group.toString()
-
Method Details
-
intersects
Tests if this bit group has any overlapping bits with the given bit group.- Parameters:
bitGroup
- the BitGroup to test for overlap.- Returns:
- true if the groups have any bits in common.
-
merge
Merges the given BitGroup into the group. All of its values will be added to this group's values and the masks will be or'ed together.- Parameters:
bitGroup
- the BitGroup to merge into this one.
-
toString
-
getMask
public long getMask()Returns the mask that represents all the bits that are used by the values in this BitGroup.- Returns:
- the mask that represents all the bits that are used by the values in this BitGroup.
-
getValues
Gets the set of values that make up this BitGroup.- Returns:
- the set of values that make up this BitGroup.
-