- java.lang.Object
-
- org.ojalgo.type.EnumPartition<E>
-
public final class EnumPartition<E extends java.lang.Enum<E>> extends java.lang.ObjectKeeps track of n (ordered)Enumvalues – anyEnumand any number of values. This is a generalised version ofIndexSelector.- See Also:
IndexSelector
-
-
Field Summary
Fields Modifier and Type Field Description private E[]myConstantsprivate int[]myCountsprivate byte[]myValues
-
Constructor Summary
Constructors Constructor Description EnumPartition(int size, E initialValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcount(E value)Count the number of times a specific value appears.intcount(E value, boolean negate)Generalised version ofcount(Enum)that allows to instead count the number of times something else is set.int[]extract(E value)Get the indices where this value is set.int[]extract(E value, boolean negate)Generalised version ofextract(Enum)that allows to instead get the negated (complement) set of indices.voidextract(E value, boolean negate, int[] receiver)Generalised version ofextract(Enum, boolean)that allows to supply the array the resulting indices should be written to.voidfill(E value)Deprecated.v56 Use#reset(E)insteadEget(int index)booleanis(int index, E value)voidreset(E value)intsize()voidupdate(int index, E value)
-
-
-
Constructor Detail
-
EnumPartition
public EnumPartition(int size, E initialValue)
-
-
Method Detail
-
count
public int count(E value)
Count the number of times a specific value appears.
-
count
public int count(E value, boolean negate)
Generalised version ofcount(Enum)that allows to instead count the number of times something else is set.
-
extract
public int[] extract(E value)
Get the indices where this value is set.
-
extract
public int[] extract(E value, boolean negate)
Generalised version ofextract(Enum)that allows to instead get the negated (complement) set of indices.
-
extract
public void extract(E value, boolean negate, int[] receiver)
Generalised version ofextract(Enum, boolean)that allows to supply the array the resulting indices should be written to.
-
fill
@Deprecated public void fill(E value)
Deprecated.v56 Use#reset(E)instead
-
get
public E get(int index)
-
is
public boolean is(int index, E value)
-
reset
public void reset(E value)
-
size
public int size()
-
update
public void update(int index, E value)
-
-