de.aitools.aq.value.pair
Class LongLong

java.lang.Object
  extended by de.aitools.aq.value.Value
      extended by de.aitools.aq.value.pair.LongLong

public class LongLong
extends Value

Version:
$Id: LongLong.java,v 1.6 2011/04/08 17:25:55 trenkman Exp $
Author:
[email protected]

Field Summary
static int NATIVE_TYPE_ID
           
 
Fields inherited from class de.aitools.aq.value.Value
DELIMITER_C, DELIMITER_S, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_SHORT
 
Constructor Summary
LongLong()
           
LongLong(LongLong value)
           
LongLong(long e1, long e2)
           
 
Method Summary
 void copyFrom(com.sun.jna.Pointer buffer)
          Reads all elements of that value from a piece of memory pointed to by buffer.
 void copyTo(com.sun.jna.Pointer buffer)
          Writes all elements of that value to a piece of memory pointed to by buffer.
 boolean equals(java.lang.Object obj)
           
 long getE1()
           
 long getE2()
           
 int getSerializedSize()
          Returns the size in bytes of this object when serialized.
 com.sun.jna.Memory getSharedMemory()
          Returns a pointer to a piece of memory, that provides space for at least Value.getSerializedSize() bytes and can be directly used in conjunction with Value.copyTo(Pointer) and Value.copyFrom(Pointer).
 int hashCode()
           
 boolean parseFrom(java.util.Scanner sc)
          Parses new content of that value from the given Scanner.
 java.io.PrintStream printTo(java.io.PrintStream ps)
          Prints all elements of that value to a stream in a human-readable format.
 void set(long e1, long e2)
           
 void setE1(long e1)
           
 void setE2(long e2)
           
 
Methods inherited from class de.aitools.aq.value.Value
getNativeTypeId
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NATIVE_TYPE_ID

public static final int NATIVE_TYPE_ID
See Also:
Constant Field Values
Constructor Detail

LongLong

public LongLong()

LongLong

public LongLong(long e1,
                long e2)

LongLong

public LongLong(LongLong value)
Method Detail

copyFrom

public void copyFrom(com.sun.jna.Pointer buffer)
Description copied from class: Value
Reads all elements of that value from a piece of memory pointed to by buffer. You have to make sure, that the size of this buffer is at least Value.getSerializedSize().

Specified by:
copyFrom in class Value
Parameters:
buffer - a pointer to free memory

copyTo

public void copyTo(com.sun.jna.Pointer buffer)
Description copied from class: Value
Writes all elements of that value to a piece of memory pointed to by buffer. You have to make sure, that the size of this buffer is at least Value.getSerializedSize().

Specified by:
copyTo in class Value
Parameters:
buffer - a pointer to free memory

getE1

public long getE1()

getE2

public long getE2()

parseFrom

public boolean parseFrom(java.util.Scanner sc)
Description copied from class: Value
Parses new content of that value from the given Scanner.

Specified by:
parseFrom in class Value
Parameters:
sc - a Scanner to parse the data from
Returns:
true if on success, false otherwise.

printTo

public java.io.PrintStream printTo(java.io.PrintStream ps)
Description copied from class: Value
Prints all elements of that value to a stream in a human-readable format.

Specified by:
printTo in class Value
Parameters:
ps - a stream to print all elements to

setE1

public void setE1(long e1)

setE2

public void setE2(long e2)

set

public void set(long e1,
                long e2)

getSharedMemory

public com.sun.jna.Memory getSharedMemory()
Description copied from class: Value

Returns a pointer to a piece of memory, that provides space for at least Value.getSerializedSize() bytes and can be directly used in conjunction with Value.copyTo(Pointer) and Value.copyFrom(Pointer).

For the sake of efficiency the provided memory may be some sort of shared memory, which can be used temporarily, to transfer data somewhere, e.g. to native code. Please note that the usage of this buffer in multi-threaded code has to be synchronized.

Specified by:
getSharedMemory in class Value
Returns:
a pointer to some shared memory, which is large enough to serialize this object to
See Also:
Value.copyFrom(Pointer), Value.copyTo(Pointer), Value.getSerializedSize()

getSerializedSize

public int getSerializedSize()
Description copied from class: Value
Returns the size in bytes of this object when serialized.

Specified by:
getSerializedSize in class Value
Returns:
the size in bytes

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object