public class CosemTime
extends java.lang.Object
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.
|
CosemTime(long timeStamp) |
Modifier and Type | Method and Description |
---|---|
long |
asUnixTimeStanp() |
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 CosemTime(long timeStamp)
public static CosemTime decode(java.io.InputStream inputStream) throws java.io.IOException
java.io.IOException
public static CosemTime decode(byte[] octetString)
public byte[] encode()
CosemDateFormat
public java.util.Calendar toCalendar()
CosemDateFormat
Calendar
.public int length()
CosemDateFormat
public int get(CosemDateFormat.Field field)
CosemDateFormat
field
- the field which should be retrieved.public long asUnixTimeStanp()
asUnixTimeStanp
in interface CosemDateFormat