/* Generated automatically by jlpp - do not edit. */ #include static jakelib::lang::String* jakelib2_strings[] = {null, null, null, null, null, null, null}; // "" static jchar chars_jakelib2_str_0[] = {0}; // " > " static jchar chars_jakelib2_str_1[] = {32,62,32}; // "" static jchar chars_jakelib2_str_2[] = {0}; // " < 0" static jchar chars_jakelib2_str_3[] = {32,60,32,48}; // "Could not reallocate to " static jchar chars_jakelib2_str_4[] = {67,111,117,108,100,32,110,111,116,32,114,101,97,108,108,111,99,97,116,101,32,116,111,32}; // " bytes." static jchar chars_jakelib2_str_5[] = {32,98,121,116,101,115,46}; // "Attempt to initialize array with null value." static jchar chars_jakelib2_str_6[] = {65,116,116,101,109,112,116,32,116,111,32,105,110,105,116,105,97,108,105,122,101,32,97,114,114,97,121,32,119,105,116,104,32,110,117,108,108,32,118,97,108,117,101,46}; #line 1 "lang/Array.jlc" // -*- c++ -*- /* * Jakelib2 - General purpose C++ library * Copyright (C) 2001 Florian Wolff (florian@donuz.de) * * This library is free software; you can redistribute it and/or * modify iunder the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: Array.jlc,v 1.7 2003/09/27 08:10:28 florian Exp $ */ #include "jakelib2.h" #include "jakelib2/lang/System.h" using namespace jakelib::lang; /*****************************************************************************\ * length | *****************************************************************************/ jint Array::length() { return size; } /*****************************************************************************\ * inLimits | *****************************************************************************/ jboolean Array::inLimits(jint idx) { return ((idx >= 0) && (idx < this->size)); } /*****************************************************************************\ * throwIOBExc | *****************************************************************************/ void Array::throwIOBExc(jint idx) { if (idx >= size) { throw new ArrayIndexOutOfBoundsException(JAKELIB_ONDEMAND(jakelib2_strings[0], new jakelib::lang::String(chars_jakelib2_str_0, 0, 0)) ->plus( idx )->plus( JAKELIB_ONDEMAND(jakelib2_strings[1], new jakelib::lang::String(chars_jakelib2_str_1, 0, 3)) )->plus( (size-1))); } else if (idx < 0) { throw new ArrayIndexOutOfBoundsException(JAKELIB_ONDEMAND(jakelib2_strings[2], new jakelib::lang::String(chars_jakelib2_str_2, 0, 0)) ->plus( idx )->plus( JAKELIB_ONDEMAND(jakelib2_strings[3], new jakelib::lang::String(chars_jakelib2_str_3, 0, 4)))); } } /*****************************************************************************\ * throwMemExc | *****************************************************************************/ void Array::throwMemExc(jint sze) { destroy(); throw new MemoryException(JAKELIB_ONDEMAND(jakelib2_strings[4], new jakelib::lang::String(chars_jakelib2_str_4, 0, 24)) ->plus( sze )->plus( JAKELIB_ONDEMAND(jakelib2_strings[5], new jakelib::lang::String(chars_jakelib2_str_5, 0, 7)))); } /*****************************************************************************\ * throwNPtrExc | *****************************************************************************/ void Array::throwNPtrExc() { throw new NullPointerException(JAKELIB_ONDEMAND(jakelib2_strings[6], new jakelib::lang::String(chars_jakelib2_str_6, 0, 44))); } JAKELIB_IMPLEMENT_PRIMITIVE_ARRAY(jbyte); JAKELIB_IMPLEMENT_PRIMITIVE_ARRAY(jint); JAKELIB_IMPLEMENT_PRIMITIVE_ARRAY(jlong); JAKELIB_IMPLEMENT_PRIMITIVE_ARRAY(jdouble); JAKELIB_IMPLEMENT_PRIMITIVE_ARRAY(jfloat); JAKELIB_IMPLEMENT_PRIMITIVE_ARRAY(jchar); JAKELIB_IMPLEMENT_PRIMITIVE_ARRAY(jboolean); JAKELIB_IMPLEMENT_PRIMITIVE_ARRAY(jshort);