ElementType
- type of the actual value elements. For primitives, this is the
boxed variant.public interface ChannelAccessTimeValue<ElementType> extends ChannelAccessAlarmValue<ElementType>
Channel Access value that represents a type with alarm information and a
time-stamp (DBR_TIME_*
).
This interface should not be implemented by user-defined classes. Code that
wants to create an instance implementing this interface should use the
methods provided by ChannelAccessValueFactory
instead.
Modifier and Type | Method and Description |
---|---|
ChannelAccessTimeValue<ElementType> |
asReadOnlyValue()
Returns a read-only version of this value.
|
ChannelAccessTimeValue<ElementType> |
clone()
Creates and returns a copy of this object.
|
int |
getTimeNanoseconds()
Returns the nanoseconds part of the value's time-stamp.
|
int |
getTimeSeconds()
Returns the seconds part of the value's time-stamp.
|
ChannelAccessTimeStamp |
getTimeStamp()
Returns the time-stamp associated with this value.
|
void |
setTimeNanoseconds(int timeStampNanoseconds)
Sets the nanoseconds part of the value's time-stamp.
|
void |
setTimeSeconds(int timeStampSeconds)
Sets the seconds part of the value's time-stamp.
|
void |
setTimeStamp(ChannelAccessTimeStamp timeStamp)
Sets the time-stamp associated with this value.
|
getAlarmSeverity, getAlarmStatus, setAlarmSeverity, setAlarmStatus
equals, getGenericValueElement, getType, getValueSize, hashCode, isReadOnly, iterator, toString
ChannelAccessTimeStamp getTimeStamp()
Returns the time-stamp associated with this value. Typically, this time-stamp indicates the time when the value has been updated last.
Please note that calling this method will allocate a new object each
time. If performance is critical, the getTimeSeconds()
and
getTimeNanoseconds()
methods should be preferred instead.
null
).int getTimeSeconds()
getTimeNanoseconds()
,
getTimeStamp()
int getTimeNanoseconds()
getTimeSeconds()
to get a more precise time-stamp.getTimeSeconds()
,
getTimeStamp()
void setTimeStamp(ChannelAccessTimeStamp timeStamp)
timeStamp
- new time-stamp (never null
).UnsupportedOperationException
- if this value is read-only (ChannelAccessValue.isReadOnly()
returns
true
).void setTimeSeconds(int timeStampSeconds)
timeStampSeconds
- new seconds part of the value's time-stamp.UnsupportedOperationException
- if this value is read-only (ChannelAccessValue.isReadOnly()
returns
true
).setTimeNanoseconds(int)
,
setTimeStamp(ChannelAccessTimeStamp)
void setTimeNanoseconds(int timeStampNanoseconds)
getTimeSeconds()
to get a more precise time-stamp.timeStampNanoseconds
- new nanoseconds part of the value's time-stamp. Must be a
number between 0 and 999999999.IllegalArgumentException
- if number is less than zero or greater than 999999999.UnsupportedOperationException
- if this value is read-only (ChannelAccessValue.isReadOnly()
returns
true
).setTimeSeconds(int)
,
setTimeStamp(ChannelAccessTimeStamp)
ChannelAccessTimeValue<ElementType> asReadOnlyValue()
Returns a read-only version of this value. If the value is read-only, this value is returned. Otherwise, a wrapped version of this value, that does not allow modifications is returned.
Please note that the read-only value is not a copy of this value, but just a wrapper around it. This means, that modifications of the wrapped value will result in modifications of the read-only value. Therefore it is bad practice to modify a value that has been used as the base for a read-only value, because code that still has a reference to the read-only value might not expect this change and thus fail unexpectedly.
asReadOnlyValue
in interface ChannelAccessAlarmValue<ElementType>
asReadOnlyValue
in interface ChannelAccessGettableValue<ElementType>
asReadOnlyValue
in interface ChannelAccessValue<ElementType>
null
).ChannelAccessTimeValue<ElementType> clone()
Creates and returns a copy of this object. The object returned is completely independent from this object. This means that modifications to this object will not affect the returned object and vice-versa.
The object returned is guaranteed to be completely identical to this
object, including its type. This means that
x.clone().equals(x)
and
x.clone().getClass() == x.getClass()
are always
true
.
The returned value is guaranteed to allow write access, even if this value is read-only. This means that cloning a read-only value is a good way to get a writable copy.
clone
in interface ChannelAccessAlarmValue<ElementType>
clone
in interface ChannelAccessGettableValue<ElementType>
clone
in interface ChannelAccessValue<ElementType>
Copyright © 2014–2016 aquenos GmbH. All rights reserved.