Class CosemTime

  • All Implemented Interfaces:
    CosemDateFormat

    public class CosemTime
    extends java.lang.Object
    implements CosemDateFormat
    Class representing a COSEM Time.
    • Constructor Summary

      Constructors 
      Constructor Description
      CosemTime​(int hour, int minute, int second)
      Constructs a COSEM Time.
      CosemTime​(int hour, int minute, int second, int hundredths)
      Constructs a COSEM Time.
    • Constructor Detail

      • CosemTime

        public CosemTime​(int hour,
                         int minute,
                         int second)
        Constructs a COSEM Time.
        Parameters:
        hour - the hour from 0 to 23. 0xff if not specified.
        minute - the minute from 0 to 59. 0xff if not specified.
        second - the second from 0 to 59. 0xff if not specified.
        Throws:
        java.lang.IllegalArgumentException - if a parameter does not fit the range
      • CosemTime

        public CosemTime​(int hour,
                         int minute,
                         int second,
                         int hundredths)
                  throws java.lang.IllegalArgumentException
        Constructs a COSEM Time.
        Parameters:
        hour - the hour from 0 to 23. 0xff if not specified.
        minute - the minute from 0 to 59. 0xff if not specified.
        second - the second from 0 to 59. 0xff if not specified.
        hundredths - the hundredths seconds from 0 to 99. 0xff if not specified.
        Throws:
        java.lang.IllegalArgumentException - if a parameter does not fit the range
    • Method Detail

      • decode

        public static CosemTime decode​(java.io.InputStream inputStream)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • decode

        public static CosemTime decode​(byte[] octetString)
      • encode

        public byte[] encode()
        Description copied from interface: CosemDateFormat
        The octet string.
        Specified by:
        encode in interface CosemDateFormat
        Returns:
        the octet string.
      • length

        public int length()
        Description copied from interface: CosemDateFormat
        The size of the octet string.
        Specified by:
        length in interface CosemDateFormat
        Returns:
        the size.
      • get

        public int get​(CosemDateFormat.Field field)
        Description copied from interface: CosemDateFormat
        Retrieves the value for a certain value.
        Specified by:
        get in interface CosemDateFormat
        Parameters:
        field - the field which should be retrieved.
        Returns:
        the value as an int32.