Package com.illumon.iris.db.tables.libs
Class StringSetFromEnum
java.lang.Object
com.illumon.iris.db.tables.libs.StringSetFromEnum
public class StringSetFromEnum extends Object
This class provides a object that converts from list of
String
values and their binary masks to a
StringSetWrapper. (The first string corresponds to
the value 1, the second to 2, the third to 4, etc.) Because of the use of values of 2,
this conversion can handle bit sets. It is however limited to 31 possible enum values.-
Field Summary
Fields Modifier and Type Field Description protected gnu.trove.map.hash.TIntObjectHashMap<StringSet>
enumsToString
protected ReentrantReadWriteLock
setLock
protected String[]
strings
-
Constructor Summary
Constructors Constructor Description StringSetFromEnum(String[] enums)
Create a converter for the sequence ofenums
, where the i-th enum in the sequence is associated with the valueMath.pow(2,i)
(starting with index 0 and value 1). -
Method Summary
-
Field Details
-
Constructor Details
-
StringSetFromEnum
Create a converter for the sequence ofenums
, where the i-th enum in the sequence is associated with the valueMath.pow(2,i)
(starting with index 0 and value 1).
-
-
Method Details
-
convert
Return a string representation of the enum bit set given by theoriginalIndex
.
-