Module omix.api
Package omix.lang

Class DateTime

java.lang.Object
omix.lang.DateTime
All Implemented Interfaces:
Serializable

public final class DateTime
extends Object
implements Serializable
This class represents date and time in the Omix network diagrams.
Author:
Dr. Peter Droste, Omix Visualization
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    DateTime​(int year, int month, int day, int hour, int minute, int second)
    creates a date time with the given year, month (1-12), day (1-31), hour of day (0-23), minute (0-59) and second (0-59)
    DateTime​(int year, int month, int day, int hour, int minute, int second, int millisecond)
    creates a date time with the given year, month (1-12), day (1-31), hour of day (0-23), minute (0-59), second (0-59) and millisecond (0-999)
    DateTime​(long time)
    creates a date time with the absolute date representation
    DateTime​(Date date)
    creates a date time upon a java standard date format.
  • Method Summary

    Modifier and Type Method Description
    int getDay()  
    int getHourOfDay()  
    int getMilliSecond()  
    int getMinute()  
    int getMonth()  
    int getSecond()  
    long getValue()  
    int getYear()  
    String toString()  
    String toString​(String format)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DateTime

      @ConstructorProperties({"year","month","day","hour","minute","second","millisecond"}) public DateTime​(int year, int month, int day, int hour, int minute, int second, int millisecond)
      creates a date time with the given year, month (1-12), day (1-31), hour of day (0-23), minute (0-59), second (0-59) and millisecond (0-999)
      Parameters:
      year - year
      month - month
      day - day
      hour - hour
      minute - minute
      second - second
      millisecond - millisecond
    • DateTime

      @ConstructorProperties({"year","month","day","hour","minute","second"}) public DateTime​(int year, int month, int day, int hour, int minute, int second)
      creates a date time with the given year, month (1-12), day (1-31), hour of day (0-23), minute (0-59) and second (0-59)
      Parameters:
      year - year
      month - month
      day - day
      hour - hour
      minute - minute
      second - second
    • DateTime

      @ConstructorProperties("time") public DateTime​(long time)
      creates a date time with the absolute date representation
      Parameters:
      time - time
    • DateTime

      @ConstructorProperties("date") public DateTime​(Date date)
      creates a date time upon a java standard date format.
      Parameters:
      date - java date
  • Method Details

    • getDay

      public int getDay()
      Returns:
      the day of this date time
    • getMonth

      public int getMonth()
      Returns:
      the month of this date time
    • getYear

      public int getYear()
      Returns:
      the year of this date time
    • getHourOfDay

      public int getHourOfDay()
      Returns:
      the hour of this date time
    • getMinute

      public int getMinute()
      Returns:
      the minute of this date time
    • getSecond

      public int getSecond()
      Returns:
      the second of this date time
    • getMilliSecond

      public int getMilliSecond()
      Returns:
      the millisecond of this date time
    • getValue

      @OVLInaccessible public long getValue()
      Returns:
      the absolute date value
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      the date time as YY-MM-DD,hh:mm:SS:sss
      See Also:
      Object.toString()
    • toString

      public String toString​(String format)
      Parameters:
      format - a format which has to contain YYYY for year, MM for month, DD for day, hh for hour, mm for minutes, SS for seconds and sss for milliseconds.
      Returns:
      a string representation of the date time according the submitted format