CACAO
Public Member Functions | Protected Attributes | Private Member Functions
Array Class Reference

This is a generic accessor class for Java arrays (of unspecified type), which can be used to safely operate on Java arrays in native code. More...

Inheritance diagram for Array:
ArrayTemplate< T > ArrayTemplate< classinfo * > ArrayTemplate< double > ArrayTemplate< float > ArrayTemplate< int16_t > ArrayTemplate< int32_t > ArrayTemplate< int64_t > ArrayTemplate< int8_t > ArrayTemplate< java_handle_t * > ArrayTemplate< uint16_t > ArrayTemplate< uint8_t >

Public Member Functions

 Array (java_handle_t *h)
 Constructor checks if passed handle really is a Java array. More...
 
 Array (int32_t length, classinfo *arrayclass)
 Creates an array of the given array type on the heap. More...
 
virtual ~Array ()
 
virtual java_handle_array_tget_handle () const
 
int32_t get_length () const
 
bool is_null () const
 
bool is_non_null () const
 
imm_union get_primitive_element (int32_t index)
 Returns a primitive element of the given Java array. More...
 
void set_primitive_element (int32_t index, imm_union value)
 Sets a primitive element in the given Java array. More...
 
java_handle_tget_boxed_element (int32_t index)
 Returns a boxed element of the given Java array. More...
 
void set_boxed_element (int32_t index, java_handle_t *o)
 Sets a boxed element in the given Java array. More...
 

Protected Attributes

java_handle_array_t_handle
 

Private Member Functions

 Array (Array *a)
 
 Array (Array &a)
 

Detailed Description

This is a generic accessor class for Java arrays (of unspecified type), which can be used to safely operate on Java arrays in native code.

Definition at line 87 of file array.hpp.

Constructor & Destructor Documentation

Array::Array ( Array a)
inlineprivate

Definition at line 94 of file array.hpp.

Array::Array ( Array a)
inlineprivate

Definition at line 95 of file array.hpp.

Array::Array ( java_handle_t h)
inline

Constructor checks if passed handle really is a Java array.

Definition at line 123 of file array.hpp.

Array::Array ( int32_t  size,
classinfo arrayclass 
)
inline

Creates an array of the given array type on the heap.

The handle pointer to the array can be NULL in case of an exception.

Definition at line 149 of file array.hpp.

virtual Array::~Array ( )
inlinevirtual

Definition at line 100 of file array.hpp.

Member Function Documentation

java_handle_t * Array::get_boxed_element ( int32_t  index)

Returns a boxed element of the given Java array.

Definition at line 44 of file array.cpp.

virtual java_handle_array_t* Array::get_handle ( ) const
inlinevirtual

Definition at line 103 of file array.hpp.

int32_t Array::get_length ( ) const
inline

Definition at line 189 of file array.hpp.

imm_union Array::get_primitive_element ( int32_t  index)

Returns a primitive element of the given Java array.

Definition at line 107 of file array.cpp.

bool Array::is_non_null ( ) const
inline

Definition at line 208 of file array.hpp.

bool Array::is_null ( ) const
inline

Definition at line 203 of file array.hpp.

void Array::set_boxed_element ( int32_t  index,
java_handle_t o 
)

Sets a boxed element in the given Java array.

Definition at line 71 of file array.cpp.

void Array::set_primitive_element ( int32_t  index,
imm_union  value 
)

Sets a primitive element in the given Java array.

Definition at line 192 of file array.cpp.

Field Documentation

java_handle_array_t* Array::_handle
protected

Definition at line 90 of file array.hpp.


The documentation for this class was generated from the following files: