|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simantics.databoard.accessor.binary.BinaryObject
org.simantics.databoard.accessor.binary.BinaryVariant
public class BinaryVariant
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.simantics.databoard.accessor.Accessor |
---|
Accessor.Listener |
Constructor Summary | |
---|---|
BinaryVariant(BinaryObject parent,
Blob blob,
DataType type)
|
Method Summary | ||
---|---|---|
void |
addListener(Accessor.Listener listener,
InterestSet interestSet,
AccessorReference path)
Place a listener to an accessor node. |
|
|
getAccessor(AccessorReference reference)
Get an accessor to a sub-container. |
|
DataType |
getContentType()
|
|
java.lang.Object |
getContentValue(Binding contentBinding)
|
|
|
getValueAccessor()
Get the value |
|
void |
removeListener(Accessor.Listener listener)
Remove a listener. |
|
void |
setContentValue(Binding valueBinding,
java.lang.Object value)
Set the value of this variant. |
|
void |
setContentValueNoflush(Binding valueBinding,
java.lang.Object value)
|
|
void |
setValueNoflush(Binding variantBinding,
java.lang.Object variantValue)
Write a new value and don't flush the buffer |
|
VariantType |
type()
Get structural represtentation of the accessor presented in databoard's type system format. |
Methods inherited from class org.simantics.databoard.accessor.binary.BinaryObject |
---|
apply, close, createAccessor, file, flush, getBinary, getSource, getValue, setValue, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.simantics.databoard.accessor.file.FileAccessor |
---|
close, file, flush |
Methods inherited from interface org.simantics.databoard.accessor.Accessor |
---|
apply, getValue, setValue |
Constructor Detail |
---|
public BinaryVariant(BinaryObject parent, Blob blob, DataType type)
Method Detail |
---|
public VariantType type()
Accessor
type
in interface Accessor
type
in interface VariantAccessor
type
in class BinaryObject
public <T extends Accessor> T getValueAccessor() throws AccessorConstructionException
VariantAccessor
getValueAccessor
in interface VariantAccessor
AccessorConstructionException
public void setContentValueNoflush(Binding valueBinding, java.lang.Object value) throws AccessorException
setContentValueNoflush
in interface FileVariantAccessor
AccessorException
public void setContentValue(Binding valueBinding, java.lang.Object value) throws AccessorException
VariantAccessor
Accessor.setValue(org.simantics.databoard.binding.Binding, Object)
which sets the _variant_ value.
setContentValue
in interface VariantAccessor
AccessorException
public DataType getContentType() throws AccessorException
getContentType
in interface VariantAccessor
AccessorException
public java.lang.Object getContentValue(Binding contentBinding) throws AccessorException
getContentValue
in interface VariantAccessor
AccessorException
public <T extends Accessor> T getAccessor(AccessorReference reference) throws AccessorConstructionException
Accessor
InvalidatedEvent is thrown from the accessor if it is unlinked from the parent hierarchy.
getAccessor
in interface Accessor
reference
- component reference or null
to return _this_ accessor
AccessorConstructionException
public void addListener(Accessor.Listener listener, InterestSet interestSet, AccessorReference path) throws AccessorException
Accessor
The synchronization contract is implementation specific, so read the document. A common contract is that the listener object must not make modifications to the accessor within the handle event function. The correct strategy is to collect events and mutate the accessor afterwards.
Each event instance spawned by the listener, is annotated with a reference that describes the reference path of the node to which the event applies to. The path originates from the node where the listener was placed.
Listener is attached to the container that holds the value at the time at the of the adding. For example, If a listener is attached to an array of element at index 3, and a new value is inserted at position 2, the listener still monitors the same container, which is now at index 4. The references of incoming the events are modified to have the new index.
Also, if a new value is assigned to the parent of an object that is listened, the listener keeps on monitoring the new value at the same reference. This doesn't apply when a new value is set to a union of different tag, to a variant with a new type, or value is removed from Optional type. In these two cases the listener is invalidated.
See ChangeSet
is an implementation that collects events.
addListener
in interface Accessor
addListener
in class BinaryObject
path
- path to the accessor or null
. This is used in the events the accessor produces
AccessorException
collects events
public void removeListener(Accessor.Listener listener) throws AccessorException
Accessor
removeListener
in interface Accessor
removeListener
in class BinaryObject
AccessorException
public void setValueNoflush(Binding variantBinding, java.lang.Object variantValue) throws AccessorException
BinaryObject
setValueNoflush
in interface FileAccessor
setValueNoflush
in class BinaryObject
AccessorException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |