org.firebirdsql.gds

Class XSQLVAR


public class XSQLVAR
extends java.lang.Object

The class XSQLDA is a java mapping of the XSQLVAR server data structure used to represent one column for input and output.
Version:
1.0
Author:
Alejandro Alberola

Field Summary

String
aliasname
protected org.firebirdsql.encodings.Encoding
coder
String
ownname
String
relname
byte[]
sqldata
int
sqllen
String
sqlname
int
sqlscale
int
sqlsubtype
int
sqltype

Constructor Summary

XSQLVAR()

Method Summary

void
copyFrom(XSQLVAR original)
Copy constructor.
void
copyFrom(XSQLVAR original, boolean copyData)
Copy constructor.
Date
decodeDate(Date d, Calendar cal)
Decode a Date value using a given Calendar.
Date
decodeDate(byte[] byte_int)
Decode a byte array into a Date value.
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(Time d, Calendar cal, boolean invertTimeZone)
Decode a Time value using a given Calendar.
Time
decodeTime(byte[] int_byte)
Decode a byte array into a Time value.
Timestamp
decodeTimestamp(Timestamp value, Calendar cal)
Decode a Timestamp value using a given Calendar.
Timestamp
decodeTimestamp(Timestamp value, Calendar cal, boolean invertTimeZone)
Decode a Timestamp value using a given Calendar.
Timestamp
decodeTimestamp(byte[] byte_int)
Decode a byte array into a Timestamp.
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(String value, String encoding, String mappingPath)
Encode a String value into a byte array using a given encoding.
byte[]
encodeString(byte[] value, String encoding, String mappingPath)
Encode 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, boolean invertTimeZone)
Encode a given Time value using a given Calendar.
byte[]
encodeTimestamp(Timestamp value)
Encode a Timstamp as a byte array.
Timestamp
encodeTimestamp(Timestamp value, Calendar cal)
Encode a Timestamp using a given Calendar.
Timestamp
encodeTimestamp(Timestamp value, Calendar cal, boolean invertTimeZone)
Encode a Timestamp using a given Calendar.

Field Details

aliasname

public String aliasname

coder

protected org.firebirdsql.encodings.Encoding coder

ownname

public String ownname

relname

public String relname

sqldata

public byte[] sqldata

sqllen

public int sqllen

sqlname

public String sqlname

sqlscale

public int sqlscale

sqlsubtype

public int sqlsubtype

sqltype

public int sqltype

Constructor Details

XSQLVAR

public XSQLVAR()

Method Details

copyFrom

public void copyFrom(XSQLVAR original)
Copy constructor. Initialize this instance of XSQLVAR with values from another instance.
Parameters:
original - The other instance of XSQLVAR to be used as the base for initializing this instance

copyFrom

public void copyFrom(XSQLVAR original,
                     boolean copyData)
Copy constructor. Initialize this instance of XSQLVAR with values from another instance.
Parameters:
original - The other instance of XSQLVAR to be used as the base for initializing this instance

decodeDate

public Date decodeDate(Date d,
                       Calendar cal)
Decode a Date value using a given Calendar.
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)
Decode a byte array into a Date value.
Parameters:
byte_int - The byte array to be decoded
Returns:
The decoded Date

decodeDouble

public double decodeDouble(byte[] byte_int)
Decode a byte array into a double value.
Parameters:
byte_int - The byte array to be decoded
Returns:
The double value of the decoded byte array

decodeFloat

public float decodeFloat(byte[] byte_int)
Decode a byte array into a float value.
Parameters:
byte_int - The byte array to be decoded
Returns:
The float value of the decoded byte array

decodeInt

public int decodeInt(byte[] byte_int)
Decode a byte array into an int value.
Parameters:
byte_int - The byte array to be decoded
Returns:
The int value of the decoded byte array

decodeLong

public long decodeLong(byte[] byte_int)
Decode a byte array into a long value.
Parameters:
byte_int - The byte array to be decoded
Returns:
The long value of the decoded byte array

decodeShort

public short decodeShort(byte[] byte_int)
Decode a byte array into a short value.
Parameters:
byte_int - The byte array to be decoded
Returns:
The short value of the decoded byte array

decodeString

public String decodeString(byte[] value,
                           String encoding,
                           String mappingPath)
            throws SQLException
Decode an encoded byte array into a String using a given encoding.
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

decodeTime

