Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

xmog_java_char_array Class Reference
[Arrays]

The wrapper type for the Java char[] type. More...

#include <xmog_java_array.h>

Inheritance diagram for xmog_java_char_array:

Inheritance graph
[legend]
Collaboration diagram for xmog_java_char_array:

Collaboration graph
[legend]
List of all members.

Public Types

typedef xmog_array_iterator<
xmog_java_char_array
iterator
 The iterator type for arrays of char type.
typedef xmog_char value_type
 The type returned by the dereference operations.
typedef ptrdiff_t difference_type
 The type used to represent pointer differences.

Public Member Functions

 xmog_java_char_array ()
 Creates an array instance that does not refer to any Java object.
 xmog_java_char_array (const xmog_null &)
 Creates an array instance that does not refer to any Java object.
 xmog_java_char_array (const xmog_java_char_array &, xmog_localenv *env=NULL)
 Creates an array instance that refers to the same Java instance as the given array.
 xmog_java_char_array (xmog_java_array *_ref, jint _index)
 Creates an array instance that represents an array element itself.
 xmog_java_char_array (xmog_java_ref *_clazz_ref_array, xmog_java_dynamic *_dynamic, xmog_flags _flags=xmog_base::GLOBAL)
 Creates an indirect array instance.
 xmog_java_char_array (xmog_base *_delegate, bool _owns_delegate=true)
 Creates an array instance that delegates to another instance.
 xmog_java_char_array (jobject _local, xmog_flags _flags)
 Creates an array instance that represents a pre-existing JNI reference.
 xmog_java_char_array (jint size, xmog_localenv *env=NULL, xmog_flags=xmog_base::GLOBAL)
 Creates a new array instance of a given size.
 xmog_java_char_array (jchar *arr, jsize size, xmog_localenv *env=NULL, xmog_flags=xmog_base::GLOBAL)
 Creates a new array instance from a JNI jchar[].
iterator begin ()
 Returns an iterator pointing to the first array element.
iterator end ()
 Returns an iterator pointing to after the last array element.
void from_native (jchar *src_arr, jint dest_start, jsize length, xmog_localenv *env=NULL)
 Copies elements from a native array into the Java array.
void to_native (jchar *dest_arr, jint src_start, jsize length, xmog_localenv *env=NULL)
 Copies elements from the Java array into a native array.
xmog_char operator[] (jint index)
 Returns a proxy to a char array element, usable as a lhs-value.
void set (jint index, jchar v, xmog_localenv *env=NULL)
 Sets a value into the array's specified element.
jchar operator[] (jint index) const
 Returns the value of an array element.
jchar get (jint index, xmog_localenv *env) const
 Returns the value of an array element.
xmog_java_char_arrayoperator= (const xmog_java_char_array &)
 Sets the given instance's array reference into this instance.

Static Public Member Functions

static xmog_java_char_array dyna_cast (const xmog_java_ref &_rhs, xmog_localenv *p_lxenv=NULL, xmog_flags flags=xmog_base::GLOBAL)
 A framework method which allows a "cast" of the given object to this array type.
static xmog_java_dynamicget_dynamic ()
 Returns an xmog_java_dynamic instance that can be used to access the array elements of this type.
static xmog_java_classget_class ()
 Returns the proxy wrapper instance for this array type.
static xmog_java_classget_element_java_class ()
 Returns the proxy wrapper instance for this array's element type.

Detailed Description

The wrapper type for the Java char[] type.


Constructor & Destructor Documentation

xmog_java_char_array::xmog_java_char_array jint  size,
xmog_localenv env = NULL,
xmog_flags  = xmog_base::GLOBAL
 

Creates a new array instance of a given size.

Parameters:
size the newly created array's size.
env the local call environment. May be NULL.

xmog_java_char_array::xmog_java_char_array jchar *  arr,
jsize  size,
xmog_localenv env = NULL,
xmog_flags  = xmog_base::GLOBAL
 

Creates a new array instance from a JNI jchar[].

Parameters:
arr the native jchar[].
size the number of elements in the array.
env the local call environment. May be NULL.


Member Function Documentation

static xmog_java_char_array xmog_java_char_array::dyna_cast const xmog_java_ref _rhs,
xmog_localenv p_lxenv = NULL,
xmog_flags  flags = xmog_base::GLOBAL
[static]
 

A framework method which allows a "cast" of the given object to this array type.

You use this method in all places where you would use an explicit class cast in Java. It creates a new instance of the correct type and sets the peer object into it if the peer instance is type compatible. If the peer instance is not type compatible, the newly created object will refer to null.

Parameters:
_rhs a proxy instance which we wish to "cast" to this type.
p_lxenv the local call environment. The default value is NULL.
flags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
an instance of this proxy type that either represents the same Java instance as the argument (if they are type-compatible) or null (if they are not type-compatible).

void xmog_java_char_array::from_native jchar *  src_arr,
jint  dest_start,
jsize  length,
xmog_localenv env = NULL
 

Copies elements from a native array into the Java array.

Parameters:
src_arr a pointer to the native array that provides the elements.
dest_start the index into the Java array to which we start copying.
length the number of elements to copy.
env the local call environment. May be NULL.

jchar xmog_java_char_array::get jint  index,
xmog_localenv env
const
 

Returns the value of an array element.

This method provides the same functionality as the subscript operator, but coupled with the ability to pass in a local call environment for a slight edge in performance.

Parameters:
index the array element index.
env the local call environment. Default value is NULL.

jchar xmog_java_char_array::operator[] jint  index  )  const
 

Returns the value of an array element.

Parameters:
index the array element index.

xmog_char xmog_java_char_array::operator[] jint  index  ) 
 

Returns a proxy to a char array element, usable as a lhs-value.

Parameters:
index the array element index.

void xmog_java_char_array::set jint  index,
jchar  v,
xmog_localenv env = NULL
 

Sets a value into the array's specified element.

This method allows direct assignment into an array element while optionally using a provided local call environment. Consequently it will be higher performing than the subscript operator which provides similar functionality in combination with an assignment operation.

Parameters:
index the array element index.
v the new value.
env the local call environment. Default value is NULL.

void xmog_java_char_array::to_native jchar *  dest_arr,
jint  src_start,
jsize  length,
xmog_localenv env = NULL
 

Copies elements from the Java array into a native array.

Parameters:
dest_arr a pointer to the native array that will receive the elements.
src_start the index in the Java array from which we start copying.
length the number of elements to copy.
env the local call environment. May be NULL.


The documentation for this class was generated from the following file:
Generated on Wed May 31 14:01:28 2006 for Shared Codemesh Runtime Library API Reference by  doxygen 1.4.1