Servertec
Jenie
1.0.1 09/04/2005

stec.jenie
Class Union

java.lang.Object
  extended by stec.jenie.NativeObject
      extended by stec.jenie.Union

public class Union
extends NativeObject

Represents a native union.

Unions can only be passed or returned by functions and callbacks as a pointer to the union.

Since:
1.0.0 12/05/2004

Constructor Summary
Union()
          Constructs a new empty union.
Union(NativeObject[] members)
          Constructs a new union with the specified members.
Union(Pointer pointer, NativeObject[] members)
          Constructs a new union from the specified pointer to a union and having the specified members.
Union(Pointer pointer, Union union)
          Constructs a new union from the specified pointer to a union and with the members of the specified union.
Union(Union union)
          Constructs a new union with the members of the specified union.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this union.
 boolean equals(java.lang.Object object)
          Returns whether this union equals the specified union.
 NativeObject getMemberAt(int index)
          Returns the member of this union at the specified index.
 NativeObject[] getMembers()
          Returns the members of this union.
 void setMembers(NativeObject[] members)
          Sets the members of this union.
 void setMembers(Pointer pointer, NativeObject[] members)
          Sets the union to the specified pointer to a union and having the specified members.
 void setMembers(Pointer pointer, Union union)
          Sets the union to the specified pointer to a union and having the members of the specified union.
 void setMembers(Union union)
          Sets the members of this union with the members of the specified union.
 void setNativeBuffer(NativeBuffer native_buffer)
          Used to the the native buffer.
 
Methods inherited from class stec.jenie.NativeObject
getAlignment, getNativeAddress, getNativeBuffer, getNativeBufferHandle, hashCode, setNativeBuffer, setNativeBuffer, size
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Union

public Union()
Constructs a new empty union.


Union

public Union(NativeObject[] members)
      throws java.lang.OutOfMemoryError
Constructs a new union with the specified members.

Parameters:
members - any members of the union.
Throws:
java.lang.OutOfMemoryError - if there is not enough free memory.

Union

public Union(Union union)
      throws java.lang.OutOfMemoryError
Constructs a new union with the members of the specified union.

Parameters:
union - the union to use.
Throws:
java.lang.OutOfMemoryError - if there is not enough free memory.

Union

public Union(Pointer pointer,
             NativeObject[] members)
Constructs a new union from the specified pointer to a union and having the specified members.

Parameters:
pointer - the pointer to the union.
members - any members of the union.

Union

public Union(Pointer pointer,
             Union union)
Constructs a new union from the specified pointer to a union and with the members of the specified union.

Parameters:
pointer - the pointer to the union.
union - the union to use.
Method Detail

setNativeBuffer

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

Overrides:
setNativeBuffer in class NativeObject
Parameters:
native_buffer - the reference to a native buffer.

setMembers

public void setMembers(NativeObject[] members)
Sets the members of this union.

Parameters:
members - the members to be used.

setMembers

public void setMembers(Union union)
Sets the members of this union with the members of the specified union.

Parameters:
union - the union to use.

setMembers

public void setMembers(Pointer pointer,
                       NativeObject[] members)
Sets the union to the specified pointer to a union and having the specified members.

Parameters:
pointer - the pointer to the union.
members - any members of the union.

setMembers

public void setMembers(Pointer pointer,
                       Union union)
Sets the union to the specified pointer to a union and having the members of the specified union.

Parameters:
pointer - the pointer to the union.
union - the union to use.

getMembers

public NativeObject[] getMembers()
Returns the members of this union.

Returns:
the members of this union.

getMemberAt

public NativeObject getMemberAt(int index)
Returns the member of this union at the specified index.

Parameters:
index - the index of the member to retrieve.
Returns:
the member at the specified index.
Throws:
java.lang.IndexOutOfBoundsException - if the index specified is out of bounds.

clone

public java.lang.Object clone()
                       throws java.lang.OutOfMemoryError
Returns a clone of this union.

Specified by:
clone in class NativeObject
Returns:
the clone of this union.
Throws:
java.lang.OutOfMemoryError - if there is not enough free memory.

equals

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

Overrides:
equals in class NativeObject
Parameters:
object - the union to compare against.
Returns:
whether this union equals the specified union.

Servertec
Jenie
1.0.1 09/04/2005

Copyright © 2004-2005 Servertec. All rights reserved.