public Time decodeTime(Time d,
                       Calendar cal,
                       boolean invertTimeZone)
Decode a Time value using a given Calendar.
Parameters:
d - The Time to be decoded
cal - The Calendar to be used in the decoding, may be null
Returns:
The decooded Time

decodeTime

public Time decodeTime(byte[] int_byte)
Decode a byte array into a Time value.
Parameters:
int_byte - The byte array to be decoded
Returns:
The decoded Time

decodeTimestamp

public Timestamp decodeTimestamp(Timestamp value,
                                 Calendar cal)
Decode a Timestamp value using a given Calendar.
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(Timestamp value,
                                 Calendar cal,
                                 boolean invertTimeZone)
Decode a Timestamp value using a given Calendar.
Parameters:
value - The Timestamp to be decoded
cal - The Calendar to be used in decoding, may be null
invertTimeZone - If true, the timezone offset value will be subtracted from the decoded value, otherwise it will be added
Returns:
The encoded Timestamp

decodeTimestamp

public Timestamp decodeTimestamp(byte[] byte_int)
Decode a byte array into a Timestamp.
Parameters:
byte_int - The byte array to be decoded
Returns:
A Timestamp value from the decoded bytes

deepCopy

public XSQLVAR deepCopy()
Get a deep copy of this object.
Returns:
deep copy of this object.

encodeDate

public byte[] encodeDate(Date d)
Encode a Date value into a byte array.
Parameters:
d - The Date to be encoded
Returns:
The array of bytes representing the given Date

encodeDate

public Date encodeDate(Date d,
                       Calendar cal)
Encode a given Date value using a given Calendar.
Parameters:
d - The Date to be encoded
cal - The Calendar to be used in the encoding, may be null
Returns:
The encoded Date

encodeDouble

public byte[] encodeDouble(double value)
Encode a double value as a byte array.
Parameters:
value - The value to be encoded
Returns:
The value of value encoded as a byte array

encodeFloat

public byte[] encodeFloat(float value)
Encode a float value as a byte array.
Parameters:
value - The value to be encoded
Returns:
The value of value encoded as a byte array

encodeInt

public byte[] encodeInt(int value)
Encode an int value as a byte array.
Parameters:
value - The value to be encoded
Returns:
The value of value encoded as a byte array

encodeLong

public byte[] encodeLong(long value)
Encode a long value as a byte array.
Parameters:
value - The value to be encoded
Returns:
The value of value encoded as a byte array

encodeShort

public byte[] encodeShort(short value)
Encode a short value as a byte array.
Parameters:
value - The value to be encoded
Returns:
The value of value encoded as a byte array

encodeString

public byte[] encodeString(String value,
                           String encoding,
                           String mappingPath)
            throws SQLException
Encode a String value into a byte array using a given encoding.
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

encodeString

public byte[] encodeString(byte[] value,
                           String encoding,
                           String mappingPath)
            throws SQLException
Encode a byte array using a given encoding.
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

encodeTime

public byte[] encodeTime(Time d)
Encode a Time value into a byte array.
Parameters:
d - The Time to be encoded
Returns:
The array of bytes representing the given Time

encodeTime

public Time encodeTime(Time d,
                       Calendar cal,
                       boolean invertTimeZone)
Encode a given Time value using a given Calendar.
Parameters:
d - The Time to be encoded
cal - The Calendar to be used in the encoding, may be null
Returns:
The encoded Time

encodeTimestamp

public byte[] encodeTimestamp(Timestamp value)
Encode a Timstamp as a byte array.
Parameters:
value - The Timstamp to be encoded
Returns:
The array of bytes that represents the given Timestamp value

encodeTimestamp

public Timestamp encodeTimestamp(Timestamp value,
                                 Calendar cal)
Encode a Timestamp using a given Calendar.
Parameters:
value - The Timestamp to be encoded
cal - The Calendar to be used for encoding, may be null

encodeTimestamp

public Timestamp encodeTimestamp(Timestamp value,
                                 Calendar cal,
                                 boolean invertTimeZone)
Encode a Timestamp using a given Calendar.
Parameters:
value - The Timestamp to be encoded
cal - The Calendar to be used for encoding, may be null
invertTimeZone - If true, the timezone offset value will be subtracted from the encoded value, otherwise it will be added
Returns:
The encoded Timestamp

Copyright B) 2001 David Jencks and other authors. All rights reserved.