// -*- 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 it under 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: Object.jlc,v 1.6 2003/09/27 08:10:28 florian Exp $ */ #include "jakelib2.h" #include "jakelib2/text/enc/CharToByteConverter.h" #include "jakelib2/text/enc/ByteToCharConverter.h" #include "jakelib2/lang/System.h" #include "jakelib2/lang/Exception.h" #include "jakelib2/lang/Mutex.h" #include "jakelib2/lang/Boolean.h" #include "jakelib2/lang/Thread.h" #include "jakelib2/io/File.h" #include "jakelib2/util/Locale.h" #include "jakelib2/util/TimeZone.h" #include "jakelib2/text/DecimalFormat.h" using namespace jakelib::lang; Class Object::_Object_Class(Class::CLASS, "jakelib.lang.Object", null, null); JAKELIB_IMPLEMENT_ARRAY(Object); #ifdef JAKELIB_DEBUG int Object::newCounter = 0; int Object::deleteCounter = 0; #endif /*****************************************************************************\ * Object | *****************************************************************************/ Object::Object() { #ifdef JAKELIB_DEBUG newCounter ++; #endif } Object::~Object() { #ifdef JAKELIB_DEBUG deleteCounter ++; #endif } /*****************************************************************************\ * toString | *****************************************************************************/ String* Object::toString() { return String::emptyString; } /*****************************************************************************\ * hashCode | *****************************************************************************/ jint Object::hashCode() { return 0; } /*****************************************************************************\ * clone | *****************************************************************************/ Object* Object::clone() { throw new CloneNotSupportedException(JAKELIB_AT2("jakelib.lang.Object.clone")); } /*****************************************************************************\ * equals | *****************************************************************************/ jboolean Object::equals(Object* obj) { return (this == obj); } /*****************************************************************************\ * instanceOf | *****************************************************************************/ jboolean Object::instanceOf(String* name) { return getClass()->instanceOf(name); } /*****************************************************************************\ * For debugging purposes | *****************************************************************************/ #ifdef JAKELIB_DEBUG int Object::getNewCounter() { return newCounter; } int Object::getDeleteCounter() { return deleteCounter; } #endif /*****************************************************************************\ * initJakelib | *****************************************************************************/ void initJakelib2(int argc, char* argv[]) { GC_init(); jakelib::lang::String::initStringClass(); jakelib::lang::Boolean::initBooleanClass(); jakelib::io::File::initFileClass(); jakelib::lang::Exception::initExceptionClass(); jakelib::text::enc::CharToByteConverter::initConverters(); jakelib::text::enc::ByteToCharConverter::initConverters(); jakelib::lang::System::initSystemClass(argc, argv); //set_unexpected(); jakelib::io::File::init2FileClass(); #ifdef JAKELIB_THREADS jakelib::lang::Mutex::initMutexClass(); #endif jakelib::lang::Thread::initThreadClass(); jakelib::util::Locale::initLocaleClass(); jakelib::util::TimeZone::initTimeZoneClass(); jakelib::text::DecimalFormat::initDecimalFormatClass(); }