Dimension Class Reference

This type of objects represent one dimension. More...

#include <Dimension.h>

List of all members.

Public Member Functions

 Dimension (int size=100, bool normalized=false)
 Dimension (const Dimension &d)
 The copy-constructor:.
Dimensionoperator= (const Dimension &d)
 ~Dimension ()
 the destructor
int getSize ()
 Return the number of elements in this finite, discrete dimension object.
void setSize (int dsize)
 Set the number of elements in this finite, discrete dimension object.
bool getNormalized ()
 Is this dimension a ring or a strand?.
void setNormalized (bool normal)
 Set or unset the normalization in this dimension.
bool isOutOfBounds (int coordinate)
int getPos (int coordinate)


Detailed Description

This type of objects represent one dimension.

This type of objects represent one dimension (an axe in the "picture"), and can be normalized, like a ring, or with bounds a strand.


Constructor & Destructor Documentation

Dimension::Dimension ( int  size = 100,
bool  normalized = false 
) [inline]

the constructor, creates a object, with a given size (100 default) and type of bounds (default with bounds)


Member Function Documentation

bool Dimension::getNormalized (  )  [inline]

Is this dimension a ring or a strand?.

If this method return a true this dimension is a ring, false is a strand.

int Dimension::getPos ( int  coordinate  )  [inline]

this method is to return the position in the dimension, in base of the coordinate, only has sense to call it if the dim is normalized, but sometimes you want generic code and call it anyway so you have to call isOutOfBounds(int coordinate) method before call this method to avoid a bug

bool Dimension::isOutOfBounds ( int  coordinate  )  [inline]

this method is to know if a coordinate is outside of the bounds, returns true is the ordinate is out of the bounds false other way

Dimension& Dimension::operator= ( const Dimension d  )  [inline]

Overwrite the = operator to avoid problems when you forget initialize whit the constructor

void Dimension::setNormalized ( bool  normal  )  [inline]

Set or unset the normalization in this dimension.

If is set true the dimension is a ring if not (false) is a strand.


The documentation for this class was generated from the following file:
Generated on Thu Aug 17 00:04:36 2006 for Cagecpp by  doxygen 1.4.7