public final class VotType
extends java.lang.Object
Describes a full VOTable type. Thus it includes the following field attributes:
datatype
,arraysize
,xtype
.Modifier and Type | Class and Description |
---|---|
static class |
VotType.VotDatatype
All possible values for a VOTable datatype (i.e.
|
Modifier and Type | Field and Description |
---|---|
java.lang.String |
arraysize
Arraysize string of a VOTable field element.
|
VotType.VotDatatype |
datatype
VOTable datatype
|
java.lang.String |
xtype
Special type specification (i.e.
|
static java.lang.String |
XTYPE_BLOB
Special VOTable type (XType) for TAP/DB type BLOB.
|
static java.lang.String |
XTYPE_CLOB
Special VOTable type (XType) for TAP/DB type CLOB.
|
static java.lang.String |
XTYPE_POINT
Special VOTable type (XType) for TAP/DB type POINT.
|
static java.lang.String |
XTYPE_REGION
Special VOTable type (XType) for TAP/DB type REGION.
|
static java.lang.String |
XTYPE_TIMESTAMP
Special VOTable type (XType) for TAP/DB type TIMESTAMP.
|
Constructor and Description |
---|
VotType(DBType tapType)
|
VotType(VotType.VotDatatype datatype,
java.lang.String arraysize)
Build a VOTable field type.
|
VotType(VotType.VotDatatype datatype,
java.lang.String arraysize,
java.lang.String xtype)
Build a VOTable field type.
|
Modifier and Type | Method and Description |
---|---|
protected DBType |
convertNumericType(DBType.DBDatatype tapDatatype)
|
protected DBType |
convertVariableLengthType(DBType.DBDatatype varType,
DBType.DBDatatype fixedType)
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
java.lang.String |
toString() |
DBType |
toTAPType()
Convert this VOTable type definition into a TAPColumn type.
|
public static final java.lang.String XTYPE_BLOB
public static final java.lang.String XTYPE_CLOB
public static final java.lang.String XTYPE_TIMESTAMP
public static final java.lang.String XTYPE_POINT
public static final java.lang.String XTYPE_REGION
public final VotType.VotDatatype datatype
public final java.lang.String arraysize
public final java.lang.String xtype
public VotType(VotType.VotDatatype datatype, java.lang.String arraysize)
datatype
- A datatype. Null value forbiddenarraysize
- VOTable arraysize string (may be NULL).public VotType(VotType.VotDatatype datatype, java.lang.String arraysize, java.lang.String xtype)
datatype
- A datatype. Null value forbiddenarraysize
- VOTable arraysize string (may be NULL).xtype
- A special type (ex: adql:POINT, adql:TIMESTAMP, ...). (may be NULL).public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public DBType toTAPType() throws TAPException
DBType
.TAPException
- If the conversion is impossible (particularly if the array-size refers to a multi-dimensional array ; only 1D arrays are allowed).protected DBType convertNumericType(DBType.DBDatatype tapDatatype)
Convert this numeric VotType
object into a corresponding DBType
whose the datatype is provided in parameter.
Thus, just the arraysize must be managed here. If there is no arraysize or if equals to '1', the given datatype will be used.
Otherwise, it is ignored and a DBType
with VARBINARY is returned.
protected DBType convertVariableLengthType(DBType.DBDatatype varType, DBType.DBDatatype fixedType) throws TAPException
Convert this variable length VotType
(unsignedByte and char) object into a corresponding DBType
whose the variable length and fixed length versions are given in parameters.
Thus, just the arraysize must be managed here. The following cases are taken into account:
varType
- Variable length type (i.e. VARCHAR, VARBINARY).fixedType
- Fixed length type (i.e. CHAR, BINARY).DBType
.TAPException
- If the arraysize is not valid (that's to say, different from the following syntaxes: NULL, '*', 'n' or 'n*' (where n is a positive and not-null integer)).