gridripper::util::IntVector Class Reference

Growable array of integers. More...

List of all members.

Public Member Functions

 IntVector ()
 Creates an empty vector.
 IntVector (int n)
 Constructs a vector with the specified capacity.
int size ()
 Gets the vector size.
void setSize (int n)
 Sets the array size.
void add (int x)
 Adds an element to the end of the vector.
int get (int i)
 Gets an element.
void set (int i, int x)
 Sets an element.
void copy (int start, int[] dst, int dstPos, int len)
 Copies elements into an array.
void add (int[] src, int srcPos, int n)
 Adds array elements.
void set (int i, int[] src, int srcPos, int n)
 Sets array elements.
int[] toArray ()
 Converts the vector contents to an array.
int[] internalArray ()
 Gets the internal array object.
void ensureCapacity (int n)
 Increases the capacity if necessary, to ensure that the vector can hold at least the number of elements specified by the argument.


Detailed Description

Growable array of integers.

Version:
0.5, 06/12/2009
Since:
GridRipper 0.5, 06/06/2009
Author:
Peter Csizmadia

Constructor & Destructor Documentation

gridripper::util::IntVector::IntVector ( int  n  )  [inline]

Constructs a vector with the specified capacity.

Parameters:
n the initial capacity


Member Function Documentation

int gridripper::util::IntVector::size (  )  [inline]

Gets the vector size.

Returns:
the size

void gridripper::util::IntVector::setSize ( int  n  )  [inline]

Sets the array size.

Parameters:
n the new size

void gridripper::util::IntVector::add ( int  x  )  [inline]

Adds an element to the end of the vector.

Parameters:
x the value

int gridripper::util::IntVector::get ( int  i  )  [inline]

Gets an element.

Parameters:
i index
Returns:
value

void gridripper::util::IntVector::set ( int  i,
int  x 
) [inline]

Sets an element.

Parameters:
i index
x value

void gridripper::util::IntVector::copy ( int  start,
int[]  dst,
int  dstPos,
int  len 
) [inline]

Copies elements into an array.

Parameters:
start starting position
dst the output array
dstPos starting position in the output array
len number of elements to copy

void gridripper::util::IntVector::add ( int[]  src,
int  srcPos,
int  n 
) [inline]

Adds array elements.

Parameters:
src the source array
srcPos starting position in the source array
n number of elements to copy

void gridripper::util::IntVector::set ( int  i,
int[]  src,
int  srcPos,
int  n 
) [inline]

Sets array elements.

Parameters:
i index of first element to overwrite
src the source array
srcPos starting position in the source array
n number of elements to copy

int [] gridripper::util::IntVector::toArray (  )  [inline]

Converts the vector contents to an array.

Note that the returned array is a copy, hence it can only be used for reading, writing it has no effect on the vector contents.

Returns:
the array

int [] gridripper::util::IntVector::internalArray (  )  [inline]

Gets the internal array object.

Note that its length is usually larger than size().

Returns:
the array

void gridripper::util::IntVector::ensureCapacity ( int  n  )  [inline]

Increases the capacity if necessary, to ensure that the vector can hold at least the number of elements specified by the argument.

Parameters:
n the desired minimum capacity


The documentation for this class was generated from the following file:

Generated on Wed Jun 17 18:47:30 2009 for GridRipper by  doxygen 1.5.6