Class CodeMeter.CMTIME

  • All Implemented Interfaces:
    java.lang.Comparable<CodeMeter.CMTIME>
    Enclosing class:
    CodeMeter

    public static class CodeMeter.CMTIME
    extends java.lang.Object
    implements java.lang.Comparable<CodeMeter.CMTIME>
    CMTIME sets or gets the time to or from a CmContainer.

    Definition for the class CMTIME corresponding to the c-api struct CMTIME. CMTIME sets or gets the time to or from a CmContainer.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      short day
      specifies the value of the day (1..31).
      short hours
      specifies the value of the hours (0..23).
      short minutes
      specifies the value of the minutes (0..59).
      short month
      specifies the value of the month (1..12).
      short seconds
      specifies the value of the seconds (0..59).
      long secondsSince01_01_2000
      specifies the time in seconds since 01/01/2000 0:00:00 (UTC).
      short year
      specifies the value of the year (e.g.
    • Constructor Summary

      Constructors 
      Constructor Description
      CMTIME()  
      CMTIME​(long secondsSince2000)  
      CMTIME​(java.util.Date date)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(CodeMeter.CMTIME o)  
      boolean readFrom​(byte[] bcmtime)
      This methods reads data from a byte array in the native endian format
      void recalculateTimeInSeconds()
      This methods recalculates the secondsSince01_01_2000 member and must be called if any other of the CMTIME members has been set/modified.
      boolean setEpochTimeInSeconds​(long secondsSince1970)
      Sets the new time using the seconds since 1.1.1970 (Epoch).
      boolean setTimeInSeconds​(long secondsSince2000)
      Sets the new time using the seconds since 1.1.2000 (CodeMeter native format).
      java.util.Date toJavaDate()
      Converts a CMTIME-Object to a Java Date class.
      java.lang.String toString()
      Return a string representing the current time.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • year

        public short year
        specifies the value of the year (e.g. 2003).
      • month

        public short month
        specifies the value of the month (1..12).
      • day

        public short day
        specifies the value of the day (1..31).
      • hours

        public short hours
        specifies the value of the hours (0..23).
      • minutes

        public short minutes
        specifies the value of the minutes (0..59).
      • seconds

        public short seconds
        specifies the value of the seconds (0..59).
      • secondsSince01_01_2000

        public long secondsSince01_01_2000
        specifies the time in seconds since 01/01/2000 0:00:00 (UTC).
    • Constructor Detail

      • CMTIME

        public CMTIME()
      • CMTIME

        public CMTIME​(long secondsSince2000)
      • CMTIME

        public CMTIME​(java.util.Date date)
    • Method Detail

      • toString

        public java.lang.String toString()
        Return a string representing the current time. The format is fixed for all locales (WIBU format) and always UTC, e.g. "2009-07-15 13:54:12"
        Overrides:
        toString in class java.lang.Object
      • readFrom

        public boolean readFrom​(byte[] bcmtime)
        This methods reads data from a byte array in the native endian format
        Parameters:
        bcmtime -
        Returns:
        true on success.
      • setEpochTimeInSeconds

        public boolean setEpochTimeInSeconds​(long secondsSince1970)
        Sets the new time using the seconds since 1.1.1970 (Epoch).
        Parameters:
        secondsSince1970 - seconds since 1.1.1970, must be positive value
      • setTimeInSeconds

        public boolean setTimeInSeconds​(long secondsSince2000)
        Sets the new time using the seconds since 1.1.2000 (CodeMeter native format).
        Parameters:
        secondsSince2000 - seconds since 1.1.2000, must be positive value
      • recalculateTimeInSeconds

        public void recalculateTimeInSeconds()
        This methods recalculates the secondsSince01_01_2000 member and must be called if any other of the CMTIME members has been set/modified.
      • toJavaDate

        public java.util.Date toJavaDate()
        Converts a CMTIME-Object to a Java Date class.