public class CosemTime extends java.lang.Object implements CosemDateFormat
CosemDateFormat.Field
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
static CosemTime |
decode(byte[] octetString) |
static CosemTime |
decode(java.io.InputStream inputStream) |
byte[] |
encode()
The octet string.
|
int |
get(CosemDateFormat.Field field)
Retrieves the value for a certain value.
|
int |
length()
The size of the octet string.
|
java.util.Calendar |
toCalendar()
Converts the COSEM DATE/TIME to a
Calendar . |
public CosemTime(int hour, int minute, int second)
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.java.lang.IllegalArgumentException
- if a parameter does not fit the rangepublic CosemTime(int hour, int minute, int second, int hundredths) throws java.lang.IllegalArgumentException
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.java.lang.IllegalArgumentException
- if a parameter does not fit the rangepublic static CosemTime decode(java.io.InputStream inputStream) throws java.io.IOException
java.io.IOException
public static CosemTime decode(byte[] octetString)
public byte[] encode()
CosemDateFormat
encode
in interface CosemDateFormat
public java.util.Calendar toCalendar()
CosemDateFormat
Calendar
.toCalendar
in interface CosemDateFormat
public int length()
CosemDateFormat
length
in interface CosemDateFormat
public int get(CosemDateFormat.Field field)
CosemDateFormat
get
in interface CosemDateFormat
field
- the field which should be retrieved.