public final class ChannelAccessEventMask
extends java.lang.Object
Mask used for the subscription to a channel. The mask defines which events are sent to the client. An event is only sent to the client if at least one of the bits in the event's event mask is also set in the event mask the client set when creating the subscription.
Instances of this class are constant. Therefore, methods that modify the mask
do not modify the instance they are called one. Instead, they return a new
instance with the modification (like String
s do).
Type | Property and Description |
---|---|
boolean |
is
Gets the value of the property property.
|
Modifier and Type | Field and Description |
---|---|
static ChannelAccessEventMask |
DBE_ALARM
Mask that has only the
DBE_ALARM flag set. |
static ChannelAccessEventMask |
DBE_ALL
Mask that has all flags (
DBE_VALUE , DBE_ARCHIVE
, DBE_ALARM , and DBE_PROPERTY ) set. |
static ChannelAccessEventMask |
DBE_ARCHIVE
Mask that has only the
DBE_ARCHIVE flag set. |
static ChannelAccessEventMask |
DBE_NONE
Mask that has no flag set.
|
static ChannelAccessEventMask |
DBE_PROPERTY
Mask that has only the
DBE_PROPERTY flag set. |
static ChannelAccessEventMask |
DBE_VALUE
Mask that has only the
DBE_VALUE flag set. |
Modifier and Type | Method and Description |
---|---|
ChannelAccessEventMask |
and(ChannelAccessEventMask other)
Returns the mask that is the result of combining this mask and the
other mask using a binary and operation. |
boolean |
equals(java.lang.Object obj)
Tells whether the specified object represents the same event mask.
|
static ChannelAccessEventMask |
forNumericMask(short mask)
Returns the mask that is represented by the specified numeric mask.
|
int |
hashCode()
Returns a hash code value for this message.
|
boolean |
isAlarm()
Returns whether this mask has the the
DBE_ALARM flag set. |
boolean |
isAny()
Returns whether any of the flags in this mask are set.
|
boolean |
isArchive()
Returns whether this mask has the the
DBE_ARCHIVE flag set. |
boolean |
isProperty()
Gets the value of the property property.
|
boolean |
isValue()
Returns whether this mask has the the
DBE_VALUE flag set. |
ChannelAccessEventMask |
not()
Returns the mask that is the inverse of this mask.
|
ChannelAccessEventMask |
or(ChannelAccessEventMask other)
Returns the mask that is the result of combining this mask and the
other mask using a binary or operation. |
ChannelAccessEventMask |
setAlarm(boolean flag)
Sets or clears the
DBE_ALARM flag. |
ChannelAccessEventMask |
setArchive(boolean flag)
Sets or clears the
DBE_ARCHIVE flag. |
ChannelAccessEventMask |
setProperty(boolean flag)
Sets or clears the
DBE_PROPERTY flag. |
ChannelAccessEventMask |
setValue(boolean flag)
Sets or clears the
DBE_VALUE flag. |
short |
toNumericMask()
Returns the numeric representation for this mask.
|
java.lang.String |
toString()
Returns a string representation of this event mask.
|
public static final ChannelAccessEventMask DBE_NONE
public static final ChannelAccessEventMask DBE_VALUE
DBE_VALUE
flag set. An event with
this mask is triggered for every significant value change. The dead-band
for significant value changes is configured on the server side.public static final ChannelAccessEventMask DBE_ARCHIVE
DBE_ARCHIVE
flag set. An event with
this mask is triggered for every archive-significant value change. The
dead-band for archive-significant value changes is configured on the
server side. Typically, the dead-band for such events is at least as
large as the one for DBE_VALUE
events.public static final ChannelAccessEventMask DBE_ALARM
DBE_ALARM
flag set. An event with
this mask is triggered when a channel's alarm state changes.public static final ChannelAccessEventMask DBE_PROPERTY
DBE_PROPERTY
flag set. An event with
this mask is triggered when a property of a channel (e.g. display limits,
engineering units, enum labels, etc.) changes.public static final ChannelAccessEventMask DBE_ALL
DBE_VALUE
, DBE_ARCHIVE
, DBE_ALARM
, and DBE_PROPERTY
) set.public ChannelAccessEventMask and(ChannelAccessEventMask other)
other
mask using a binary and operation. This means
that the resulting mask has all flags set that are set in both this
instance and the other instance.other
- mask this mask should be combined with.public ChannelAccessEventMask or(ChannelAccessEventMask other)
other
mask using a binary or operation. This means
that the resulting mask has all flags set that are set in this instance
or the other instance.other
- mask this mask should be combined with.public ChannelAccessEventMask not()
public boolean isAny()
true
if at least one flag in this mask is set,
false
if none of the flags is set (this mask is
equal to DBE_NONE
).public boolean isValue()
DBE_VALUE
flag set. This
is the same as using this.and(DBE_VALUE).isAny()
.true
if this mask has the DBE_VALUE
flag set.public ChannelAccessEventMask setValue(boolean flag)
DBE_VALUE
flag. This does not modify this
mask instance. The modified mask is returned instead.flag
- true
if the DBE_VALUE
flag should be
set, false
if it should be cleared.DBE_VALUE
flag set or cleared.public boolean isArchive()
DBE_ARCHIVE
flag set. This
is the same as using this.and(DBE_ARCHIVE).isAny()
.true
if this mask has the DBE_ARCHIVE
flag set.public ChannelAccessEventMask setArchive(boolean flag)
DBE_ARCHIVE
flag. This does not modify this
mask instance. The modified mask is returned instead.flag
- true
if the DBE_ARCHIVE
flag should
be set, false
if it should be cleared.DBE_ARCHIVE
flag set or cleared.public boolean isAlarm()
DBE_ALARM
flag set. This
is the same as using this.and(DBE_ALARM).isAny()
.true
if this mask has the DBE_ALARM
flag set.public ChannelAccessEventMask setAlarm(boolean flag)
DBE_ALARM
flag. This does not modify this
mask instance. The modified mask is returned instead.flag
- true
if the DBE_ALARM
flag should be
set, false
if it should be cleared.DBE_ALARM
flag set or cleared.public boolean isProperty()
public ChannelAccessEventMask setProperty(boolean flag)
DBE_PROPERTY
flag. This does not modify this
mask instance. The modified mask is returned instead.flag
- true
if the DBE_PROPERTY
flag should
be set, false
if it should be cleared.DBE_PROPERTY
flag set or cleared.public short toNumericMask()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- reference object with which this object is compared.true
if obj
is an event mask that has
exactly the same bits set as this mask, false
otherwise.public int hashCode()
Returns a hash code value for this message. This method is supported for the benefit of hash tables. The hash code is calculated based on the combination of all mask bits.
This means that two identical masks always have the same hash code. The calculation of the hash code is designed in a way so that two different masks are very likely to have different hash codes, but this is not strictly guaranteed.
hashCode
in class java.lang.Object
public java.lang.String toString()
DBE_VALUE
) of each bit that is set in this mask, separating
the names by the pipe character("|") if more than one bit is set.toString
in class java.lang.Object
public static ChannelAccessEventMask forNumericMask(short mask)
mask
- numeric mask (e.g. received over the network). Only the least
significant four bits are used.toNumericMask()
Copyright © 2014–2017 aquenos GmbH. All rights reserved.