|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.data.VoidData
com.davisor.data.VoidValue
com.davisor.data.GenericValue
com.davisor.data.ObjectValue
ObjectValue implements a data value class for generic Java objects.
Type,
ObjectType,
Serialized Form| Field Summary | |
protected byte[] |
M_serialized
Serialized value. |
protected java.io.Serializable |
M_value
Serializable object value. |
| Fields inherited from class com.davisor.data.VoidData |
M_type |
| Constructor Summary | |
|
ObjectValue()
Default constructor. |
|
ObjectValue(ObjectValue data,
boolean deep)
Deep or shallow copy constructor. |
protected |
ObjectValue(Type type)
Create a new data object. |
|
ObjectValue(Type type,
java.io.Serializable value)
Creates a new data object |
| Method Summary | |
int |
compareTo(java.lang.Object o)
Compares the type of this object value data with the type of other object values. |
com.davisor.core.Dupable |
dup()
Makes a deep copy of this object. |
java.io.InputStream |
getBinaryStream()
Returns the serialized object as input stream. |
byte[] |
getBytes(long pos,
int length)
Returns max length bytes starting at position
pos. |
boolean |
isNull()
Tests if this data object value is undetermined. |
long |
length()
Returns the length of serialized value. |
long |
position(java.sql.Blob pattern,
long start)
Returns the postion where the given pattern starts. |
long |
position(byte[] pattern,
long start)
Returns the postion where the given pattern starts. |
java.io.OutputStream |
setBinaryStream(long pos)
Retrieves a stream that can be used to write to the BLOB value that this Blob object represents. |
int |
setBytes(long pos,
byte[] bytes)
Writes the given array of bytes to the BLOB value that this Blob object represents, starting at position pos, and returns the number of bytes written. |
int |
setBytes(long pos,
byte[] bytes,
int offset,
int len)
Writes the given array of bytes to the BLOB value that this Blob object represents, starting at position pos, and returns the number of bytes written. |
void |
setValue(java.lang.String stringValue,
java.text.ParsePosition status)
Sets data value from a string value. |
void |
toStatement(java.sql.PreparedStatement statement,
int parameter)
Converts the data to a prepared statement input parameter. |
void |
truncate(long len)
Truncates the BLOB value that this Blob object represents to be of given length. |
| Methods inherited from class com.davisor.data.GenericValue |
max, min, toXML |
| Methods inherited from class com.davisor.data.VoidValue |
abs, add, ceil, deinterpolate, div, floor, getFormat, interpolate, mul, negate, sub, unit |
| Methods inherited from class com.davisor.data.VoidData |
equals, getDataValue, getType, hashCode, setType, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.davisor.data.DataValue |
toString |
| Methods inherited from interface com.davisor.data.Data |
getType |
| Field Detail |
protected java.io.Serializable M_value
protected byte[] M_serialized
| Constructor Detail |
public ObjectValue()
public ObjectValue(ObjectValue data,
boolean deep)
data - source data (may be null)deep - determines if the copying is deep or shallowVoidData.getType(),
Type.dup()protected ObjectValue(Type type)
type - The type of data.
public ObjectValue(Type type,
java.io.Serializable value)
type - the type of data.value - the object value of data.| Method Detail |
public java.io.InputStream getBinaryStream()
throws java.sql.SQLException
getBinaryStream in interface java.sql.Blobjava.sql.SQLException - if serialization fails.
public byte[] getBytes(long pos,
int length)
throws java.sql.SQLException
length bytes starting at position
pos. The length of the returned array tells the number of
returned bytes.
getBytes in interface java.sql.Blobpos - the starting position. 1 denoted the first byte.length - number of returned bytes
java.sql.SQLException - if serialization fails.
public long length()
throws java.sql.SQLException
length in interface java.sql.Blobjava.sql.SQLException - if serialization fails.
public long position(byte[] pattern,
long start)
throws java.sql.SQLException
position in interface java.sql.Blobpattern - the searched pattern.start - the starting position for search. 1 denotes the first byte.
java.sql.SQLException - if serialization or search fails.
public long position(java.sql.Blob pattern,
long start)
throws java.sql.SQLException
position in interface java.sql.Blobpattern - the searched pattern.start - the starting position for search. 1 denotes the first byte.
java.sql.SQLException - if serialization or search fails.
public java.io.OutputStream setBinaryStream(long pos)
throws java.sql.SQLException
This method is new to JDK 1.4, and not yet implemented.
setBinaryStream in interface java.sql.Blobpos - the position in the BLOB value at which to start writing
java.sql.SQLException - always
public int setBytes(long pos,
byte[] bytes)
throws java.sql.SQLException
setBytes in interface java.sql.Blobpos - the position in the BLOB object at which to start writingbytes - the array of bytes to be written to the BLOB value
that this Blob object represents
java.sql.SQLException - if there is an error accessing the BLOB valuesetBytes(long,byte[],int,int)
public int setBytes(long pos,
byte[] bytes,
int offset,
int len)
throws java.sql.SQLException
setBytes in interface java.sql.Blobpos - the position in the BLOB object at which to start writingbytes - the array of bytes to be written to the BLOB value
that this Blob object representsoffset - the offset into the array bytes at which to start
reading the bytes to be setlen - the number of bytes to be written to the BLOB value
from the array of bytes bytes
java.sql.SQLException - if there is an error accessing the BLOB valuesetBytes(long,byte[])
public void truncate(long len)
throws java.sql.SQLException
This method is new to JDK 1.4, and not yet implemented.
truncate in interface java.sql.Bloblen - the length, in bytes, to which the BLOB value that
this Blob object represents should be truncated
java.sql.SQLException - alwayspublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.ComparablecompareTo in class GenericValuejava.lang.ClassCastException - if the given object is not a ObjectValue
java.lang.NullPointerException - if the given object is nullGenericValue.max(com.davisor.data.DataValue),
GenericValue.min(com.davisor.data.DataValue),
Data.getType(),
Compare.compareTo(Object,Object)public boolean isNull()
isNull in interface SerializableDataisNull in class VoidValuetrue
public void setValue(java.lang.String stringValue,
java.text.ParsePosition status)
throws InvalidDataException
setValue in interface DataValuesetValue in class VoidValuestringValue - string value to be parsed (may be null)status - parse status (may be null)
InvalidDataException - if string value could not be parser
public void toStatement(java.sql.PreparedStatement statement,
int parameter)
throws java.sql.SQLException
toStatement in interface DataValuetoStatement in class GenericValuestatement - statement to be updatedparameter - index of the statement parameter to be updated
java.sql.SQLException - if a SQL error occurs.VoidData.toString()public com.davisor.core.Dupable dup()
dup in interface com.davisor.core.Dupabledup in class VoidValue
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||