Class XSDAbstractDateTimeType

All Implemented Interfaces:
Direct Known Subclasses:
XSDDateTimeType, XSDDateType, XSDDayTimeDurationType, XSDDayType, XSDDurationType, XSDMonthDayType, XSDMonthType, XSDTimeType, XSDYearMonthDurationType, XSDYearMonthType, XSDYearType

public class XSDAbstractDateTimeType extends XSDDatatype
Base class for all date/time/duration type representations. Includes support functions for parsing and comparing dates.
  • Field Details


      public static final short YEAR_MASK
      Mask to indicate whether year is present
      See Also:

      public static final short MONTH_MASK
      Mask to indicate whether month is present
      See Also:
    • DAY_MASK

      public static final short DAY_MASK
      Mask to indicate whether day is present
      See Also:

      public static final short TIME_MASK
      Mask to indicate whether time is present
      See Also:

      public static final short FULL_MASK
      Mask to indicate all date/time are present
      See Also:
  • Constructor Details

    • XSDAbstractDateTimeType

      public XSDAbstractDateTimeType(String typename)
  • Method Details

    • isEqual

      public boolean isEqual(LiteralLabel value1, LiteralLabel value2)
      Compares two instances of values of the given datatype. This ignores lang tags and just uses the java.lang.Number equality.
      Specified by:
      isEqual in interface RDFDatatype
      isEqual in class XSDDatatype
    • isDigit

      public static final boolean isDigit(char ch)
    • getDigit

      public static final int getDigit(char ch)
    • dateToString

      public String dateToString(int[] date)
    • appendFractionalTime

      public static void appendFractionalTime(StringBuffer buff, int fsec, int scale)
      Append the fraction time part of a date/time vector to a string buffer.
    • normalizeSubType

      public RDFDatatype normalizeSubType(Object value, RDFDatatype dt)
      Normalization. If the value is narrower than the current data type (e.g. value is xsd:date but the time is xsd:datetime) returns the narrower type for the literal. If the type is narrower than the value then it may normalize the value (e.g. set the mask of an XSDDateTime) Currently only used to narrow gener XSDDateTime objects to the minimal XSD date/time type.
      Specified by:
      normalizeSubType in interface RDFDatatype
      normalizeSubType in class BaseDatatype
      value - the current object value
      dt - the currently set data type
      a narrower version of the datatype based on the actual value range