org.firebirdsql.gds.impl.jni
Class XSQLVARLittleEndianImpl

java.lang.Object
  extended by org.firebirdsql.gds.XSQLVAR
      extended by org.firebirdsql.gds.impl.jni.XSQLVARImpl
          extended by org.firebirdsql.gds.impl.jni.XSQLVARLittleEndianImpl

public class XSQLVARLittleEndianImpl
extends XSQLVARImpl

Implementation of XSQLVAR class for little-endian platforms (like Windows, x86 Linux, x86 FreeBSD, etc).


Field Summary
 
Fields inherited from class org.firebirdsql.gds.XSQLVAR
aliasname, coder, ownname, relname, sqldata, sqllen, sqlname, sqlscale, sqlsubtype, sqltype
 
Constructor Summary
XSQLVARLittleEndianImpl()
          Create default instance of this class.
XSQLVARLittleEndianImpl(int sqltype, int sqlscale, int sqlsubtype, int sqllen, byte[] sqldata, String sqlname, String relname, String ownname, String aliasname)
          Create instance of this class for the specified XSQLVAR parameters.
 
Method Summary
 Date decodeDate(byte[] byte_int)
          Decode a byte array into a Date value.
 Date decodeDate(Date d, Calendar cal)
          Decode a Date value using a given Calendar.
 double decodeDouble(byte[] byte_int)
          Decode a byte array into a double value.
 float decodeFloat(byte[] byte_int)
          Decode a byte array into a float value.
 int decodeInt(byte[] byte_int)
          Decode a byte array into an int value.
 long decodeLong(byte[] byte_int)
          Decode a byte array into a long value.
 short decodeShort(byte[] byte_int)
          Decode a byte array into a short value.
 String decodeString(byte[] value, String encoding, String mappingPath)
          Decode an encoded byte array into a String using a given encoding.
 Time decodeTime(byte[] int_byte)
          Decode a byte array into a Time value.
 Time decodeTime(Time d, Calendar cal)
           
 Timestamp decodeTimestamp(byte[] byte_int)
          Decode a byte array into a Timestamp.
 Timestamp decodeTimestamp(Timestamp value, Calendar cal)
          Decode a Timestamp value using a given Calendar.
 XSQLVAR deepCopy()
          Get a deep copy of this object.
 byte[] encodeDate(Date d)
          Encode a Date value into a byte array.
 Date encodeDate(Date d, Calendar cal)
          Encode a given Date value using a given Calendar.
 byte[] encodeDouble(double value)
          Encode a double value as a byte array.
 byte[] encodeFloat(float value)
          Encode a float value as a byte array.
 byte[] encodeInt(int value)
          Encode an int value as a byte array.
 byte[] encodeLong(long value)
          Encode a long value as a byte array.
 byte[] encodeShort(short value)
          Encode a short value as a byte array.
 byte[] encodeString(byte[] value, String encoding, String mappingPath)
          Encode a byte array using a given encoding.
 byte[] encodeString(String value, String encoding, String mappingPath)
          Encode a String value into a byte array using a given encoding.
 byte[] encodeTime(Time d)
          Encode a Time value into a byte array.
 Time encodeTime(Time d, Calendar cal)
           
 byte[] encodeTimestamp(Timestamp value)
          Encode a Timstamp as a byte array.
 Timestamp encodeTimestamp(Timestamp value, Calendar cal)
          Encode a Timestamp using a given Calendar.
 
Methods inherited from class org.firebirdsql.gds.XSQLVAR
copyFrom, copyFrom, decodeTime, decodeTimestamp, encodeTime, encodeTimestamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSQLVARLittleEndianImpl

public XSQLVARLittleEndianImpl()
Create default instance of this class.


XSQLVARLittleEndianImpl

public XSQLVARLittleEndianImpl(int sqltype,
                               int sqlscale,
                               int sqlsubtype,
                               int sqllen,
                               byte[] sqldata,
                               String sqlname,
                               String relname,
                               String ownname,
                               String aliasname)
