artefaktur
software engineer &        architecture

 
 
 
 

class ObjectArrayBaseImpl

Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::lang::ObjectArrayBaseImpl Class Reference

#include <ObjectArrayBase.h>

Inheritance diagram for acdk::lang::ObjectArrayBaseImpl:

acdk::lang::Object acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch acdk::lang::ObjectArrayBase ObjectArrayImpl< T > List of all members.

Detailed Description

Object implements the array of Object similar to the Java Object[] construct.

Normally will not used directly

Java usage: Integer[] iarray = new Integer[3]; iarray[0] = new Integer(1); ACDK usage: RIntegerArray iarray = new IntegerArray(3); iarray[0] = new Integer(1);

Author:
Roger Rene Kommer
Version:
Revision
1.50
See also:
 Arrays.


Public Types

typedef RObjectarray_iterator

Public Member Functions

 ObjectArrayBaseImpl (int size=0)
 creates an Array with given size

 ObjectArrayBaseImpl (const acdk::lang::dmi::ClazzInfo *elemtype, int size)
 Creating generic ObjectArray with given elemtype as member types Used for DMI.

 ~ObjectArrayBaseImpl ()
virtual Object_cast (const acdk::lang::dmi::ClazzInfo *ci)
 for DMI implemented classes with multiple interface allow casts.

int length () const
 return the count of elements in this array

array_iterator begin ()
 STL like array_iterator.

array_iterator end ()
 STL like iterator.

array_iterator endCap ()
 STL like iterator.

 IN (RObject) getElement(int idx)
 return the element at idx position
Exceptions:
ArrayIndexOutOfBoundsException if idx not in valid range


 OUT (RObject) getElementRef(int idx)
 return the element at idx position as reference (left side value)
Exceptions:
ArrayIndexOutOfBoundsException if idx not in valid range


 OUT (RObject) operator[](int idx)
void setElement (int idx, IN(RObject) value)
 set the element at idx position (method name in DMI is set)
Exceptions:
ArrayIndexOutOfBoundsException if idx not in valid range


void set (int idx, NilRef nil)
 Set element at idx to Nil
Exceptions:
ArrayIndexOutOfBoundsException if idx not in valid range.


void append (IN(RObject) value)
 append value to this array

 OUT (RObject) operator_bo(int idx)
 for DMI operator[](int idx) access

void concat (IN(RObjectArrayBaseImpl) other)
 concat other array to this array

void insert (int idx, IN(RObject) value)
 insert obj into idx possition
Exceptions:
IndexOutOfBoundsException if idx not in valid range


void remove (int idx)
 removes element at idx position
Exceptions:
IndexOutOfBoundsException if idx not in valid range


int find (IN(RObject) el)
 Find equals element (using el->equals()) If el == Nil find first element which also Nil.

int findFirst (IN(RObject) el)
 alias for find(IN(RObject) el)

int findLast (IN(RObject) el)
 find the element from starting with the last element using equals()

int findSame (IN(RObject) el)
 find same object instance (using == instead of equals())

RObject removeEqualElement (IN(RObject) el)
RObject removeSameElement (IN(RObject) el)
 remove element which is same instance

acdk::util::RIterator iterator ()
 creates a read only iterator from this array

acdk::util::RList asContainer (bool copy=false)
 create this as an container (ArrayList)

int capacity () const
 return the capacity of this array

void ensureCapacity (int newsize)
 make sure that internal storage capacity is at least newsize elements

void makeCapacity (int newsize)
virtual int hashCode ()
 return the hashCode of this array

virtual bool equals (IN(RObject) o)
 Normally check for equality (not identity) Object::equals() is true only if both objects are the same instance.

void resize (int newSize)
 hard resize of this array.

RString toString ()
 return stringified representation [element, element] of this array

RObject clone ()
RObject clone (::acdk::lang::sys::Allocator *alc)
RObject pop_back_element ()
 remove element from back and return the removed value

RObject pop_front_element ()
 remove element from front (first element) and return the removed value

 IN (RObject) back_element()
 return the last element

 IN (RObject) front_element()
 STL style function.

void push_front_element (IN(RObject) obj)
 STL style function.

