org.xbig.base
Enum WithoutNativeObject

java.lang.Object
  extended by java.lang.Enum<WithoutNativeObject>
      extended by org.xbig.base.WithoutNativeObject
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<WithoutNativeObject>

public enum WithoutNativeObject
extends java.lang.Enum<WithoutNativeObject>

Used as parameter for special constructors of NativeObjects. These constructors allow creation of Java objects without creating a C++ object. This is needed when a return value must be passed as parameter. There are two cases where this happens:

In the first case the returned C++ object is only valid inside the JNI function. To make it available in Java it must be copied to the heap and thus deleted by the Java developer. To make sure a Java developer knows about that, he has to pass a Java object as parameter which must be deleted afterwards. That object does not need to correspond to a C++ object because it will after the method returns. To create the parameter object without a C++ object the constructor using this enum as parameter can be used. The value I_WILL_DELETE_THIS_OBJECT is intended to be used in this case.

The second case is described in INativeObject. The value I_WILL_DISCONNECT_THIS_OBJECT should be used then.

If you think you have the second case make sure that that template is not returned by value! If it is returned by value you have the first case!

See Also:
INativeObject.disconnectFromNativeObject()

Enum Constant Summary
I_WILL_DELETE_THIS_OBJECT
           
I_WILL_DISCONNECT_THIS_OBJECT
           
 
Method Summary
static WithoutNativeObject valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static WithoutNativeObject[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

I_WILL_DELETE_THIS_OBJECT

public static final WithoutNativeObject I_WILL_DELETE_THIS_OBJECT

I_WILL_DISCONNECT_THIS_OBJECT

public static final WithoutNativeObject I_WILL_DISCONNECT_THIS_OBJECT
Method Detail

values

public static WithoutNativeObject[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (WithoutNativeObject c : WithoutNativeObject.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static WithoutNativeObject valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null


Copyright © 2007 netAllied GmbH. All Rights Reserved.