Servertec
Jenie
1.0.1 09/04/2005

stec.jenie
Class NativeObject

java.lang.Object
  extended by stec.jenie.NativeObject
Direct Known Subclasses:
AnsiString, BOOL, DOUBLE, FLOAT, INT, INT16, INT32, INT64, INT8, NativeArray, Pointer, Structure, UINT, UINT16, UINT32, UINT64, UINT8, Union, WideString

public abstract class NativeObject
extends java.lang.Object

Base class that all native objects must extend.

Since:
1.0.0 12/05/2004

Constructor Summary
NativeObject()
          Constructs a new native object.
NativeObject(int size)
          Constructs a new native object or specified size.
NativeObject(long pointer, int size)
          Constructs a new native object using the specified native pointer and size.
NativeObject(Pointer pointer, int size)
          Constructs a new native object using the specified pointer and size.
 
Method Summary
abstract  java.lang.Object clone()
          Returns a clone of this native object.
 boolean equals(java.lang.Object object)
          Returns whether this native object equals the specified native object.
 int getAlignment()
          Returns the alignment of this native object.
 long getNativeAddress()
          Returns the native address of the native buffer.
 NativeBuffer getNativeBuffer()
          Returns the native buffer.
 long getNativeBufferHandle()
          Returns the native handle to the native buffer.
 int hashCode()
          Returns the hash code of the native buffer.
 void setNativeBuffer(long pointer, int size)
          Sets the bative buffer of specified size using the specified native pointer to a native buffer.
 void setNativeBuffer(NativeBuffer native_buffer)
          Sets the native buffer to the specified native buffer.
 void setNativeBuffer(Pointer pointer, int size)
          Sets the native buffer of specified size using the specified pointer to a native buffer.
 int size()
          Returns the size in bytes of the native buffer.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeObject

public NativeObject()
Constructs a new native object.


NativeObject

public NativeObject(int size)
             throws java.lang.OutOfMemoryError,
                    java.lang.IllegalArgumentException
Constructs a new native object or specified size.

Parameters:
size - the size in bytes. 1 or more.
Throws:
java.lang.OutOfMemoryError - if there is not enough free memory.
java.lang.IllegalArgumentException - if the size specified is less than one (1).

NativeObject

public NativeObject(Pointer pointer,
                    int size)
Constructs a new native object using the specified pointer and size.

Parameters:
pointer - the pointer to the native object.
size - the size in bytes of the native object. -1 for unknown size.

NativeObject

public NativeObject(long pointer,
                    int size)
Constructs a new native object using the specified native pointer and size.

Parameters:
pointer - the native pointer to the native object.
size - the size in bytes of the native object. -1 for unknown size.
Method Detail

size

public int size()
Returns the size in bytes of the native buffer.

Returns:
the size in bytes of the native buffer.

hashCode

public int hashCode()
Returns the hash code of the native buffer.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code of the native buffer.

equals

public boolean equals(java.lang.Object object)
Returns whether this native object equals the specified native object.

Overrides:
equals in class java.lang.Object
Parameters:
object - the native object to compare against.
Returns:
whether this native object equals the specified native object.

getNativeBuffer

public NativeBuffer getNativeBuffer()
Returns the native buffer.

Returns:
the native buffer.

getNativeBufferHandle

public long getNativeBufferHandle()
Returns the native handle to the native buffer.


setNativeBuffer

public void setNativeBuffer(NativeBuffer native_buffer)
Sets the native buffer to the specified native buffer.

Parameters:
native_buffer - the native buffer.

setNativeBuffer

public void setNativeBuffer(Pointer pointer,
                            int size)
Sets the native buffer of specified size using the specified pointer to a native buffer.

Parameters:
pointer - the pointer to the native buffer.
size - the size of the native buffer. -1 if unknown.

setNativeBuffer

public void setNativeBuffer(long pointer,
                            int size)
Sets the bative buffer of specified size using the specified native pointer to a native buffer.

Parameters:
pointer - the handle to the native buffer.
size - the size of the native buffer. -1 if unknown.

getNativeAddress

public long getNativeAddress()
Returns the native address of the native buffer.

Returns:
the native address of the native buffer.

clone

public abstract java.lang.Object clone()
Returns a clone of this native object.

Overrides:
clone in class java.lang.Object
Returns:
the clone of this native object.

getAlignment

public int getAlignment()
Returns the alignment of this native object.

Returns:
the alignment of this native object.

Servertec
Jenie
1.0.1 09/04/2005

Copyright © 2004-2005 Servertec. All rights reserved.