Class MamaDateTime

  • All Implemented Interfaces:
    java.lang.Comparable

    public class MamaDateTime
    extends java.lang.Object
    implements java.lang.Comparable
    MamaDataTime Posix date/time representation.
    • Constructor Detail

      • MamaDateTime

        public MamaDateTime()
      • MamaDateTime

        public MamaDateTime​(java.util.Calendar calendar)
      • MamaDateTime

        public MamaDateTime​(java.lang.String str)
      • MamaDateTime

        public MamaDateTime​(java.lang.String str,
                            MamaTimeZone tz)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(java.lang.Object obj)
        Specified by:
        compareTo in interface java.lang.Comparable
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isEmpty

        public boolean isEmpty()
      • setEpochTime

        public void setEpochTime​(long secondsSinceEpoch,
                                 long microseconds,
                                 MamaDateTimePrecision precision)
      • setEpochTime

        public void setEpochTime​(long secondsSinceEpoch,
                                 long microseconds)
      • setEpochTimeF64

        public void setEpochTimeF64​(double secondsSinceEpoch)
      • setEpochTimeMilliseconds

        public void setEpochTimeMilliseconds​(long millisecondsSinceEpoch)
      • setEpochTimeMicroseconds

        public void setEpochTimeMicroseconds​(long microsecondsSinceEpoch)
      • setToNow

        public void setToNow()
      • setToMidnightToday

        public void setToMidnightToday​(MamaTimeZone tz)
      • set

        public void set​(int year,
                        int month,
                        int day,
                        int hour,
                        int minute,
                        int second,
                        long microsecond,
                        MamaDateTimePrecision precision,
                        MamaTimeZone tz)
      • setDate

        public void setDate​(int year,
                            int month,
                            int day)
      • clear

        public void clear()
      • clearTime

        public void clearTime()
      • clearDate

        public void clearDate()
      • hasDate

        public boolean hasDate()
      • hasTime

        public boolean hasTime()
      • addSeconds

        public void addSeconds​(double seconds)
      • addSeconds

        public void addSeconds​(long seconds)
      • addMicroSeconds

        public void addMicroSeconds​(long microSeconds)
      • getEpochTimeMicroseconds

        public long getEpochTimeMicroseconds()
        Get the date and time as microseconds since the Epoch, (using the UTC timezone).
        Returns:
        The number of microseconds since the Epoch.
        Throws:
        com.wombat.mama - MamaException thrown if the underlying JNI object has been destroyed.
        com.wombat.common.WombatException - for other general MAMA errors.
      • getEpochTimeMilliseconds

        public long getEpochTimeMilliseconds()
      • getEpochTimeSeconds

        public double getEpochTimeSeconds()
      • getEpochTimeSecondsWithCheck

        public double getEpochTimeSecondsWithCheck()
        Get the date and time as seconds since the Epoch, (using the UTC timezone). If no date value is contained in the dateTime then it will be set to today's date and the calculation made.
        Returns:
        The number of seconds, (including partial seconds), since the Epoch.
        Throws:
        com.wombat.mama - MamaException thrown if the underlying JNI object has been destroyed.
        com.wombat.common.WombatException - for other general MAMA errors.
      • getAsString

        public java.lang.String getAsString()
      • getTimeAsString

        public java.lang.String getTimeAsString()
      • getDateAsString

        public java.lang.String getDateAsString()
      • getYear

        public long getYear()
      • getMonth

        public long getMonth()
      • getDay

        public long getDay()
      • getHour

        public long getHour()
      • getMinute

        public long getMinute()
      • getSecond

        public long getSecond()
      • getMicrosecond

        public long getMicrosecond()
      • getCalendar

        public java.util.Calendar getCalendar()
      • destroy

        public void destroy()