com.davisor.data
Class MetaType

java.lang.Object
  extended byjava.text.Format
      extended bycom.davisor.data.Type
          extended bycom.davisor.data.MetaType
All Implemented Interfaces:
java.lang.Cloneable, java.util.Comparator, com.davisor.core.Dupable, java.io.Serializable

public class MetaType
extends Type

MetaType describes a multi-dimensional data array that contains data streams. Depending on the dimension of the data array, the data streams within may contain yet other data streams. The MetaType dimension attribute tells how deep this recursion is expected to be. An optional index attribute tells the data array index within it's parent array, if any.

Since:
JDK1.1
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.text.Format
java.text.Format.Field
 
Field Summary
static java.lang.String TYPENAME
          Type name ("META").
 
Fields inherited from class com.davisor.data.Type
METADATA_GROUP, METADATA_NAME, METADATA_PARENT, METADATA_SUBCHANNELS
 
Constructor Summary
  MetaType()
          Default constructor.
  MetaType(MetaType mt)
          Copy constructor.
  MetaType(java.lang.String dataName, java.lang.String id, java.util.Map metaData, int dimension, java.lang.Integer index)
          Creates a new meta type.
protected MetaType(java.lang.String typeName, java.lang.String dataName, java.lang.String id, java.util.Map metaData, int dimension, java.lang.Integer index)
          Creates a new meta type.
 
Method Summary
 com.davisor.core.Dupable dup()
          Makes a deep copy of this object.
 java.lang.String getFormat()
          Gets the meta type specification string.
 int getSQLCode()
          Gets the SQL type code, as defined by java.sql.Types.
 java.lang.String getSQLName()
          Gets the SQL type name.
 java.lang.Class getValueClass()
          Gets value container class.
 void setFormat(java.lang.String format)
          Sets the type dimension and index.
 DataValue toData(java.lang.String stringValue, java.text.ParsePosition status)
          Converts a string to a data value.
 DataValue zero()
          Gets zero data value for this type.
 
Methods inherited from class com.davisor.data.Type
ceil, check, check, compare, create, create, create, create, create, dup, equals, floor, format, getCompatibility, getDataName, getId, getID, getMetaData, getMetaData, getSpecs, getSQLName, getTypeName, hashCode, isNull, parseObject, register, register, setDataName, setId, setID, setMetaData, setMetaData, setSpecs, toData, toData, toData, toString, toXML, xmlEnd, xmlStart
 
Methods inherited from class java.text.Format
clone, format, formatToCharacterIterator, parseObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPENAME

public static final java.lang.String TYPENAME
Type name ("META").

See Also:
Constant Field Values
Constructor Detail

MetaType

public MetaType()
Default constructor.


MetaType

public MetaType(MetaType mt)
Copy constructor.


MetaType

public MetaType(java.lang.String dataName,
                java.lang.String id,
                java.util.Map metaData,
                int dimension,
                java.lang.Integer index)
Creates a new meta type.

Parameters:
dataName - data name
id - type identity
metaData - type meta data map (may be null)
dimension - type dimension
index - type index

MetaType

protected MetaType(java.lang.String typeName,
                   java.lang.String dataName,
                   java.lang.String id,
                   java.util.Map metaData,
                   int dimension,
                   java.lang.Integer index)
Creates a new meta type.

Parameters:
typeName - type name
dataName - data name
id - type identity
metaData - type meta data map (may be null)
dimension - type dimension
index - type index
Method Detail

getSQLName

public java.lang.String getSQLName()
Gets the SQL type name.

Overrides:
getSQLName in class Type
Returns:
SQL type name.

getSQLCode

public int getSQLCode()
Gets the SQL type code, as defined by java.sql.Types.

Overrides:
getSQLCode in class Type
Returns:
Types.VARCHAR.

getValueClass

public java.lang.Class getValueClass()
Gets value container class.

Specified by:
getValueClass in class Type

toData

public DataValue toData(java.lang.String stringValue,
                        java.text.ParsePosition status)
                 throws InvalidDataException
Converts a string to a data value.

Meta type does not yet support this operation, and throws always a InvalidDataException.

Specified by:
toData in class Type
Parameters:
stringValue - data string
status - parse status (may be null)
Returns:
a data value object corresponding given string value
Throws:
InvalidDataException - if given string value could not be parsed
See Also:
Type.toData(CallableStatement,int), Type.toData(Object), Type.toData(ResultSet,int)

dup

public com.davisor.core.Dupable dup()
Makes a deep copy of this object.

Specified by:
dup in interface com.davisor.core.Dupable
Specified by:
dup in class Type

getFormat

public java.lang.String getFormat()
Gets the meta type specification string. If the current configuration is invalid, null is returned.

Overrides:
getFormat in class Type
Returns:
default, null specification string
See Also:
setFormat(java.lang.String)

setFormat

public void setFormat(java.lang.String format)
Sets the type dimension and index. The dimension and index are expected to be represented as two integer values, separated by a space character.

Overrides:
setFormat in class Type
Parameters:
format - type specification string (may be null)
See Also:
getFormat()

zero

public DataValue zero()
Gets zero data value for this type.

Specified by:
zero in class Type
Returns:
a new zero value data object sharing this type
Throws:
java.lang.Error - always since this operation is undefined
See Also:
DataValue.deinterpolate(com.davisor.data.DataValue, com.davisor.data.DataValue), DataValue.interpolate(double, com.davisor.data.DataValue)


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.