void push_back_element (IN(RObject) obj)
 STL style function.

 IN (RObject) peekElementBack(int idx)
 get the element from index beginning with last element

const acdk::lang::dmi::ClazzInfogetElementClazzInfo ()
void setElementClazzInfo (const acdk::lang::dmi::ClazzInfo *ci)

Static Public Member Functions

RObject create_instance ()
const ObjectArrayBaseImpl_tryCast (const acdk::lang::dmi::ClazzInfo *toClazz, const ObjectArrayBaseImpl *other)
const::acdk::lang::dmi::ClazzMethodInfo * dmiConstructor (::acdk::lang::Object *This, IN(acdk::lang::RString) fname,::acdk::lang::dmi::ScriptVar &ret,::acdk::lang::dmi::ScriptVarArray &args,::acdk::lang::dmi::DmiClient &dc, IN(::acdk::lang::RStringArray) namedArgs, int flags, const::acdk::lang::dmi::ClazzInfo *clazzinfo, const::acdk::lang::dmi::ClazzMethodInfo *methinf)

Protected Member Functions

void _init (int size)
void _dispose ()
void _checkIndexAccess (int idx) const
RObject_createData (int newsize)
void _destroyData ()
void _makeCapacity (int newCap)
void _makeSetSlot (int idx) const
void _makeInsertSlot (int idx)
void _makeAppendSlot ()
RObject _castAssignmentElement (IN(RObject) value) const
 throws ClassCastException if value is not assignable to array element type


Protected Attributes

array_iterator _begin
int _length
array_iterator _endCap
const acdk::lang::dmi::ClazzInfo_elementClazzInfo

Member Typedef Documentation

typedef RObject* acdk::lang::ObjectArrayBaseImpl::array_iterator
 

Reimplemented in ObjectArrayImpl< T >, ObjectArrayImpl< RString >, ObjectArrayImpl< RBucketType >, ObjectArrayImpl< RLispStackFrame >, ObjectArrayImpl< RFile >, ObjectArrayImpl< RLispVar >, and ObjectArrayImpl< RValueType >.


Constructor & Destructor Documentation

acdk::lang::ObjectArrayBaseImpl::ObjectArrayBaseImpl int  size = 0  )  [inline]
 

creates an Array with given size

acdk::lang::ObjectArrayBaseImpl::ObjectArrayBaseImpl const acdk::lang::dmi::ClazzInfo elemtype,
int  size
[inline]
 

Creating generic ObjectArray with given elemtype as member types Used for DMI.

acdk::lang::ObjectArrayBaseImpl::~ObjectArrayBaseImpl  )  [inline]
 


Member Function Documentation

virtual Object* acdk::lang::ObjectArrayBaseImpl::_cast const acdk::lang::dmi::ClazzInfo ci  )  [virtual]
 

for DMI implemented classes with multiple interface allow casts.

The returned Object will be casted to the correct type using dynamic_cast

Parameters:
ci target type
Returns:
0 if cannot be casted

Reimplemented from acdk::lang::ObjectBase.

RObject acdk::lang::ObjectArrayBaseImpl::_castAssignmentElement IN(RObject value  )  const [protected]
 

throws ClassCastException if value is not assignable to array element type

void acdk::lang::ObjectArrayBaseImpl::_checkIndexAccess int  idx  )  const [inline, protected]
 

RObject* acdk::lang::ObjectArrayBaseImpl::_createData int  newsize  )  [inline, protected]
 

void acdk::lang::ObjectArrayBaseImpl::_destroyData  )  [inline, protected]
 

void acdk::lang::ObjectArrayBaseImpl::_dispose  )  [protected]
 

void acdk::lang::ObjectArrayBaseImpl::_init int  size  )  [inline, protected]
 

void acdk::lang::ObjectArrayBaseImpl::_makeAppendSlot  )  [inline, protected]
 

void acdk::lang::ObjectArrayBaseImpl::_makeCapacity int  newCap  )  [protected]
 

void acdk::lang::ObjectArrayBaseImpl::_makeInsertSlot int  idx  )  [protected]
 

void acdk::lang::ObjectArrayBaseImpl::_makeSetSlot int  idx  )  const [inline, protected]
 

