com.ca.jcs.converter.meta
Class ORedMultiValuePropertyFlattener
java.lang.Object
com.ca.jcs.cfg.Vetoable
com.ca.jcs.converter.meta.PropertyConverter
com.ca.jcs.converter.meta.MultiValuePropertyFlattener
com.ca.jcs.converter.meta.ORedMultiValuePropertyFlattener
- All Implemented Interfaces:
- AttributeConverter
public class ORedMultiValuePropertyFlattener
- extends MultiValuePropertyFlattener
A flattening converter that performs flattening by performing a logical
OR operation on the target attribute values.
This can be set on a collection of enum properties where the enum's ordinals
form a binary sequence. The ORing is done by converting the symbolic names
to the corresponding ordinal values and performing the OR against all attribute values.
Note that in from connector direction the order of values output by un-flattening may not
coincide to the order in which they were sent as the flattening itself is lossy.
|
Method Summary |
static boolean |
isBinaryOrdinals(DataModelEnumDef enumDef)
Given enum definition check if its ordinals are only powers of 2 |
static boolean |
isPowerOfTwo(int n)
Given enum definition rewrite its ordinals to form a sequence of powers of 2 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ORedMultiValuePropertyFlattener
public ORedMultiValuePropertyFlattener(MultiValuePropertyFlattener.StyleConfig cfg,
DataModelProperty prop)
ORedMultiValuePropertyFlattener
public ORedMultiValuePropertyFlattener(DataModelProperty prop)
isPowerOfTwo
public static boolean isPowerOfTwo(int n)
- Given enum definition rewrite its ordinals to form a sequence of powers of 2
isBinaryOrdinals
public static boolean isBinaryOrdinals(DataModelEnumDef enumDef)
- Given enum definition check if its ordinals are only powers of 2
Created 2011-07-14 13:27 EST