Package org.ojalgo.type
Class EnumPartition<E extends Enum<E>>
java.lang.Object
org.ojalgo.type.EnumPartition<E>
Keeps track of n (ordered)
Enum
values – any Enum
and any number of values. This is a
generalised version of IndexSelector
.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Count the number of times a specific value appears.int
Generalised version ofcount(Enum)
that allows to instead count the number of times something else is set.int[]
Get the indices where this value is set.int[]
Generalised version ofextract(Enum)
that allows to instead get the negated (complement) set of indices.void
Generalised version ofextract(Enum, boolean)
that allows to supply the array the resulting indices should be written to.void
get
(int index) boolean
int
size()
void
-
Field Details
-
myConstants
-
myCounts
private final int[] myCounts -
myValues
private final byte[] myValues
-
-
Constructor Details
-
EnumPartition
-
-
Method Details
-
count
Count the number of times a specific value appears. -
count
Generalised version ofcount(Enum)
that allows to instead count the number of times something else is set. -
extract
Get the indices where this value is set. -
extract
Generalised version ofextract(Enum)
that allows to instead get the negated (complement) set of indices. -
extract
Generalised version ofextract(Enum, boolean)
that allows to supply the array the resulting indices should be written to. -
fill
-
get
-
is
-
size
public int size() -
update
-