Class BaseDateTime

    • Constructor Detail

      • BaseDateTime

        public BaseDateTime()
        Initializes the date as NOW.
        See Also:
        NOW
      • BaseDateTime

        public BaseDateTime​(String s)
        Initializes the object with the date to parse.
        Parameters:
        s - the date to parse
      • BaseDateTime

        public BaseDateTime​(Date date)
        Initializes the object with the specified date.
        Parameters:
        date - the date to use
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the internal object.
        Overrides:
        initialize in class BaseObject
      • getFormat

        protected static DateFormat getFormat()
        Returns the formatter.
        Returns:
        the formatter
      • setStart

        public void setStart​(Date value)
        Sets the optional start datetime.
        Parameters:
        value - the start datetime
      • getStart

        public Date getStart()
        Returns the optional start datetime.
        Returns:
        the start datetime
      • setEnd

        public void setEnd​(Date value)
        Sets the optional end datetime.
        Parameters:
        value - the end datetime
      • getEnd

        public Date getEnd()
        Returns the optional end datetime.
        Returns:
        the end datetime
      • setBusinessDays

        public void setBusinessDays​(BusinessDays value)
        Sets what business days to use.
        Parameters:
        value - the type
      • getBusinessDays

        public BusinessDays getBusinessDays()
        Returns what business days to use.
        Returns:
        the type
      • parse

        protected Date parse​(String s,
                             boolean quiet)
        Parses the given date string.
        Parameters:
        s - the date string to parse
        quiet - whether to print exceptions or not
        Returns:
        the parsed date, null in case of an error
      • isValid

        public boolean isValid​(String value)
        Checks whether the string value is a valid presentation for this class.
        Specified by:
        isValid in class BaseObject
        Parameters:
        value - the string value to check
        Returns:
        true if parseable date/time
      • setValue

        public void setValue​(String value)
        Sets the string value.
        Specified by:
        setValue in class BaseObject
        Parameters:
        value - the string value
      • getValue

        public String getValue()
        Returns the current string value.
        Specified by:
        getValue in class BaseObject
        Returns:
        the string value
      • dateTimeValue

        public DateTime dateTimeValue()
        Returns the DateTime value.
        Returns:
        the DateTime value
      • stringValue

        public String stringValue()
        Returns the actual Date as string.
        Returns:
        the actual date as string
      • getTipText

        public String getTipText()
        Returns a tool tip for the GUI editor (ignored if null is returned).
        Specified by:
        getTipText in class BaseObject
        Returns:
        the tool tip
      • getGrammar

        public String getGrammar()
        Returns a string representation of the grammar.
        Specified by:
        getGrammar in interface GrammarSupplier
        Returns:
        the grammar, null if not available
      • isInfinityFuture

        public boolean isInfinityFuture()
        Checks whether the date/time is +INF.
        Returns:
        true if infinity future
      • isInfinityPast

        public boolean isInfinityPast()
        Checks whether the date/time is -INF.
        Returns:
        true if infinity future
      • isInfinity

        public boolean isInfinity()
        Checks whether the date/time is -INF or +INF.
        Returns:
        true if any infinity
      • now

        public static BaseDateTime now()
        Returns a new BaseDate object initialized with the NOW placeholder.
        Returns:
        the BaseDate object
        See Also:
        NOW
      • infinityFuture

        public static BaseDateTime infinityFuture()
        Returns a new BaseDate object initialized with the INF_FUTURE placeholder.
        Returns:
        the BaseDate object
        See Also:
        INF_FUTURE
      • infinityPast

        public static BaseDateTime infinityPast()
        Returns a new BaseDate object initialized with the INF_PAST placeholder.
        Returns:
        the BaseDate object
        See Also:
        INF_PAST