Classes Files

com::wombat::mama::MamaDateTime

More…

Inherits from Comparable

Public Functions

  Name
  MamaDateTime()
  MamaDateTime(MamaDateTime copy)
  MamaDateTime(MamaDateTime time, MamaDateTime date)
  MamaDateTime(Calendar calendar)
  MamaDateTime(String str)
  MamaDateTime(String str, MamaTimeZone tz)
String toString()
String formatString(String str, MamaTimeZone tz)
int compareTo(Object obj)
boolean equals(Object obj)
int hashCode()
native boolean isEmpty()
void setEpochTime(long secondsSinceEpoch, long microseconds, MamaDateTimePrecision precision)
void setEpochTime(long secondsSinceEpoch, long microseconds)
native void setEpochTimeF64(double secondsSinceEpoch)
native void setEpochTimeMilliseconds(long millisecondsSinceEpoch)
native void setEpochTimeMicroseconds(long microsecondsSinceEpoch)
void setWithHints(long secondsSinceEpoch, long microseconds, MamaDateTimePrecision precision, MamaDateTimeHints hints)
native void setToNow()
void setToMidnightToday(MamaTimeZone tz)
void set(int year, int month, int day, int hour, int minute, int second, long microsecond, MamaDateTimePrecision precision, MamaTimeZone tz)
void setTime(int hour, int minute, int second, long microsecond, MamaDateTimePrecision precision, MamaTimeZone tz)
native void setDate(int year, int month, int day)
native void copyTime(MamaDateTime src)
native void copyDate(MamaDateTime src)
native void clear()
native void clearTime()
native void clearDate()
native boolean hasDate()
native boolean hasTime()
native void addSeconds(double seconds)
native void addSeconds(long seconds)
native void addMicroSeconds(long microSeconds)
long getEpochTimeMicroseconds()
long getEpochTimeMicroseconds(MamaTimeZone tz)
long getEpochTimeMilliseconds()
long getEpochTimeMilliseconds(MamaTimeZone tz)
double getEpochTimeSeconds()
double getEpochTimeSeconds(MamaTimeZone tz)
native double getEpochTimeSecondsWithCheck()
native String getAsString()
native String getTimeAsString()
native String getDateAsString()
native long getYear()
native long getMonth()
native long getDay()
native long getHour()
native long getMinute()
native long getSecond()
native long getMicrosecond()
MamaDayOfWeek getDayOfWeek()
Calendar getCalendar()
native void destroy()
native void copy(MamaDateTime copy)
native double diffSeconds(MamaDateTime t1, MamaDateTime t0)
native double diffSecondsSameDay(MamaDateTime t1, MamaDateTime t0)
native long diffMicroseconds(MamaDateTime t1, MamaDateTime t0)

Protected Functions

  Name
long getPointerVal()
void setPointerVal(long pointerVal)
void finalize()

Detailed Description

class com::wombat::mama::MamaDateTime;

MamaDataTime

Posix date/time representation.

Public Functions Documentation

function MamaDateTime

inline MamaDateTime()

function MamaDateTime

inline MamaDateTime(
    MamaDateTime copy
)

function MamaDateTime

inline MamaDateTime(
    MamaDateTime time,
    MamaDateTime date
)

function MamaDateTime

inline MamaDateTime(
    Calendar calendar
)

function MamaDateTime

inline MamaDateTime(
    String str
)

function MamaDateTime

inline MamaDateTime(
    String str,
    MamaTimeZone tz
)

function toString

inline String toString()

function formatString

inline String formatString(
    String str,
    MamaTimeZone tz
)

function compareTo

inline int compareTo(
    Object obj
)

function equals

inline boolean equals(
    Object obj
)

function hashCode

inline int hashCode()

function isEmpty

native boolean isEmpty()

function setEpochTime

inline void setEpochTime(
    long secondsSinceEpoch,
    long microseconds,
    MamaDateTimePrecision precision
)

function setEpochTime

inline void setEpochTime(
    long secondsSinceEpoch,
    long microseconds
)

function setEpochTimeF64

native void setEpochTimeF64(
    double secondsSinceEpoch
)