Create instance of this class for the specified XSQLVAR parameters.

Method Detail

deepCopy

public XSQLVAR deepCopy()
Description copied from class: XSQLVAR
Get a deep copy of this object.

Overrides:
deepCopy in class XSQLVAR
Returns:
deep copy of this object.

encodeShort

public byte[] encodeShort(short value)
Description copied from class: XSQLVAR
Encode a short value as a byte array.

Overrides:
encodeShort in class XSQLVAR
Parameters:
value - The value to be encoded
Returns:
The value of value encoded as a byte array

decodeShort

public short decodeShort(byte[] byte_int)
Description copied from class: XSQLVAR
Decode a byte array into a short value.

Overrides:
decodeShort in class XSQLVAR
Parameters:
byte_int - The byte array to be decoded
Returns:
The short value of the decoded byte array

encodeInt

public byte[] encodeInt(int value)
Description copied from class: XSQLVAR
Encode an int value as a byte array.

Overrides:
encodeInt in class XSQLVAR
Parameters:
value - The value to be encoded
Returns:
The value of value encoded as a byte array

decodeInt

public int decodeInt(byte[] byte_int)
Description copied from class: XSQLVAR
Decode a byte array into an int value.

Overrides:
decodeInt in class XSQLVAR
Parameters:
byte_int - The byte array to be decoded
Returns:
The int value of the decoded byte array

encodeLong

public byte[] encodeLong(long value)
Description copied from class: XSQLVAR
Encode a long value as a byte array.

Overrides:
encodeLong in class XSQLVAR
Parameters:
value - The value to be encoded
Returns:
The value of value encoded as a byte array

decodeLong

public long decodeLong(byte[] byte_int)
Description copied from class: XSQLVAR
Decode a byte array into a long value.

Overrides:
decodeLong in class XSQLVAR
Parameters:
byte_int - The byte array to be decoded
Returns:
The long value of the decoded byte array

encodeFloat

public byte[] encodeFloat(float value)
Description copied from class: XSQLVAR
Encode a float value as a byte array.

Overrides:
encodeFloat in class XSQLVAR
Parameters:
value - The value to be encoded
Returns:
The value of value encoded as a byte array

decodeFloat

public float decodeFloat(byte[] byte_int)
Description copied from class: XSQLVAR
Decode a byte array into a float value.

Overrides:
decodeFloat in class XSQLVAR
Parameters:
byte_int - The byte array to be decoded
Returns:
The float value of the decoded byte array

encodeDouble

public byte[] encodeDouble(double value)
Description copied from class: XSQLVAR
Encode a double value as a byte array.

Overrides:
encodeDouble in class XSQLVAR
Parameters:
value - The value to be encoded
Returns:
The value of value encoded as a byte array

decodeDouble

public double decodeDouble(byte[] byte_int)
Description copied from class: XSQLVAR
Decode a byte array into a double value.

Overrides:
decodeDouble in class XSQLVAR
Parameters:
byte_int - The byte array to be decoded
Returns:
The double value of the decoded byte array

encodeString

public byte[] encodeString(String value,
                           String encoding,
                           String mappingPath)
                    throws SQLException
Description copied from class: XSQLVAR
Encode a String value into a byte array using a given encoding.

Overrides:
encodeString in class XSQLVAR
Parameters:
value - The String to be encoded
encoding - The encoding to use in the encoding process
mappingPath - The character mapping path to be used in the encoding
Returns:
The value of value as a byte array
Throws:
SQLException - if the given encoding cannot be found, or an error occurs during the encoding

encodeString

public byte[] encodeString(byte[] value,
                           String encoding,
                           String mappingPath)
                    throws SQLException
Description copied from class: XSQLVAR
Encode a byte array using a given encoding.

Overrides:
encodeString in class XSQLVAR
Parameters:
value - The byte array to be encoded
encoding - The encoding to use in the encoding process
mappingPath - The character mapping path to be used in the encoding
Returns:
The value of value encoded using the given encoding
Throws:
SQLException - if the given encoding cannot be found, or an error occurs during the encoding

