net.threebit.jvr
Class DV_DIGIT

java.lang.Object
  extended bynet.threebit.jvr.JVRBaseClass
      extended bynet.threebit.jvr.JvrJni
          extended bynet.threebit.jvr.DV_DIGIT
All Implemented Interfaces:
java.io.Serializable

public class DV_DIGIT
extends JvrJni

Java representation of the DV_DIGIT struct.

See Also:
Serialized Form

Field Summary
private static java.lang.Object lock
          A private locking object.
private  int offset
          Offset of the DV_DIGIT struct buffer allocated to this instance.
 
Fields inherited from class net.threebit.jvr.JVRBaseClass
logger
 
Constructor Summary
DV_DIGIT()
          Calls allocateBuffer().
 
Method Summary
static int allocateBuffer()
          Allocates a native-context DV_DIGIT struct for this instance of DV_DIGIT.
 void finalize()
          Ensures that the DV_DIGIT structure allocated to this instance is released.
 java.lang.String getDigits()
          Accesses the native-context DV_DIGIT structure and converts the collected digits to a string.
private static java.lang.String getDigits(int offset)
          Private, native version of getDigits instance method.
static void releaseBuffer(int offset)
          Releases the native-context DV_DIGIT structure.
 java.lang.String toString()
          Returns the digits collected into this DV_DIGIT instance.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lock

private static final java.lang.Object lock
A private locking object. By using lock as a synchronization point in the Java context, we negate the need to perform thread-safe locking in the JNI context.


offset

private int offset
Offset of the DV_DIGIT struct buffer allocated to this instance.

Constructor Detail

DV_DIGIT

public DV_DIGIT()
         throws JVRException
Calls allocateBuffer().

Method Detail

allocateBuffer

public static int allocateBuffer()
                          throws JVRException
Allocates a native-context DV_DIGIT struct for this instance of DV_DIGIT.

Throws:
JVRException

releaseBuffer

public static void releaseBuffer(int offset)
                          throws JVRException
Releases the native-context DV_DIGIT structure.

Throws:
JVRException

getDigits

public java.lang.String getDigits()
                           throws JVRException
Accesses the native-context DV_DIGIT structure and converts the collected digits to a string.

Throws:
JVRException

getDigits

private static java.lang.String getDigits(int offset)
                                   throws JVRException
Private, native version of getDigits instance method.

Throws:
JVRException

toString

public java.lang.String toString()
Returns the digits collected into this DV_DIGIT instance. Example:
 DV_DIGIT digits;
 // ... previous calls to dx.getdig()
 logger.info("The caller typed in '"+digits+"'");
 


finalize

public void finalize()
Ensures that the DV_DIGIT structure allocated to this instance is released.