|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.reltype.RelDataTypeImpl
public abstract class RelDataTypeImpl
RelDataTypeImpl is an abstract base for implementations of RelDataType
.
Identity is based upon the digest
field, which each derived class
should set during construction.
Field Summary | |
---|---|
protected String |
digest
|
protected List<RelDataTypeField> |
fieldList
|
protected RelDataTypeField[] |
fields
|
Constructor Summary | |
---|---|
protected |
RelDataTypeImpl()
Default constructor, to allow derived classes such as BasicSqlType to be Serializable . |
protected |
RelDataTypeImpl(RelDataTypeField[] fields)
Creates a RelDataTypeImpl. |
Method Summary | |
---|---|
protected void |
computeDigest()
Computes the digest field. |
boolean |
equals(Object obj)
|
protected abstract void |
generateTypeString(StringBuilder sb,
boolean withDetail)
Generates a string representation of this type. |
Charset |
getCharset()
Gets this type's character set, or null if this type cannot carry a character set or has no character set defined. |
SqlCollation |
getCollation()
Gets this type's collation, or null if this type cannot carry a collation or has no collation defined. |
RelDataTypeComparability |
getComparability()
|
RelDataType |
getComponentType()
Gets the component type if this type is a collection, otherwise null. |
RelDataTypeFamily |
getFamily()
Gets a canonical object representing the family of this type. |
RelDataTypeField |
getField(String fieldName)
Looks up a field by name. |
int |
getFieldCount()
Returns the number of fields in a struct type. |
List<RelDataTypeField> |
getFieldList()
Gets the fields in a struct type. |
int |
getFieldOrdinal(String fieldName)
Looks up the ordinal of a field by name. |
RelDataTypeField[] |
getFields()
Gets the fields in a struct type. |
String |
getFullTypeString()
Gets a string representation of this type with full detail such as character set and nullability. |
SqlIntervalQualifier |
getIntervalQualifier()
Gets this type's interval qualifier, or null if this is not an interval type. |
RelDataTypePrecedenceList |
getPrecedenceList()
|
int |
getPrecision()
Gets the JDBC-defined precision for values of this type. |
int |
getScale()
Gets the scale of this type. |
SqlIdentifier |
getSqlIdentifier()
Gets the SqlIdentifier associated with this type. |
SqlTypeName |
getSqlTypeName()
Gets the SqlTypeName of this type. |
int |
hashCode()
|
boolean |
isNullable()
Queries whether this type allows null values. |
boolean |
isStruct()
Queries whether this is a structured type. |
String |
toString()
Gets a string representation of this type without detail such as character set and nullability. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected RelDataTypeField[] fields
protected List<RelDataTypeField> fieldList
protected String digest
Constructor Detail |
---|
protected RelDataTypeImpl(RelDataTypeField[] fields)
fields
- Array of fieldsprotected RelDataTypeImpl()
BasicSqlType
to be Serializable
.
(The serialization specification says that a class can be serializable even if its base class is not serializable, provided that the base class has a public or protected zero-args constructor.)
Method Detail |
---|
public RelDataTypeField getField(String fieldName)
RelDataType
getField
in interface RelDataType
fieldName
- name of field to find
public int getFieldOrdinal(String fieldName)
RelDataType
getFieldOrdinal
in interface RelDataType
fieldName
- name of field to find
public List<RelDataTypeField> getFieldList()
RelDataType
getFieldList
in interface RelDataType
public RelDataTypeField[] getFields()
RelDataType
NOTE jvs 17-Dec-2004: this method will become deprecated once we move to Java generics, and eventually eliminated
getFields
in interface RelDataType
public int getFieldCount()
RelDataType
This method is equivalent to
.
RelDataType.getFieldList()
().size()
getFieldCount
in interface RelDataType
public RelDataType getComponentType()
RelDataType
getComponentType
in interface RelDataType
public boolean isStruct()
RelDataType
isStruct
in interface RelDataType
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String getFullTypeString()
RelDataType
getFullTypeString
in interface RelDataType
public boolean isNullable()
RelDataType
isNullable
in interface RelDataType
public Charset getCharset()
RelDataType
getCharset
in interface RelDataType
public SqlCollation getCollation() throws RuntimeException
RelDataType
getCollation
in interface RelDataType
RuntimeException
public SqlIntervalQualifier getIntervalQualifier()
RelDataType
getIntervalQualifier
in interface RelDataType
public int getPrecision()
RelDataType
getPrecision
in interface RelDataType
public int getScale()
RelDataType
getScale
in interface RelDataType
public SqlTypeName getSqlTypeName()
RelDataType
SqlTypeName
of this type.
getSqlTypeName
in interface RelDataType
public SqlIdentifier getSqlIdentifier()
RelDataType
SqlIdentifier
associated with this type. For a
predefined type, this is a simple identifier based on RelDataType.getSqlTypeName()
. For a user-defined type, this is a compound identifier
which uniquely names the type.
getSqlIdentifier
in interface RelDataType
public RelDataTypeFamily getFamily()
RelDataType
getFamily
in interface RelDataType
protected abstract void generateTypeString(StringBuilder sb, boolean withDetail)
sb
- StringBuffer into which to generate the stringwithDetail
- when true, all detail information needed to compute a
unique digest (and return from getFullTypeString) should be included;protected void computeDigest()
public String toString()
RelDataType
toString
in interface RelDataType
toString
in class Object
public RelDataTypePrecedenceList getPrecedenceList()
getPrecedenceList
in interface RelDataType
public RelDataTypeComparability getComparability()
getComparability
in interface RelDataType
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |