Documentation of 'org.hsqldb.types.IntervalType' Java class
IntervalType
org.hsqldb.types

Class IntervalType

  • All Implemented Interfaces:
    java.lang.Cloneable, SchemaObject


    public final class IntervalType
    extends DTIType
    Type subclass for various typs of INTERVAL.

    Since:
    1.9.0
    • Field Detail

      • defaultPrecision

        public final boolean defaultPrecision
      • isYearMonth

        public final boolean isYearMonth
      • factorType

        public static final NumberType factorType
    • Method Detail

      • displaySize

        public int displaySize()
        Specified by:
        displaySize in class Type
      • getJDBCTypeCode

        public int getJDBCTypeCode()
        Description copied from class: Type
        Returns the JDBC type number of type, if it exists, otherwise the HSQLDB / SQL type.
        Specified by:
        getJDBCTypeCode in class Type
      • getJDBCClass

        public java.lang.Class getJDBCClass()
        Specified by:
        getJDBCClass in class Type
      • getJDBCClassName

        public java.lang.String getJDBCClassName()
        Description copied from class: Type
        Returns the JDBC class name of type, if it exists, otherwise the HSQLDB class name.
        Specified by:
        getJDBCClassName in class Type
      • getSQLGenericTypeCode

        public int getSQLGenericTypeCode()
        Description copied from class: Type
        Returns the generic SQL CLI type number of type, if it exists, otherwise the HSQLDB type. The generic type is returned for DATETIME and INTERVAL types.
        Overrides:
        getSQLGenericTypeCode in class Type
      • getNameString

        public java.lang.String getNameString()
        Description copied from class: Type
        Returns the name of the type
        Specified by:
        getNameString in class Type
      • getQualifier

        public static java.lang.String getQualifier(int type)
      • getDefinition

        public java.lang.String getDefinition()
        Description copied from class: Type
        Returns the full definition of the type, including parameters
        Specified by:
        getDefinition in class Type
      • isIntervalType

        public boolean isIntervalType()
        Overrides:
        isIntervalType in class Type
      • isYearMonthIntervalType

        public boolean isYearMonthIntervalType()
      • isDaySecondIntervalType

        public boolean isDaySecondIntervalType()
      • getAggregateType

        public Type getAggregateType(Type other)
        Description copied from class: Type
        Common type used in comparison opertions. other must be comparable with this.
        Specified by:
        getAggregateType in class Type
      • getCombinedType

        public Type getCombinedType(Session session,
                                    Type other,
                                    int operation)
        Description copied from class: Type
        Result type of combining values of two types in different opertions. other type is not allways comparable with this, but a operation should be valid without any explicit CAST
        Specified by:
        getCombinedType in class Type
      • compare

        public int compare(Session session,
                           java.lang.Object a,
                           java.lang.Object b)
        Specified by:
        compare in class Type
      • convertToType

        public java.lang.Object convertToType(SessionInterface session,
                                              java.lang.Object a,
                                              Type otherType)
        Description copied from class: Type
        Same as castToType except for CHARACTER values. Perform string truncation of trailing spaces only. For other long strings, it raises an exception.
        Specified by:
        convertToType in class Type
      • convertToDefaultType

        public java.lang.Object convertToDefaultType(SessionInterface session,
                                                     java.lang.Object a)
        Description copied from class: Type
        Converts the object to the given type without limit checks. Used for JDBC writes.
        Specified by:
        convertToDefaultType in class Type
      • convertToString

        public java.lang.String convertToString(java.lang.Object a)
        Specified by:
        convertToString in class Type
      • convertToSQLString

        public java.lang.String convertToSQLString(java.lang.Object a)
        Specified by:
        convertToSQLString in class Type
      • canConvertFrom

        public boolean canConvertFrom(Type otherType)
        Specified by:
        canConvertFrom in class Type
      • canMoveFrom

        public int canMoveFrom(Type otherType)
        Description copied from class: Type
        Can convert without changing the object
        Overrides:
        canMoveFrom in class Type
        Returns:
        0 always, 1 range check required, -1 never
      • compareToTypeRange

        public int compareToTypeRange(java.lang.Object o)
        Overrides:
        compareToTypeRange in class Type
      • absolute

        public java.lang.Object absolute(java.lang.Object a)
        Description copied from class: Type
        All arithmetic ops are called on the pre-determined Type object of the result
        Overrides:
        absolute in class Type
      • negate

        public java.lang.Object negate(java.lang.Object a)
        Overrides:
        negate in class Type
      • add

        public java.lang.Object add(Session session,
                                    java.lang.Object a,
                                    java.lang.Object b,
                                    Type otherType)
        Overrides:
        add in class Type
      • subtract

        public java.lang.Object subtract(Session session,
                                         java.lang.Object a,
                                         java.lang.Object b,
                                         Type otherType)
        Overrides:
        subtract in class Type
      • multiply

        public java.lang.Object multiply(java.lang.Object a,
                                         java.lang.Object b)
        Overrides:
        multiply in class Type
      • divide

        public java.lang.Object divide(Session session,
                                       java.lang.Object a,
                                       java.lang.Object b)
        Overrides:
        divide in class Type
      • newIntervalType

        public static IntervalType newIntervalType(int type,
                                                   long precision,
                                                   int fractionPrecision)
      • getIntervalType

        public static IntervalType getIntervalType(IntervalType type,
                                                   long precision,
                                                   int fractionalPrecision)
      • getIntervalType

        public static IntervalType getIntervalType(int type,
                                                   long precision,
                                                   int fractionPrecision)
      • getIntervalType

        public static IntervalType getIntervalType(int startIndex,
                                                   int endIndex,
                                                   long precision,
                                                   int fractionPrecision)
      • getIntervalType

        public static IntervalType getIntervalType(int type,
                                                   int startType,
                                                   int endType,
                                                   long precision,
                                                   int fractionPrecision,
                                                   boolean defaultPrecision)
      • getStartIntervalType

        public static int getStartIntervalType(int type)
      • getEndIntervalType

        public static int getEndIntervalType(int type)
      • getCombinedIntervalType

        public static int getCombinedIntervalType(int startType,
                                                  int endType)
      • getIntervalType

        public static int getIntervalType(java.lang.String part)
      • getPart

        public int getPart(Session session,
                           java.lang.Object interval,
                           int part)
        Specified by:
        getPart in class DTIType
      • getSeconds

        public long getSeconds(java.lang.Object interval)
      • getSecondPart

        public java.math.BigDecimal getSecondPart(java.lang.Object interval)
        Specified by:
        getSecondPart in class DTIType
      • convertToLongEndUnits

        public long convertToLongEndUnits(java.lang.Object interval)
      • convertToDoubleStartUnits

        public double convertToDoubleStartUnits(java.lang.Object interval)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.