function setEpochTimeMilliseconds

native void setEpochTimeMilliseconds(
    long millisecondsSinceEpoch
)

function setEpochTimeMicroseconds

native void setEpochTimeMicroseconds(
    long microsecondsSinceEpoch
)

function setWithHints

inline void setWithHints(
    long secondsSinceEpoch,
    long microseconds,
    MamaDateTimePrecision precision,
    MamaDateTimeHints hints
)

This is not actually implemented in C/C++. The hints field is ignored.

function setToNow

native void setToNow()

function setToMidnightToday

inline void setToMidnightToday(
    MamaTimeZone tz
)

function set

inline void set(
    int year,
    int month,
    int day,
    int hour,
    int minute,
    int second,
    long microsecond,
    MamaDateTimePrecision precision,
    MamaTimeZone tz
)

function setTime

inline void setTime(
    int hour,
    int minute,
    int second,
    long microsecond,
    MamaDateTimePrecision precision,
    MamaTimeZone tz
)

function setDate

native void setDate(
    int year,
    int month,
    int day
)

function copyTime

native void copyTime(
    MamaDateTime src
)

function copyDate

native void copyDate(
    MamaDateTime src
)

function clear

native void clear()

function clearTime

native void clearTime()

function clearDate

native void clearDate()

function hasDate

native boolean hasDate()

function hasTime

native boolean hasTime()

function addSeconds

native void addSeconds(
    double seconds
)

function addSeconds

native void addSeconds(
    long seconds
)

function addMicroSeconds

native void addMicroSeconds(
    long microSeconds
)

function getEpochTimeMicroseconds

inline long getEpochTimeMicroseconds()

Exceptions:

  • com.wombat.mama.MamaException thrown if the underlying JNI object has been destroyed.
  • com.wombat.common.WombatException for other general MAMA errors.

Return: The number of microseconds since the Epoch.

Get the date and time as microseconds since the Epoch, (using the UTC timezone).

function getEpochTimeMicroseconds

inline long getEpochTimeMicroseconds(
    MamaTimeZone tz
)

function getEpochTimeMilliseconds

inline long getEpochTimeMilliseconds()

function getEpochTimeMilliseconds

inline long getEpochTimeMilliseconds(
    MamaTimeZone tz
)

function getEpochTimeSeconds

inline double getEpochTimeSeconds()

function getEpochTimeSeconds

inline double getEpochTimeSeconds(
    MamaTimeZone tz
)

function getEpochTimeSecondsWithCheck

native double getEpochTimeSecondsWithCheck()

Exceptions:

  • com.wombat.mama.MamaException thrown if the underlying JNI object has been destroyed.
  • com.wombat.common.WombatException for other general MAMA errors.

Return: The number of seconds, (including partial seconds), since the Epoch.

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.

The timezone must to set to UTC if calling this from multiple threads concurrently to avoid contention in strftime.

function getAsString

native String getAsString()

function getTimeAsString

native String getTimeAsString()

function getDateAsString

native String getDateAsString()

function getYear

native long getYear()

function getMonth

native long getMonth()

function getDay

native long getDay()

function getHour

native long getHour()

function getMinute

native long getMinute()

function getSecond

native long getSecond()

function getMicrosecond

native long getMicrosecond()

function getDayOfWeek

inline MamaDayOfWeek getDayOfWeek()

function getCalendar

inline Calendar getCalendar()

function destroy

native void destroy()

function copy

native void copy(
    MamaDateTime copy
)

function diffSeconds

static native double diffSeconds(
    MamaDateTime t1,
    MamaDateTime t0
)

function diffSecondsSameDay

static native double diffSecondsSameDay(
    MamaDateTime t1,
    MamaDateTime t0
)

function diffMicroseconds

static native long diffMicroseconds(
    MamaDateTime t1,
    MamaDateTime t0
)

Protected Functions Documentation

function getPointerVal

inline long getPointerVal()

function setPointerVal

inline void setPointerVal(
    long pointerVal
)

function finalize

inline void finalize()

Updated on 2023-03-31 at 15:29:42 +0100