de.aitools.aq.invertedindex.value.pair
Class FloatInt

java.lang.Object
  extended by de.aitools.aq.invertedindex.value.pair.FloatInt
All Implemented Interfaces:
Value

public class FloatInt
extends java.lang.Object
implements Value

Version:
$Id: FloatInt.java,v 1.3 2010/10/15 15:30:13 trenkman Exp $
Author:
[email protected]

Nested Class Summary
 
Nested classes/interfaces inherited from interface de.aitools.aq.invertedindex.value.Value
Value.Check, Value.InvalidArgumentException
 
Field Summary
 
Fields inherited from interface de.aitools.aq.invertedindex.value.Value
SEPARATOR
 
Constructor Summary
FloatInt()
           
FloatInt(FloatInt pair)
           
FloatInt(float e1, int e2)
           
 
Method Summary
 int byteSize()
          Returns the serialized size of this value.
 boolean equals(java.lang.Object obj)
           
 float getE1()
           
 int getE2()
           
 int hashCode()
           
 TokenStream parseFrom(TokenStream in)
          Parses all elements from a TokenStream.
 java.io.PrintStream printTo(java.io.PrintStream out)
          Prints all elements to a .
 java.io.PrintWriter printTo(java.io.PrintWriter out)
          Prints all elements to a .
 void set(int e1, int e2)
           
 void setE1(float e1)
           
 void setE2(int e2)
           
 void toBytes(java.nio.ByteBuffer buffer)
          Serializes all elements into a ByteBuffer.
 void wrap(java.nio.ByteBuffer buffer)
          Deserializes the value from a ByteBuffer.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatInt

public FloatInt()

FloatInt

public FloatInt(float e1,
                int e2)

FloatInt

public FloatInt(FloatInt pair)
Method Detail

getE1

public float getE1()

getE2

public int getE2()

parseFrom

public TokenStream parseFrom(TokenStream in)
                      throws java.io.IOException
Description copied from interface: Value
Parses all elements from a TokenStream.

Specified by:
parseFrom in interface Value
Parameters:
in - the token stream to read the value from.
Returns:
the given token stream.
Throws:
java.io.IOException

printTo

public java.io.PrintWriter printTo(java.io.PrintWriter out)
Description copied from interface: Value
Prints all elements to a . The content printed to the writer is equivalent to the string returned by #toString(), but for serialization purposes this method is much faster since no temporal variables are needed.

Specified by:
printTo in interface Value
Parameters:
out - the print writer to write the value to.
Returns:
the given print writer.

printTo

public java.io.PrintStream printTo(java.io.PrintStream out)
Description copied from interface: Value
Prints all elements to a . The content printed to the stream is equivalent to the string returned by #toString(), but for serialization purposes this method is much faster since no temporal variables are needed.

Specified by:
printTo in interface Value
Parameters:
out - the print stream to write the value to.
Returns:
the given print stream.

setE1

public void setE1(float e1)

setE2

public void setE2(int e2)

set

public void set(int e1,
                int e2)

byteSize

public int byteSize()
Description copied from interface: Value
Returns the serialized size of this value. The return value must be equivalent to the number of bytes written to the ByteBuffer when calling Value.toBytes(ByteBuffer).

Specified by:
byteSize in interface Value
Returns:
the serialized value size in byte.
See Also:
Value.wrap(ByteBuffer), Value.toBytes(ByteBuffer)

toBytes

public void toBytes(java.nio.ByteBuffer buffer)
Description copied from interface: Value
Serializes all elements into a ByteBuffer. Note that the given buffer has the correct ByteOrder, which is by default, but has to be ByteOrder.LITTLE_ENDIAN on Intel machines because of JNI. TODO check automatic buffer resizing if possible ... otherwise there has to be a precondition: buffer.capacity() >= size()

Specified by:
toBytes in interface Value
Parameters:
buffer - a byte buffer to serialize the value to.
See Also:
Value.wrap(ByteBuffer)

wrap

public void wrap(java.nio.ByteBuffer buffer)
Description copied from interface: Value
Deserializes the value from a ByteBuffer. All elements of this value are read from the current get position.

Specified by:
wrap in interface Value
Parameters:
buffer - a byte buffer that contains all elements of this value.
See Also:
Value.toBytes(ByteBuffer)

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