edu.ksu.cis.projects.bogor.module.value
Interface IValueArray

All Superinterfaces:
Disposable
All Known Implementing Classes:
UniformValueArray, VariedValueArray

public interface IValueArray
extends Disposable

This interface is used to provide methods for storing (an array of) values.

Version:
CVS $Revision: 1.7 $ $Date: 2005/01/14 15:48:13 $
Author:
Robby , Matt Hoosier

Method Summary
 IValueArray clone(boolean deepClone, Map<Object,Object> cloneMap)
          Clone this value array.
 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.
 void validate(IBogorConfiguration bc)
          Validates this value array wrt.
 
Methods inherited from interface edu.ksu.cis.projects.bogor.util.Disposable
dispose
 

Method Detail

setElementValue

void setElementValue(int elementIndex,
                     IValue elementValue)
Sets a value array element's value.

Parameters:
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.

getElementValue

IValue getElementValue(int elementIndex)
Gets a value array element's value.

Parameters:
elementIndex - The index of the element in this value array. Must be greater than zero and less than the length of this value array.
Returns:
The element's array value. Non-null.

getLength

int getLength()
Gets the length of this value array.

Returns:
The length of this value array. At least zero.

clone

IValueArray clone(boolean deepClone,
                  Map<Object,Object> cloneMap)
Clone this value array.

Parameters:
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.
Returns:
The clone this value array.

linearize

void linearize(boolean isMapDefaultValues,
               int bitsPerNonPrimitiveValue,
               ObjectIntTable<INonPrimitiveValue> nonPrimitiveValueIdMap,
               int bitsPerThreadId,
               IntIntTable threadOrderMap,
               BitSet elidedPositions,
               BitBuffer bb)
Linearizes the contained values.

Parameters:
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.

linearize

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.

Parameters:
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.

toArray

IValue[] toArray()
Returns the contained values as an array.

Returns:
The array consisting the contained values. Non-null.

validate

void validate(IBogorConfiguration bc)
Validates this value array wrt. a configuration.