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

VectorOfInt Class Reference

VectorOfInt is a dynamic array of 32-bit integers. More...

#include <tables.h>

List of all members.

Public Types

enum  EGrowthRate { GROWTH_RATE = 4 }
 The chunk size by which the array is grown. More...


Public Methods

 VectorOfInt (int32_t initialSize = 0)
 Creates a vector that contains elements of integers. More...

 VectorOfInt (const VectorOfInt& that)
 Copy constructor.

 ~VectorOfInt ()
 Destructor.

const VectorOfInt& operator= (const VectorOfInt& that)
 Assignment operator.

UBool operator== (const VectorOfInt& that)
 Equality operators.

UBool operator!= (const VectorOfInt& that)
int32_t operator[] (int32_t index) const
 Gets a read-only reference to the element at the specified index. More...

int32_t at (int32_t index) const
int32_toperator[] (int32_t index)
 Gets a non-const reference to the element at the specified index. More...

int32_tat (int32_t index)
void atPut ( int32_t index, const int32_t& value)
 Sets the element at the specified index to a different value. More...

void atInsert ( int32_t index, const int32_t& value)
 Inserts a value at the specified index, sliding the rest of the elements in the array over to make room. More...

int32_t size (void) const
 Returns the number of elements in the vector. More...

void setSize (int32_t newSize)
 Sets the size of this vector. More...

UBool isBogus (void) const
 Checks if this vector object is valid. More...

void streamOut (FileStream* os) const
 The streamIn and streamOut methods read and write objects of this class as binary, platform-dependent data in the iostream. More...

void streamIn (FileStream* is)
void streamOut (UMemoryStream* os) const
void streamIn (UMemoryStream* is)


Detailed Description

VectorOfInt is a dynamic array of 32-bit integers.

Ideally we would use templates for this, but they're not supported on all of the platforms we need to support.

Definition at line 89 of file tables.h.


Member Enumeration Documentation

enum VectorOfInt::EGrowthRate
 

The chunk size by which the array is grown.

This probably shouldn't be in the API

Enumeration values:
GROWTH_RATE  

Definition at line 96 of file tables.h.


Constructor & Destructor Documentation

VectorOfInt::VectorOfInt ( int32_t initialSize = 0 )
 

Creates a vector that contains elements of integers.

Parameters:
initialSize   the initial size of the vector object.

VectorOfInt::VectorOfInt ( const VectorOfInt & that )
 

Copy constructor.

VectorOfInt::~VectorOfInt ( )
 

Destructor.


Member Function Documentation

int32_t & VectorOfInt::at ( int32_t index ) [inline]
 

Definition at line 1096 of file tables.h.

int32_t VectorOfInt::at ( int32_t index ) const [inline]
 

Definition at line 1090 of file tables.h.

void VectorOfInt::atInsert ( int32_t index,
const int32_t & value )
 

Inserts a value at the specified index, sliding the rest of the elements in the array over to make room.

Parameters:
index   the specified index.
value   the value.

void VectorOfInt::atPut ( int32_t index,
const int32_t & value )
 

Sets the element at the specified index to a different value.

Parameters:
index   the specified index.
value   the new value.

UBool VectorOfInt::isBogus ( void ) const
 

Checks if this vector object is valid.

Returns:
TRUE if the vector object is valid, FALSE otherwise.

UBool VectorOfInt::operator!= ( const VectorOfInt & that )
 

const VectorOfInt & VectorOfInt::operator= ( const VectorOfInt & that )
 

Assignment operator.

UBool VectorOfInt::operator== ( const VectorOfInt & that )
 

Equality operators.

int32_t & VectorOfInt::operator[] ( int32_t index )
 

Gets a non-const reference to the element at the specified index.

This does range-checking; access to elements beyond the end of the array will cause the array to grow.

int32_t VectorOfInt::operator[] ( int32_t index ) const [inline]
 

Gets a read-only reference to the element at the specified index.

This does not do range-checking; an invalid index may cause a crash.

Returns:
the accessed element.

Definition at line 1083 of file tables.h.

void VectorOfInt::setSize ( int32_t newSize )
 

Sets the size of this vector.

If the new size is greater than the current size, new 0 items are added to the end of the vector. If the new size is less than the current size, all components at index newSize and greater are discarded. If newSize is negative it is treated as if it were zero.

Parameters:
newSize   the new size of this vector.

int32_t VectorOfInt::size ( void ) const [inline]
 

Returns the number of elements in the vector.

Returns:
the size of vector.

Definition at line 1102 of file tables.h.

void VectorOfInt::streamIn ( UMemoryStream * is )
 

void VectorOfInt::streamIn ( FileStream * is )
 

void VectorOfInt::streamOut ( UMemoryStream * os ) const
 

void VectorOfInt::streamOut ( FileStream * os ) const
 

The streamIn and streamOut methods read and write objects of this class as binary, platform-dependent data in the iostream.

The stream must be in ios::binary mode for this to work. These methods are not intended for general public use; they are used by the framework to improve performance by storing certain objects in binary files.


The documentation for this class was generated from the following file:
Generated at Tue Dec 5 17:56:35 2000 for ICU by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000