com.odi.jcpp
Class charPU

java.lang.Object
  |
  +--com.odi.jcpp.charPU

public class charPU
extends java.lang.Object

The charPU class is the unsafe counterpart class for the charP class. The charPU class contains static methods for unsafe operations on instances of the associated peer class, charP. Unsafe operations include operations such as array access and casting.


Method Summary
static charP cast(PeerPointer p)
          Creates a charP object and uses the same linear object reference (linear address) as the specified peer pointer object.
static void deleteArray(byte[] linearObjectReference)
          Deallocates a C++ character array.
static void deleteArray(charP theArray)
          Deallocates a C++ character array.
static charP makeArray(Placement p, int size)
          Creates a C++ array in which the type of the elements is char.
static char ref(charP theArray, int index)
          Returns a particular element from the specified C++ array.
static void set(charP theArray, int index, char newValue)
          Sets the array element in the specified position to the specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeArray

public static charP makeArray(Placement p,
                              int size)
Creates a C++ array in which the type of the elements is char. ObjectStore places the array in the specified placement and creates the specified number of elements.

Parameters:
p - The placement in which to allocate the array.

size - The number of elements in the array.

Returns:
A charP object whose linear address refers to the newly created object.

deleteArray

public static void deleteArray(charP theArray)
Deallocates a C++ character array.

Parameters:
theArray - The C++ array you want to delete.


deleteArray

public static void deleteArray(byte[] linearObjectReference)
Deallocates a C++ character array.

Parameters:
linearObjectReference - The linear object reference of the C++ array you want to delete.


ref

public static char ref(charP theArray,
                       int index)
Returns a particular element from the specified C++ array.

Parameters:
theArray - The array that contains the element you want.

index - The position of the desired element in the array. Postions begin at 0. If you want the third element, specify 2.

Returns:
The element at the specified position.

set

public static void set(charP theArray,
                       int index,
                       char newValue)
Sets the array element in the specified position to the specified value.

Parameters:
theArray - The array that contains the element for which you want to specify a value.

index - The position of the element in the array.
newValue - The value for the element in the specified position.

cast

public static charP cast(PeerPointer p)
Creates a charP object and uses the same linear object reference (linear address) as the specified peer pointer object. Typically, this is useful when you have a return value of type voidP and you know it should be of type charP.

Parameters:
p - The peer pointer object whose linear address you want to copy.

Returns:
The newly created charP object.


Copyright 2004 Progress Software Corporation. All rights reserved.