ValueRuns
class associates integer values with runs of text.
More...
#include <RunArrays.h>
Public Member Functions | |
ValueRuns (const le_int32 *values, const le_int32 *limits, le_int32 count) | |
Construct a ValueRuns object from pre-existing arrays of values and limit indices. | |
ValueRuns (le_int32 initialCapacity) | |
Construct an empty ValueRuns object. | |
virtual | ~ValueRuns () |
The destructor; virtual so that subclass destructors are invoked as well. | |
le_int32 | getValue (le_int32 run) const |
Get the integer value assoicated with the given run of text. | |
le_int32 | add (le_int32 value, le_int32 limit) |
Add an integer value and limit index pair to the data arrays and return the run index where the data was stored. | |
virtual UClassID | getDynamicClassID () const |
ICU "poor man's RTTI", returns a UClassID for the actual class. | |
Static Public Member Functions | |
static UClassID | getStaticClassID () |
ICU "poor man's RTTI", returns a UClassID for this class. | |
Protected Member Functions | |
virtual void | init (le_int32 capacity) |
Create a data array with the given initial size. | |
virtual void | grow (le_int32 capacity) |
Grow a data array to the given initial size. |
ValueRuns
class associates integer values with runs of text.
Definition at line 546 of file RunArrays.h.
Construct a ValueRuns
object from pre-existing arrays of values and limit indices.
values | is the address of an array of integer. This array must remain valid until the ValueRuns object is destroyed. | |
limits | is the address of an array of limit indices. This array must remain valid until the ValueRuns object is destroyed. | |
count | is the number of entries in the two arrays. |
Definition at line 669 of file RunArrays.h.
References ValueRuns().
Referenced by ValueRuns().
ValueRuns::ValueRuns | ( | le_int32 | initialCapacity | ) |
virtual ValueRuns::~ValueRuns | ( | ) | [virtual] |
Add an integer value and limit index pair to the data arrays and return the run index where the data was stored.
This method calls RunArray::add(limit)
which will create or grow the arrays as needed.
If the ValueRuns
object was created with a client-supplied font and limit indices arrays, this method will return a run index of -1.
Subclasses should not override this method. Rather they should provide a new add
method which takes an integer value and a limit index along with whatever other data they implement. The new add
method should first call this method to grow the font and limit indices arrays, and use the returned run index to store data their own arrays.
value | is the integer value to add | |
limit | is the limit index to add |
virtual UClassID ValueRuns::getDynamicClassID | ( | void | ) | const [inline, virtual] |
ICU "poor man's RTTI", returns a UClassID for the actual class.
Reimplemented from RunArray.
Definition at line 636 of file RunArrays.h.
References RunArray::getStaticClassID().
static UClassID ValueRuns::getStaticClassID | ( | void | ) | [inline, static] |
ICU "poor man's RTTI", returns a UClassID for this class.
Reimplemented from RunArray.
Definition at line 629 of file RunArrays.h.
Get the integer value assoicated with the given run of text.
Use RunArray::getLimit(run)
to get the corresponding limit index.
run | is the index into the font and limit indices arrays. |
virtual void ValueRuns::grow | ( | le_int32 | capacity | ) | [protected, virtual] |
Grow a data array to the given initial size.
This method will be called by the add
method if the limit indices array is full. Subclasses which override this method must also call it from the overriding method to grow the limit indices array.
capacity | is the initial size of the data array. |
Reimplemented from RunArray.
virtual void ValueRuns::init | ( | le_int32 | capacity | ) | [protected, virtual] |
Create a data array with the given initial size.
This method will be called by the add
method if there is no limit indices array. Subclasses which override this method must also call it from the overriding method to create the limit indices array.
capacity | is the initial size of the data array. |
Reimplemented from RunArray.