decodeString

public String decodeString(byte[] value,
                           String encoding,
                           String mappingPath)
                    throws SQLException
Description copied from class: XSQLVAR
Decode an encoded byte array into a String using a given encoding.

Overrides:
decodeString in class XSQLVAR
Parameters:
value - The value to be decoded
encoding - The encoding to be used in the decoding process
mappingPath - The character mapping path to be used in the decoding
Returns:
The decoded String
Throws:
SQLException - if the given encoding cannot be found, or an error occurs during the decoding

encodeTimestamp

public Timestamp encodeTimestamp(Timestamp value,
                                 Calendar cal)
Description copied from class: XSQLVAR
Encode a Timestamp using a given Calendar.

Overrides:
encodeTimestamp in class XSQLVAR
Parameters:
value - The Timestamp to be encoded
cal - The Calendar to be used for encoding, may be null

encodeTimestamp

public byte[] encodeTimestamp(Timestamp value)
Description copied from class: XSQLVAR
Encode a Timstamp as a byte array.

Overrides:
encodeTimestamp in class XSQLVAR
Parameters:
value - The Timstamp to be encoded
Returns:
The array of bytes that represents the given Timestamp value

decodeTimestamp

public Timestamp decodeTimestamp(Timestamp value,
                                 Calendar cal)
Description copied from class: XSQLVAR
Decode a Timestamp value using a given Calendar.

Overrides:
decodeTimestamp in class XSQLVAR
Parameters:
value - The Timestamp to be decoded
cal - The Calendar to be used in decoding, may be null
Returns:
The decoded Timestamp

decodeTimestamp

public Timestamp decodeTimestamp(byte[] byte_int)
Description copied from class: XSQLVAR
Decode a byte array into a Timestamp.

Overrides:
decodeTimestamp in class XSQLVAR
Parameters:
byte_int - The byte array to be decoded
Returns:
A Timestamp value from the decoded bytes

encodeTime

public Time encodeTime(Time d,
                       Calendar cal)

encodeTime

public byte[] encodeTime(Time d)
Description copied from class: XSQLVAR
Encode a Time value into a byte array.

Overrides:
encodeTime in class XSQLVAR
Parameters:
d - The Time to be encoded
Returns:
The array of bytes representing the given Time

decodeTime

public Time decodeTime(Time d,
                       Calendar cal)

decodeTime

public Time decodeTime(byte[] int_byte)
Description copied from class: XSQLVAR
Decode a byte array into a Time value.

Overrides:
decodeTime in class XSQLVAR
Parameters:
int_byte - The byte array to be decoded
Returns:
The decoded Time

encodeDate

public Date encodeDate(Date d,
                       Calendar cal)
Description copied from class: XSQLVAR
Encode a given Date value using a given Calendar.

Overrides:
encodeDate in class XSQLVAR
Parameters:
d - The Date to be encoded
cal - The Calendar to be used in the encoding, may be null
Returns:
The encoded Date

encodeDate

public byte[] encodeDate(Date d)
Description copied from class: XSQLVAR
Encode a Date value into a byte array.

Overrides:
encodeDate in class XSQLVAR
Parameters:
d - The Date to be encoded
Returns:
The array of bytes representing the given Date

decodeDate

public Date decodeDate(Date d,
                       Calendar cal)
Description copied from class: XSQLVAR
Decode a Date value using a given Calendar.

Overrides:
decodeDate in class XSQLVAR
Parameters:
d - The Date to be decoded
cal - The Calendar to be used in the decoding, may be null
Returns:
The decoded Date

decodeDate

public Date decodeDate(byte[] byte_int)
Description copied from class: XSQLVAR
Decode a byte array into a Date value.

Overrides:
decodeDate in class XSQLVAR
Parameters:
byte_int - The byte array to be decoded
Returns:
The decoded Date


Copyright © 2001-2010. All Rights Reserved.