Class BaseDate

    • Constructor Detail

      • BaseDate

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

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

        public BaseDate​(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 date.
        Parameters:
        value - the start date
      • getStart

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

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

        public Date getEnd()
        Returns the optional end date.
        Returns:
        the end date
      • 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
      • 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
      • 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 BaseDate now()
        Returns a new BaseDate object initialized with the NOW placeholder.
        Returns:
        the BaseDate object
        See Also:
        NOW
      • infinityFuture

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

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