const ObjectArrayBaseImpl* acdk::lang::ObjectArrayBaseImpl::_tryCast const acdk::lang::dmi::ClazzInfo toClazz,
const ObjectArrayBaseImpl other
[static]
 

void acdk::lang::ObjectArrayBaseImpl::append IN(RObject value  )  [inline]
 

append value to this array

acdk::util::RList acdk::lang::ObjectArrayBaseImpl::asContainer bool  copy = false  ) 
 

create this as an container (ArrayList)

Parameters:
copy take over this ObjectArray or crate internally an own

array_iterator acdk::lang::ObjectArrayBaseImpl::begin  )  [inline]
 

STL like array_iterator.

Reimplemented in ObjectArrayImpl< T >, ObjectArrayImpl< RString >, ObjectArrayImpl< RBucketType >, ObjectArrayImpl< RLispStackFrame >, ObjectArrayImpl< RFile >, ObjectArrayImpl< RLispVar >, and ObjectArrayImpl< RValueType >.

int acdk::lang::ObjectArrayBaseImpl::capacity  )  const [inline]
 

return the capacity of this array

RObject acdk::lang::ObjectArrayBaseImpl::clone ::acdk::lang::sys::Allocator alc  ) 
 

RObject acdk::lang::ObjectArrayBaseImpl::clone  )  [inline, virtual]
 

See also:
serialized_clone

Reimplemented from acdk::lang::Object.

void acdk::lang::ObjectArrayBaseImpl::concat IN(RObjectArrayBaseImpl other  ) 
 

concat other array to this array

RObject acdk::lang::ObjectArrayBaseImpl::create_instance  )  [static]
 

Reimplemented from acdk::lang::Object.

const ::acdk::lang::dmi::ClazzMethodInfo* acdk::lang::ObjectArrayBaseImpl::dmiConstructor ::acdk::lang::Object This,
IN(acdk::lang::RString fname,
::acdk::lang::dmi::ScriptVar ret,
::acdk::lang::dmi::ScriptVarArray args,
::acdk::lang::dmi::DmiClient dc,
IN(::acdk::lang::RStringArray namedArgs,
int  flags,
const::acdk::lang::dmi::ClazzInfo *  clazzinfo,
const::acdk::lang::dmi::ClazzMethodInfo *  methinf
[static]
 

array_iterator acdk::lang::ObjectArrayBaseImpl::end  )  [inline]
 

STL like iterator.

Reimplemented in ObjectArrayImpl< T >, ObjectArrayImpl< RString >, ObjectArrayImpl< RBucketType >, ObjectArrayImpl< RLispStackFrame >, ObjectArrayImpl< RFile >, ObjectArrayImpl< RLispVar >, and ObjectArrayImpl< RValueType >.

array_iterator acdk::lang::ObjectArrayBaseImpl::endCap  )  [inline]
 

STL like iterator.

void acdk::lang::ObjectArrayBaseImpl::ensureCapacity int  newsize  ) 
 

make sure that internal storage capacity is at least newsize elements

virtual bool acdk::lang::ObjectArrayBaseImpl::equals IN(RObject o  )  [virtual]
 

Normally check for equality (not identity) Object::equals() is true only if both objects are the same instance.

See also:
serialized_equals()

Reimplemented from acdk::lang::Object.

int acdk::lang::ObjectArrayBaseImpl::find IN(RObject el  )  [inline]
 

Find equals element (using el->equals()) If el == Nil find first element which also Nil.

Returns:
found index position or -1

int acdk::lang::ObjectArrayBaseImpl::findFirst IN(RObject el  )  [inline]
 

alias for find(IN(RObject) el)

int acdk::lang::ObjectArrayBaseImpl::findLast IN(RObject el  )  [inline]
 

find the element from starting with the last element using equals()

Returns:
found index position or -1

int acdk::lang::ObjectArrayBaseImpl::findSame IN(RObject el  )  [inline]
 

find same object instance (using == instead of equals())

Returns:
found index position or -1 of not found

const acdk::lang::dmi::ClazzInfo* acdk::lang::ObjectArrayBaseImpl::getElementClazzInfo  )  [inline]
 

virtual int acdk::lang::ObjectArrayBaseImpl::hashCode  )  [virtual]
 

