|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ksu.cis.projects.bogor.module.value.VariedValueArray
public class VariedValueArray
The default implementation of IValueArray
Field Summary | |
---|---|
protected static byte |
DOUBLE_TYPE
A constant to indicate a double type. |
protected double[] |
doubleElementValues
Holds the values of this array value's double value elements. |
protected int[] |
elementIndexIndex
Holds the mapping from element index to its typed index ( intElementValues ,longElementValues ,
floatElementValues ,doubleElementValues ,
or nonPrimitiveElementValues ). |
protected byte[] |
elementIndexType
Holds the mapping from field index to its type ( INT_TYPE ,
LONG_TYPE ,FLOAT_TYPE ,
DOUBLE_TYPE , or NON_PRIMITIVE_TYPE ). |
protected static byte |
FLOAT_TYPE
A constant to indicate a float type. |
protected float[] |
floatElementValues
Holds the values of this array value's float value elements. |
protected static byte |
INT_TYPE
A constant to indicate an int type. |
protected Type[] |
intElementTypes
Holds the type of this array value's int value elements. |
protected int[] |
intElementValues
Holds the values of this array value's int value elements. |
protected static byte |
LONG_TYPE
A constant to indicate a long type. |
protected LongType[] |
longElementTypes
Holds the type of this array value's long value elements. |
protected long[] |
longElementValues
Holds the values of this array value's long value elements. |
protected static byte |
NON_PRIMITIVE_TYPE
A constant to indicate a non-primitive type. |
protected INonPrimitiveValue[] |
nonPrimitiveElementValues
Holds the values of this array value's non-primitive value elements. |
protected static byte |
PRIMITIVE_EXT_TYPE
A constant to indicate a primitive ext type. |
protected IPrimitiveExtValue[] |
primitiveExtElementValues
Holds the values of this array value's primitive ext value elements. |
protected IValueFactory |
valueFactory
Holds the value factory. |
Constructor Summary | |
---|---|
protected |
VariedValueArray()
Private constructor for cloning purposes. |
protected |
VariedValueArray(IValueFactory valueFactory,
IValue[] elementValues)
Default constructor. |
Method Summary | |
---|---|
IValueArray |
clone(boolean deepClone,
Map<Object,Object> cloneMap)
Clone this value array. |
void |
dispose()
Remove references. |
IValue |
getElementValue(int elementIndex)
Gets a value array element's value. |
int |
getLength()
Gets the length of this value array. |
void |
linearize(boolean isMapDefaultValues,
int bitsPerNonPrimitiveValue,
ObjectIntTable<INonPrimitiveValue> nonPrimitiveValueIdMap,
int bitsPerThreadId,
IntIntTable threadOrderMap,
BitSet elidedPositions,
BitBuffer bb)
Linearizes the contained values. |
void |
linearize(boolean isMapDefaultValues,
int bitsPerNonPrimitiveValue,
ObjectIntTable<INonPrimitiveValue> nonPrimitiveValueIdMap,
int bitsPerThreadId,
IntIntTable threadOrderMap,
BitSet elidedPositions,
BitBuffer bb,
int fromIndex,
int toIndex)
Linearizes the contained values. |
void |
setElementValue(int elementIndex,
IValue elementValue)
Sets a value array element's value. |
IValue[] |
toArray()
Returns the contained values as an array. |
String |
toString()
|
void |
validate(IBogorConfiguration bc)
Validates this value array wrt. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final byte INT_TYPE
protected static final byte LONG_TYPE
protected static final byte FLOAT_TYPE
protected static final byte DOUBLE_TYPE
protected static final byte PRIMITIVE_EXT_TYPE
protected static final byte NON_PRIMITIVE_TYPE
protected transient IValueFactory valueFactory
IPrimitiveValue
to implement getElementValue
since we store each primitive value by its corresponding Java primitive
values.
protected int[] elementIndexIndex
intElementValues
,longElementValues
,
floatElementValues
,doubleElementValues
,
or nonPrimitiveElementValues
). Non-null if there is at
least one element.
protected byte[] elementIndexType
INT_TYPE
,
LONG_TYPE
,FLOAT_TYPE
,
DOUBLE_TYPE
, or NON_PRIMITIVE_TYPE
).
Non-null if there is at least one element.
protected int[] intElementValues
protected long[] longElementValues
protected float[] floatElementValues
protected double[] doubleElementValues
protected IPrimitiveExtValue[] primitiveExtElementValues
protected INonPrimitiveValue[] nonPrimitiveElementValues
protected Type[] intElementTypes
BooleanType
,IntType
,
IntRangeType
, or EnumType
.
protected LongType[] longElementTypes
LongType
, or LongRangeType
.
Constructor Detail |
---|
protected VariedValueArray(IValueFactory valueFactory, IValue[] elementValues)
valueFactory
- The value factory for this value array. Needed to create
IPrimitiveValue
to implement
getElementValue
since we store each primitive
value by its corresponding ava primitive values.elementValues
- The element values for this value array. Must be non-null.
Each element must be non-null.protected VariedValueArray()
Method Detail |
---|
public void setElementValue(int elementIndex, IValue elementValue)
IValueArray
setElementValue
in interface IValueArray
elementIndex
- The index of the element in this value array. Must be greater
than zero and less than the length of this value array.elementValue
- The new value of the element. Must be non-null.public IValue getElementValue(int elementIndex)
IValueArray
getElementValue
in interface IValueArray
elementIndex
- The index of the element in this value array. Must be greater
than zero and less than the length of this value array.
public int getLength()
IValueArray
getLength
in interface IValueArray
public IValueArray clone(boolean deepClone, Map<Object,Object> cloneMap)
IValueArray
clone
in interface IValueArray
deepClone
- Indicates whether deep cloning.cloneMap
- Original values (IValue
) to their clones (
IValue
) mapping. The clone map to solve
circular references in values. If this value is a key in the
map, then this method returns the value of the key in the map.
Must be non-null if deep cloning.
public void dispose()
Disposable
dispose
in interface Disposable
public void linearize(boolean isMapDefaultValues, int bitsPerNonPrimitiveValue, ObjectIntTable<INonPrimitiveValue> nonPrimitiveValueIdMap, int bitsPerThreadId, IntIntTable threadOrderMap, BitSet elidedPositions, BitBuffer bb)
IValueArray
linearize
in interface IValueArray
isMapDefaultValues
- Indicates whether to bitmap default values.bitsPerNonPrimitiveValue
- The number of bits used to encode a non-primitive value.nonPrimitiveValueIdMap
- A mapping of non-primitive values to their unique id. Must be
non-null.bitsPerThreadId
- The number of bits used to encode a thread descriptor.threadOrderMap
- A mapping of thread descriptors to their order number. Must be
non-null.elidedPositions
- A bitset indicating which elements of the array should be
omitted from the bit-vector. A null reference here indicates
that all elements should be linearized.bb
- The bit-buffer for linearizing the values. Must be non-null.public void linearize(boolean isMapDefaultValues, int bitsPerNonPrimitiveValue, ObjectIntTable<INonPrimitiveValue> nonPrimitiveValueIdMap, int bitsPerThreadId, IntIntTable threadOrderMap, BitSet elidedPositions, BitBuffer bb, int fromIndex, int toIndex)
IValueArray
linearize
in interface IValueArray
isMapDefaultValues
- Indicates whether to bitmap default values.bitsPerNonPrimitiveValue
- The number of bits used to encode a non-primitive value.nonPrimitiveValueIdMap
- A mapping of non-primitive values to their unique id. Must be
non-null.bitsPerThreadId
- The number of bits used to encode a thread descriptor.threadOrderMap
- A mapping of thread descriptors to their order number. Must be
non-null.elidedPositions
- A bitset indicating which elements of the array should be
omitted from the bit-vector. A null reference here indicates
that all elements should be linearized.bb
- The bit-buffer for linearizing the values. Must be non-null.fromIndex
- The index of the first element to be linearized.toIndex
- The index after the last element to be linearized.public IValue[] toArray()
IValueArray
toArray
in interface IValueArray
public String toString()
toString
in class Object
public void validate(IBogorConfiguration bc)
IValueArray
validate
in interface IValueArray
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |