00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013
00014 #include "ArrayIndexOutOfBoundsException.h"
00015 using std::endl;
00016
00017 using Mers::Utils::Exceptions::ArrayIndexOutOfBoundsException;
00018 using Mers::Utils::Lang::String;
00019
00021
00023
00024 ArrayIndexOutOfBoundsException::ArrayIndexOutOfBoundsException(
00025 unsigned int lowerBound, unsigned int upperBound,
00026 unsigned int index, char const * fileName, unsigned int lineNumber)
00027 throw()
00028 {
00029 String s;
00030
00031 char val[100];
00032
00033 if(fileName != NULL){
00034 s = fileName;
00035 s += '(';
00036 sprintf(val, "%u", lineNumber);
00037 s += val;
00038 s += "): ";
00039 }
00040
00041 s += "Array Out Of Bounds Exception: ";
00042 sprintf(val, "%u", index);
00043 s += val;
00044 s += " not in [";
00045 sprintf(val, "%u", lowerBound);
00046 s += val;
00047 s += ", ";
00048 sprintf(val, "%u", upperBound);
00049 s += val;
00050 s += ']';
00051
00052 setMessage(s);
00053 }
00054
00056
00057 ArrayIndexOutOfBoundsException::~ArrayIndexOutOfBoundsException() throw()
00058 {
00059
00060 }
00061
00063