return the hashCode of this array

Reimplemented from acdk::lang::Object.

acdk::lang::ObjectArrayBaseImpl::IN RObject   )  [inline]
 

get the element from index beginning with last element

acdk::lang::ObjectArrayBaseImpl::IN RObject   )  [inline]
 

STL style function.

acdk::lang::ObjectArrayBaseImpl::IN RObject   )  [inline]
 

return the last element

acdk::lang::ObjectArrayBaseImpl::IN RObject   )  [inline]
 

return the element at idx position

Exceptions:
ArrayIndexOutOfBoundsException if idx not in valid range

void acdk::lang::ObjectArrayBaseImpl::insert int  idx,
IN(RObject value
[inline]
 

insert obj into idx possition

Exceptions:
IndexOutOfBoundsException if idx not in valid range

acdk::util::RIterator acdk::lang::ObjectArrayBaseImpl::iterator  ) 
 

creates a read only iterator from this array

int acdk::lang::ObjectArrayBaseImpl::length  )  const [inline]
 

return the count of elements in this array

void acdk::lang::ObjectArrayBaseImpl::makeCapacity int  newsize  )  [inline]
 

acdk::lang::ObjectArrayBaseImpl::OUT RObject   )  [inline]
 

for DMI operator[](int idx) access

acdk::lang::ObjectArrayBaseImpl::OUT RObject   )  [inline]
 

acdk::lang::ObjectArrayBaseImpl::OUT RObject   )  [inline]
 

return the element at idx position as reference (left side value)

Exceptions:
ArrayIndexOutOfBoundsException if idx not in valid range

RObject acdk::lang::ObjectArrayBaseImpl::pop_back_element  )  [inline]
 

remove element from back and return the removed value

RObject acdk::lang::ObjectArrayBaseImpl::pop_front_element  )  [inline]
 

remove element from front (first element) and return the removed value

void acdk::lang::ObjectArrayBaseImpl::push_back_element IN(RObject obj  )  [inline]
 

STL style function.

void acdk::lang::ObjectArrayBaseImpl::push_front_element IN(RObject obj  )  [inline]
 

STL style function.

void acdk::lang::ObjectArrayBaseImpl::remove int  idx  ) 
 

removes element at idx position

Exceptions:
IndexOutOfBoundsException if idx not in valid range

RObject acdk::lang::ObjectArrayBaseImpl::removeEqualElement IN(RObject el  )  [inline]
 

RObject acdk::lang::ObjectArrayBaseImpl::removeSameElement IN(RObject el  )  [inline]
 

remove element which is same instance

Returns:
Nil if not found

void acdk::lang::ObjectArrayBaseImpl::resize int  newSize  ) 
 

hard resize of this array.

if newSize is less than current size elements will be deleted. if newSize is greater thatn current size new element will be set to Nil

void acdk::lang::ObjectArrayBaseImpl::set int  idx,
NilRef  nil
[inline]
 

Set element at idx to Nil

Exceptions:
ArrayIndexOutOfBoundsException if idx not in valid range.

void acdk::lang::ObjectArrayBaseImpl::setElement int  idx,
IN(RObject value
[inline]
 

set the element at idx position (method name in DMI is set)

Exceptions:
ArrayIndexOutOfBoundsException if idx not in valid range

void acdk::lang::ObjectArrayBaseImpl::setElementClazzInfo const acdk::lang::dmi::ClazzInfo ci  )  [inline]
 

RString acdk::lang::ObjectArrayBaseImpl::toString  )  [virtual]
 

return stringified representation [element, element] of this array

Reimplemented from acdk::lang::Object.


Member Data Documentation

array_iterator acdk::lang::ObjectArrayBaseImpl::_begin [protected]
 

const acdk::lang::dmi::ClazzInfo* acdk::lang::ObjectArrayBaseImpl::_elementClazzInfo [protected]
 

array_iterator acdk::lang::ObjectArrayBaseImpl::_endCap [protected]
 

int acdk::lang::ObjectArrayBaseImpl::_length [protected]
 

 
Last modified 2005-05-08 18:32 by SYSTEM By Artefaktur, Ing. Bureau Kommer