com.kenai.jaffl.struct

Class Struct

public abstract class Struct extends Object

Representation of C structures in java. Note: This class is not threadsafe.
Nested Class Summary
protected abstract classStruct.AbstractMember
Base implementation of Member
classStruct.Address
Represents a native memory address.
classStruct.AsciiString
classStruct.AsciiStringRef
protected static classStruct.Constants
Various platform-dependent constants needed for Struct construction
classStruct.Double
classStruct.Enum<T>
classStruct.Enum16<E>
classStruct.Enum32<E>
classStruct.Enum64<E>
classStruct.Enum8<E>
An 8 bit enum field.
protected abstract classStruct.EnumField<E>
Base for all the Enum fields.
classStruct.EnumLong<E>
classStruct.Float
protected interfaceStruct.Member
Interface all Struct members must implement.
protected abstract classStruct.NumberField
Base class for all Number structure fields.
static classStruct.Offset
classStruct.Padding
Specialized padding fields for structs.
classStruct.Pointer
Represents a native memory address.
classStruct.Signed16
A 16 bit signed integer field.
classStruct.Signed32
A 32 bit signed integer field.
classStruct.Signed64
A 64 bit signed integer field.
classStruct.Signed8
An 8 bit signed integer
classStruct.SignedLong
A native long integer field.
abstract classStruct.String
classStruct.Unsigned16
A 16 bit signed integer field.
classStruct.Unsigned32
A 32 bit signed integer field.
classStruct.Unsigned64
A 64 bit unsigned integer field.
classStruct.Unsigned8
An 8 bit unsigned integer
classStruct.UnsignedLong
A native long integer field.
classStruct.UTF8String
classStruct.UTF8StringRef
classStruct.UTFString
classStruct.UTFStringRef
Constructor Summary
protected Struct()
Creates a new Struct.
Method Summary
protected Struct.Signed8[]array(Struct.Signed8[] array)
Creates an array of Signed8 instances.
protected Struct.Unsigned8[]array(Struct.Unsigned8[] array)
Creates an array of Unsigned8 instances.
protected Struct.Signed16[]array(Struct.Signed16[] array)
Creates an array of Signed16 instances.
protected Struct.Unsigned16[]array(Struct.Unsigned16[] array)
Creates an array of Unsigned16 instances.
protected Struct.Signed32[]array(Struct.Signed32[] array)
Creates an array of Signed32 instances.
protected Struct.Unsigned32[]array(Struct.Unsigned32[] array)
Creates an array of Unsigned32 instances.
protected Struct.Signed64[]array(Struct.Signed64[] array)
Creates an array of Signed64 instances.
protected Struct.Unsigned64[]array(Struct.Unsigned64[] array)
Creates an array of Unsigned64 instances.
protected Struct.SignedLong[]array(Struct.SignedLong[] array)
Creates an array of SignedLong instances.
protected Struct.UnsignedLong[]array(Struct.UnsignedLong[] array)
Creates an array of UnsignedLong instances.
protected Struct.Float[]array(Struct.Float[] array)
Creates an array of Float instances.
protected Struct.Double[]array(Struct.Double[] array)
Creates an array of Double instances.
protected Struct.Address[]array(Struct.Address[] array)
Creates an array of Address instances.
protected Struct.Pointer[]array(Struct.Pointer[] array)
Creates an array of Pointer instances.
protected voidarrayBegin()
Starts an array construction session
protected voidarrayEnd()
Ends an array construction session
protected <T extends Struct> Tinner(Struct struct)
voiduseMemory(MemoryIO address)
Uses the specified memory address as the backing store for this structure.
voiduseMemory(Pointer address)
Uses the specified memory address as the backing store for this structure.

Constructor Detail

Struct

protected Struct()
Creates a new Struct.

Method Detail

array

protected final Struct.Signed8[] array(Struct.Signed8[] array)
Creates an array of Signed8 instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.Unsigned8[] array(Struct.Unsigned8[] array)
Creates an array of Unsigned8 instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.Signed16[] array(Struct.Signed16[] array)
Creates an array of Signed16 instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.Unsigned16[] array(Struct.Unsigned16[] array)
Creates an array of Unsigned16 instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.Signed32[] array(Struct.Signed32[] array)
Creates an array of Signed32 instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.Unsigned32[] array(Struct.Unsigned32[] array)
Creates an array of Unsigned32 instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.Signed64[] array(Struct.Signed64[] array)
Creates an array of Signed64 instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.Unsigned64[] array(Struct.Unsigned64[] array)
Creates an array of Unsigned64 instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.SignedLong[] array(Struct.SignedLong[] array)
Creates an array of SignedLong instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.UnsignedLong[] array(Struct.UnsignedLong[] array)
Creates an array of UnsignedLong instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.Float[] array(Struct.Float[] array)
Creates an array of Float instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.Double[] array(Struct.Double[] array)
Creates an array of Double instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.Address[] array(Struct.Address[] array)
Creates an array of Address instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

array

protected final Struct.Pointer[] array(Struct.Pointer[] array)
Creates an array of Pointer instances.

Parameters: array the array to store the instances in

Returns: the array that was passed in

arrayBegin

protected final void arrayBegin()
Starts an array construction session

arrayEnd

protected final void arrayEnd()
Ends an array construction session

inner

protected final <T extends Struct> T inner(Struct struct)

useMemory

public void useMemory(MemoryIO address)
Uses the specified memory address as the backing store for this structure.

Parameters: address the native memory area.

useMemory

public void useMemory(Pointer address)
Uses the specified memory address as the backing store for this structure.

Parameters: address the native memory area.