net.sourceforge.jdbcimporter
Class ColumnValue

java.lang.Object
  extended bynet.sourceforge.jdbcimporter.ColumnValue

public class ColumnValue
extends java.lang.Object

The ColumnValue class represents a column value. There are three types of column values:

Version:
0.6
Author:
Chris Nagy

Field Summary
protected  byte[] bytes
          The bytes representing the value.
protected static int BYTES_TYPE
          Indicates that the column value is a set of bytes
protected  java.io.InputStream inputStream
          The input stream representing the value.
protected  int inputStreamLength
          The length of the input stream.
protected  int inputType
          The type of the value (must be one of STRING_TYPE, BYTES_TYPE, STREAM_TYPE, OBJECT_TYPE).
protected  java.lang.Object object
          The object representing the value.
protected static int OBJECT_TYPE
          Indicates that the column value is an object
protected static int STREAM_TYPE
          Indicates that the column value is an input stream
protected  java.lang.String string
          The string representing the value.
protected static int STRING_TYPE
          Indicates that the column value is a String
 
Constructor Summary
ColumnValue()
           
 
Method Summary
 byte[] getBytes()
          Returns the column value as an array of bytes.
 java.io.InputStream getInputStream()
          Returns the column value as an input stream.
 int getInputStreamLength()
          Returns the length of the input stream.
 java.lang.Object getObject()
          Returns the column value as an object.
 java.lang.String getString()
          Returns the column value as a String.
 boolean isBytes()
          Returns true if the column value is an array of bytes.
 boolean isInputStream()
          Returns true if the column value is an input stream.
 boolean isObject()
          Returns true if the column value is an object.
 boolean isString()
          Returns true if the column value is a String.
 void setBytes(byte[] newBytes)
          Sets the column value as an array of bytes.
 void setInputStream(java.io.InputStream newStream)
          Sets the column value as an input stream.
 void setInputStream(java.io.InputStream newStream, int length)
          Sets the column value as an input stream.
 void setObject(java.lang.Object newObject)
          Sets the column value as an object.
 void setString(java.lang.String value)
          Sets the column value as a String.
 java.lang.String toString()
          Overrides Object.toString()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STRING_TYPE

protected static final int STRING_TYPE
Indicates that the column value is a String

See Also:
Constant Field Values

BYTES_TYPE

protected static final int BYTES_TYPE
Indicates that the column value is a set of bytes

See Also:
Constant Field Values

STREAM_TYPE

protected static final int STREAM_TYPE
Indicates that the column value is an input stream

See Also:
Constant Field Values

OBJECT_TYPE

protected static final int OBJECT_TYPE
Indicates that the column value is an object

Since:
0.74
See Also:
Constant Field Values

inputStream

protected java.io.InputStream inputStream
The input stream representing the value.


inputStreamLength

protected int inputStreamLength
The length of the input stream.

Since:
0.64

string

protected java.lang.String string
The string representing the value.


bytes

protected byte[] bytes
The bytes representing the value.


object

protected java.lang.Object object
The object representing the value.

Since:
0.74

inputType

protected int inputType
The type of the value (must be one of STRING_TYPE, BYTES_TYPE, STREAM_TYPE, OBJECT_TYPE).

Constructor Detail

ColumnValue

public ColumnValue()
Method Detail

getInputStream

public java.io.InputStream getInputStream()
Returns the column value as an input stream. If the column value is not an input stream then null is returned.

Returns:
column value as an input stream

getInputStreamLength

public int getInputStreamLength()
Returns the length of the input stream. The number must be postive when importing data.

Returns:
length
Since:
0.64

setInputStream

public void setInputStream(java.io.InputStream newStream)
Sets the column value as an input stream.

Parameters:
newStream - input stream

setInputStream

public void setInputStream(java.io.InputStream newStream,
                           int length)
Sets the column value as an input stream.

Parameters:
newStream - input stream
length - length of the input stream
Since:
0.64

isInputStream

public boolean isInputStream()
Returns true if the column value is an input stream.

Returns:
whether the column value is an input stream

getString

public java.lang.String getString()
Returns the column value as a String. If the column value is not a String then null is returned.

Returns:
column value as a String

setString

public void setString(java.lang.String value)
Sets the column value as a String.

Parameters:
value - new column value

isString

public boolean isString()
Returns true if the column value is a String.

Returns:
whether the column value is a String

getBytes

public byte[] getBytes()
Returns the column value as an array of bytes. If the column value is not an array of bytes then null is returned.

Returns:
column value as an array of bytes

setBytes

public void setBytes(byte[] newBytes)
Sets the column value as an array of bytes.

Parameters:
newBytes - new column value

isBytes

public boolean isBytes()
Returns true if the column value is an array of bytes.

Returns:
whether the column value is an array of bytes

getObject

public java.lang.Object getObject()
Returns the column value as an object.

Returns:
column value as an object
Since:
0.74

setObject

public void setObject(java.lang.Object newObject)
Sets the column value as an object.

Parameters:
newObject - new column value
Since:
0.74

isObject

public boolean isObject()
Returns true if the column value is an object.

Returns:
whether the column value is an object
Since:
0.74

toString

public java.lang.String toString()
Overrides Object.toString()