Package net.solarnetwork.domain
Interface GroupedBitmaskable
- All Superinterfaces:
Bitmaskable
API for a
Bitmaskable that is grouped by an index value into
like-sized groupings.- Since:
- 1.61
- Version:
- 1.0
- Author:
- matt
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA comparator ofGroupedBitmaskablethat compares overall index values.Nested classes/interfaces inherited from interface net.solarnetwork.domain.Bitmaskable
Bitmaskable.BitmaskableTypeSort -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<GroupedBitmaskable>A comparator ofGroupedBitmaskableby their overall index, in ascending order.Fields inherited from interface net.solarnetwork.domain.Bitmaskable
SORT_BY_TYPE -
Method Summary
Modifier and TypeMethodDescriptionintGet the group index.intGet the size of each group.default intGet the overall bitmask number within all groups, starting from 0.static intgroupBitmaskValue(Set<? extends GroupedBitmaskable> values, int group) Get a group's bitmask value from a set of grouped bitmaskables.static BitSetoverallBitmaskValue(Set<? extends GroupedBitmaskable> values) Get the overall bitmask values from a set of grouped bitmaskables.Methods inherited from interface net.solarnetwork.domain.Bitmaskable
bitmaskBitOffset
-
Field Details
-
SORT_BY_OVERALL_INDEX
A comparator ofGroupedBitmaskableby their overall index, in ascending order.
-
-
Method Details
-
getGroupIndex
int getGroupIndex()Get the group index.- Returns:
- the group index
-
getGroupSize
int getGroupSize()Get the size of each group.- Returns:
- the size of each group
-
getOverallIndex
default int getOverallIndex()Get the overall bitmask number within all groups, starting from 0.- Returns:
- the fault number
-
groupBitmaskValue
Get a group's bitmask value from a set of grouped bitmaskables.- Parameters:
values- the set of grouped bitmaskables to extract the group's bitmask value fromgroup- the bitmask group to extract- Returns:
- the bitmask value for the given group
-
overallBitmaskValue
Get the overall bitmask values from a set of grouped bitmaskables.- Parameters:
values- the set of grouped bitmaskables to extract the overall bitmask value from- Returns:
- the bitset of overall enabled bits, or null if no bits are set
-