Package de.intarsys.nativec.type
Class NativeArray
- java.lang.Object
-
- de.intarsys.nativec.type.NativeObject
-
- de.intarsys.nativec.type.NativeArray
-
- All Implemented Interfaces:
INativeObject
public class NativeArray extends NativeObject
AnINativeObject
that represents a homogeneous (this means of equal length and type) sequence of otherINativeObject
instances.
-
-
Field Summary
Fields Modifier and Type Field Description static NativeArrayType
META
The meta class instance-
Fields inherited from class de.intarsys.nativec.type.NativeObject
DEBUG, handle, SHIFT_INT, SHIFT_LONG, SHIFT_LONGLONG, SIZE_BYTE, SIZE_INT, SIZE_LONG, SIZE_LONGLONG, SIZE_PTR, SIZE_SHORT
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NativeArray(NativeArrayType type)
protected
NativeArray(NativeArrayType type, INativeHandle handle)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NativeArray
create(INativeType baseType, int size)
INativeType
getBaseType()
int
getByteCount()
The number of bytes occupied by this.INativeObject
getNativeObject(int index)
TheINativeObject
at index in the sequence (the index'th element of the array).INativeType
getNativeType()
The meta information and behavior for the NativeObject.int
getSize()
The number of NativeObject instances in the sequence represented by this (in other terms the array size).java.lang.Object
getValue()
A Java side representation from the memory.java.lang.Object
getValue(int index)
void
setBaseType(INativeType baseType)
void
setSize(int size)
void
setValue(int index, java.lang.Object value)
void
setValue(java.lang.Object value)
Assign (and marshall to memory) the Java side representation.java.lang.String
toNestedString()
A string for debugging purposes.java.lang.String
toString()
-
Methods inherited from class de.intarsys.nativec.type.NativeObject
allocate, cast, createReference, getByte, getByteArray, getBytes, getCLong, getInt, getNativeHandle, getNativeHandle, getShort, getString, getWideString, isNull, setByte, setByteArray, setCLong, setInt, setNativeHandle, setShort, setString, setWideString
-
-
-
-
Field Detail
-
META
public static final NativeArrayType META
The meta class instance
-
-
Constructor Detail
-
NativeArray
protected NativeArray(NativeArrayType type)
-
NativeArray
protected NativeArray(NativeArrayType type, INativeHandle handle)
-
-
Method Detail
-
create
public static NativeArray create(INativeType baseType, int size)
-
getBaseType
public INativeType getBaseType()
-
getByteCount
public int getByteCount()
Description copied from class:NativeObject
The number of bytes occupied by this.- Specified by:
getByteCount
in classNativeObject
- Returns:
- The number of bytes occupied by this.
-
getNativeObject
public INativeObject getNativeObject(int index)
TheINativeObject
at index in the sequence (the index'th element of the array).- Parameters:
index
- The index of the element to be reported.- Returns:
- The NativeObject at index
-
getNativeType
public INativeType getNativeType()
Description copied from class:NativeObject
The meta information and behavior for the NativeObject.There is exactly one meta instance for all NativeObject instances of a certain type.
- Specified by:
getNativeType
in interfaceINativeObject
- Specified by:
getNativeType
in classNativeObject
- Returns:
- The meta information and behavior for the NativeObject.
-
getSize
public int getSize()
The number of NativeObject instances in the sequence represented by this (in other terms the array size).- Returns:
- The number of NativeObject instances in the sequence represented by this
-
getValue
public java.lang.Object getValue()
Description copied from interface:INativeObject
A Java side representation from the memory.- Returns:
- A Java side representation for the
INativeObject
.
-
getValue
public java.lang.Object getValue(int index)
-
setBaseType
public void setBaseType(INativeType baseType)
-
setSize
public void setSize(int size)
-
setValue
public void setValue(int index, java.lang.Object value)
-
setValue
public void setValue(java.lang.Object value)
Description copied from interface:INativeObject
Assign (and marshall to memory) the Java side representation.- Parameters:
value
- The new Java value.
-
toNestedString
public java.lang.String toNestedString()
Description copied from class:NativeObject
A string for debugging purposes.- Overrides:
toNestedString
in classNativeObject
- Returns:
- A string for debugging purposes.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-