Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

RunArray Class Reference

The RunArray class is a base class for building classes which represent data that is associated with runs of text. More...

#include <RunArrays.h>

Inheritance diagram for RunArray::

UObject UMemory FontRuns LocaleRuns ValueRuns List of all members.

Public Methods

 RunArray (const le_int32 *limits, le_int32 count)
 Construct a RunArray object from a pre-existing array of limit indices. More...

 RunArray (le_int32 initalCapacity)
 Construct an empty RunArray object. More...

virtual ~RunArray ()
 The destructor; virtual so that subclass destructors are invoked as well. More...

le_int32 getCount () const
 Get the number of entries in the limit indices array. More...

le_int32 getLimit () const
 Get the last limit index. More...

le_int32 getLimit (le_int32 run) const
 Get the limit index for a particular run of text. More...

le_int32 add (le_int32 limit)
 Add a limit index to the limit indices array and return the run index where it was stored. More...

virtual UClassID getDynamicClassID () const
 ICU "poor man's RTTI", returns a UClassID for the actual class. More...


Static Public Methods

UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class. More...


Protected Methods

virtual void init (le_int32 capacity)
 Create a data array with the given initial size. More...

virtual void grow (le_int32 capacity)
 Grow a data array to the given initial size. More...


Protected Attributes

le_bool fClientArrays
 Set by the constructors to indicate whether or not the client supplied the data arrays. More...


Private Methods

le_int32 ensureCapacity ()
 RunArray ()
 RunArray (const RunArray &)
RunArray & operator= (const RunArray &)

Private Attributes

const le_int32fLimits
le_int32 fCount
le_int32 fCapacity

Static Private Attributes

const char fgClassID
 The address of this static class variable serves as this class's ID for ICU "poor man's RTTI". More...


Detailed Description

The RunArray class is a base class for building classes which represent data that is associated with runs of text.

This class maintains an array of limit indices into the text, subclasses provide one or more arrays of data.

Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Definition at line 43 of file RunArrays.h.


Constructor & Destructor Documentation

RunArray::RunArray const le_int32   limits,
le_int32    count
[inline]
 

Construct a RunArray object from a pre-existing array of limit indices.

Parameters:
limits  is an array of limit indices.
count  is the number of entries in the limit array.
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Definition at line 218 of file RunArrays.h.

RunArray::RunArray le_int32    initalCapacity
 

Construct an empty RunArray object.

Clients can add limit indices array using the add method.

Parameters:
initialCapacity  is the initial size of the limit indices array. If this value is zero, no array will be allocated.
See also:
add
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

virtual RunArray::~RunArray   [virtual]
 

The destructor; virtual so that subclass destructors are invoked as well.

Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

RunArray::RunArray   [inline, private]
 

Definition at line 206 of file RunArrays.h.

RunArray::RunArray const RunArray &    [inline, private]
 

Definition at line 212 of file RunArrays.h.


Member Function Documentation

le_int32 RunArray::add le_int32    limit
 

Add a limit index to the limit indices array and return the run index where it was stored.

If the array does not exist, it will be created by calling the init method. If it is full, it will be grown by calling the grow method.

If the RunArray object was created with a client-supplied limit indices array, 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 a limit index along with whatever other data they implement. The new add method should first call this method to grow the data arrays, and use the return value to store the data in their own arrays.

Parameters:
limit  is the limit index to add to the array.
Returns:
the run index where the limit index was stored, or -1 if the limit index cannt be stored.
See also:
init , grow
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

le_int32 RunArray::ensureCapacity   [private]
 

le_int32 RunArray::getCount   const [inline]
 

Get the number of entries in the limit indices array.

Returns:
the number of entries in the limit indices array.
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Definition at line 224 of file RunArrays.h.

virtual UClassID RunArray::getDynamicClassID void    const [inline, virtual]
 

ICU "poor man's RTTI", returns a UClassID for the actual class.

Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Reimplemented from UObject.

Reimplemented in FontRuns, LocaleRuns, and ValueRuns.

Definition at line 139 of file RunArrays.h.

le_int32 RunArray::getLimit le_int32    run const [inline]
 

Get the limit index for a particular run of text.

Parameters:
run  is the run. This is an index into the limit index array.
Returns:
the limit index for the run, or -1 if run is out of bounds.
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Definition at line 229 of file RunArrays.h.

le_int32 RunArray::getLimit   const [inline]
 

Get the last limit index.

This is the number of characters in the text.

Returns:
the last limit index.
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Definition at line 238 of file RunArrays.h.

UClassID RunArray::getStaticClassID void    [inline, static]
 

ICU "poor man's RTTI", returns a UClassID for this class.

Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Reimplemented in FontRuns, LocaleRuns, and ValueRuns.

Definition at line 146 of file RunArrays.h.

Referenced by ValueRuns::getDynamicClassID(), LocaleRuns::getDynamicClassID(), and FontRuns::getDynamicClassID().

virtual void RunArray::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.

Parameters:
capacity  is the initial size of the data array.
See also:
add
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Reimplemented in FontRuns, LocaleRuns, and ValueRuns.

virtual void RunArray::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.

Parameters:
capacity  is the initial size of the data array.
See also:
add
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Reimplemented in FontRuns, LocaleRuns, and ValueRuns.

RunArray& RunArray::operator= const RunArray &    [inline, private]
 

Definition at line 199 of file RunArrays.h.


Member Data Documentation

le_int32 RunArray::fCapacity [private]
 

Definition at line 203 of file RunArrays.h.

le_bool RunArray::fClientArrays [protected]
 

Set by the constructors to indicate whether or not the client supplied the data arrays.

If they were supplied by the client, the add method won't change the arrays and the destructor won't delete them.

Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Definition at line 186 of file RunArrays.h.

le_int32 RunArray::fCount [private]
 

Definition at line 202 of file RunArrays.h.

const le_int32* RunArray::fLimits [private]
 

Definition at line 201 of file RunArrays.h.

const char RunArray::fgClassID [static, private]
 

The address of this static class variable serves as this class's ID for ICU "poor man's RTTI".

Reimplemented in FontRuns, LocaleRuns, and ValueRuns.

Definition at line 193 of file RunArrays.h.


The documentation for this class was generated from the following file:
Generated on Mon Nov 24 14:36:50 2003 for ICU 2.8 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001