|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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 RelDataTypefieldName - name of field to find
public int getFieldOrdinal(String fieldName)
RelDataType
getFieldOrdinal in interface RelDataTypefieldName - name of field to find
public List<RelDataTypeField> getFieldList()
RelDataType
getFieldList in interface RelDataTypepublic RelDataTypeField[] getFields()
RelDataTypeNOTE jvs 17-Dec-2004: this method will become deprecated once we move to Java generics, and eventually eliminated
getFields in interface RelDataTypepublic int getFieldCount()
RelDataTypeThis method is equivalent to .
RelDataType.getFieldList()
().size()
getFieldCount in interface RelDataTypepublic RelDataType getComponentType()
RelDataType
getComponentType in interface RelDataTypepublic boolean isStruct()
RelDataType
isStruct in interface RelDataTypepublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String getFullTypeString()
RelDataType
getFullTypeString in interface RelDataTypepublic boolean isNullable()
RelDataType
isNullable in interface RelDataTypepublic Charset getCharset()
RelDataType
getCharset in interface RelDataType
public SqlCollation getCollation()
throws RuntimeException
RelDataType
getCollation in interface RelDataTypeRuntimeExceptionpublic SqlIntervalQualifier getIntervalQualifier()
RelDataType
getIntervalQualifier in interface RelDataTypepublic int getPrecision()
RelDataType
getPrecision in interface RelDataTypepublic int getScale()
RelDataType
getScale in interface RelDataTypepublic SqlTypeName getSqlTypeName()
RelDataTypeSqlTypeName of this type.
getSqlTypeName in interface RelDataTypepublic SqlIdentifier getSqlIdentifier()
RelDataTypeSqlIdentifier 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 RelDataTypepublic 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 RelDataTypetoString in class Objectpublic RelDataTypePrecedenceList getPrecedenceList()
getPrecedenceList in interface RelDataTypepublic RelDataTypeComparability getComparability()
getComparability in interface RelDataType
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||