public class HeaderElement extends FrameElement
Typically, this element is part of a larger array of other instance of this same class. The
expression is only used for in the get()
and the set(com.goldencode.p2j.util.BaseDataType)
is unsupported since
this is a one-way transfer to the client.
Modifier and Type | Field and Description |
---|---|
private java.lang.Object[] |
args
Arguments to be passed to the non-capturing lambda form.
|
private BaseDataType |
cached
For literals and simple variables, we can avoid inner classes and lambdas.
|
private java.util.function.Function<java.lang.Object[],BaseDataType> |
func
Non-capturing form of complex expression.
|
private Resolvable |
resolver
For resolvables, we don't use a lambda but cache the instance and access it directly.
|
private java.util.function.Supplier<BaseDataType> |
source
The (possibly capturing) expression to be executed at
get() time. |
private GenericWidget |
widget
The widget associated with this element.
|
Constructor and Description |
---|
HeaderElement(BaseDataType val,
GenericWidget widget)
Create an instance.
|
HeaderElement(boolean source,
GenericWidget widget)
Create an instance.
|
HeaderElement(double source,
GenericWidget widget)
Create an instance.
|
HeaderElement(java.util.function.Function<java.lang.Object[],BaseDataType> func,
GenericWidget widget,
java.lang.Object... args)
Create an instance.
|
HeaderElement(int source,
GenericWidget widget)
Create an instance.
|
HeaderElement(Resolvable source,
GenericWidget widget)
Create an instance.
|
HeaderElement(java.lang.String source,
GenericWidget widget)
Create an instance.
|
HeaderElement(java.util.function.Supplier<BaseDataType> source,
GenericWidget widget)
Create an instance.
|
Modifier and Type | Method and Description |
---|---|
BaseDataType |
get()
Get a copy of the referenced object's current runtime value.
|
GenericWidget |
getWidget()
Accesses the widget associated with this frame element.
|
void |
set(BaseDataType val)
Set the referenced object's current runtime value to the given value.
|
assignOnly, bypass, getAccumulator, getFormat, getFormattedValue, hasFormat, statsColumn, widgetOnly, wordWrap
private BaseDataType cached
private Resolvable resolver
private java.util.function.Supplier<BaseDataType> source
get()
time.private java.util.function.Function<java.lang.Object[],BaseDataType> func
private java.lang.Object[] args
private GenericWidget widget
public HeaderElement(int source, GenericWidget widget)
source
- The data used for the header.widget
- The widget instance representing the exact frame field and state of that field.
Must NOT be null
.public HeaderElement(double source, GenericWidget widget)
source
- The data used for the header.widget
- The widget instance representing the exact frame field and state of that field.
Must NOT be null
.public HeaderElement(boolean source, GenericWidget widget)
source
- The data used for the header.widget
- The widget instance representing the exact frame field and state of that field.
Must NOT be null
.public HeaderElement(java.lang.String source, GenericWidget widget)
source
- The data used for the header.widget
- The widget instance representing the exact frame field and state of that field.
Must NOT be null
.public HeaderElement(BaseDataType val, GenericWidget widget)
val
- The variable to be de-referenced for its value as header data.widget
- The widget instance representing the exact frame field and state of that field.
Must NOT be null
.public HeaderElement(Resolvable source, GenericWidget widget)
source
- The expression to be evaluated for its value as header data.widget
- The widget instance representing the exact frame field and state of that field.
Must NOT be null
.public HeaderElement(java.util.function.Supplier<BaseDataType> source, GenericWidget widget)
source
- The expression to be evaluated for its value as header data.widget
- The widget instance representing the exact frame field and state of that field.
Must NOT be null
.public HeaderElement(java.util.function.Function<java.lang.Object[],BaseDataType> func, GenericWidget widget, java.lang.Object... args)
func
- The expression to be evaluated for its value as header data.widget
- The widget instance representing the exact frame field and state of that field.
Must NOT be null
.args
- The arguments to be passed to the function when it is executed.public GenericWidget getWidget()
getWidget
in class FrameElement
public BaseDataType get()
public void set(BaseDataType val)
val
- The current value to be assigned into the referenced object.
This value will be ignored for embedded assignments and can
be passed as null
.