public abstract class Property<T>
extends java.lang.Object
GUIelement
. This class can also react to
reading and writing to this value by firing java callbacks and also CLUC
callbacs (special functions in the user code).Constructor and Description |
---|
Property(int id,
java.lang.String name,
T initializer,
GUIelement ge) |
Property(Property<T> source) |
Modifier and Type | Method and Description |
---|---|
PropertyCallback |
getGetterPropertyCallback() |
int |
getId()
Returns the ID of this
Property . |
java.lang.String |
getName()
Returns the name of this
Property . |
PropertyCallback |
getSetterPropertyCallback() |
abstract java.lang.String |
getTypeName()
Get the string, representing the name of the type.
|
T |
getValue() |
T |
getValue(boolean javaCallbacks,
boolean userCallbacks)
Returns the value assigned to this Property; optionally trigers Java
callbacks before that (allowing it to first calculate the value before
returning it) and optionally also then triggers user callbacks, allowing
user code to react to the event of the property being read.
|
T |
getValueSilent() |
Property<T> |
makeCopy() |
void |
recompile()
Recompile the CLUC code snippets, used to call the getter and setter CLUC callbacks
of this
Property , if possible (that is, if the respective bodies
of the getter and setter are present in the user code). |
void |
sendValue()
Inform the module assigned to this
Property about the fact it has
been updated, sending the new value. |
void |
setGetterPropertyCallback(PropertyCallback getterPropertyCallback)
Provide the
PropertyCallback fired when the value of this
Property is accessed (read) from CLUC code. |
void |
setIfIShouldUpdateToModule(boolean shouldIt)
Set, whether any module is notified about the changes of this
Property |
void |
setSetterPropertyCallback(PropertyCallback setterPropertyCallback)
Provide the
PropertyCallback fired when the value of this
Property is accessed (changed) from CLUC code. |
void |
setValue(T newValue)
Set the value, firing both Java and User callbacks.
|
void |
setValue(T newValue,
boolean javaCallbacks,
boolean userCallbacks)
Sets the value property, then optionally fires Java callback, then
optionally fires user code.
|
void |
setValueSilent(T newValue)
Sets the value silently, that is, without firing any callbacks.
|
boolean |
updatesModule() |
public Property(int id, java.lang.String name, T initializer, GUIelement ge)
public PropertyCallback getGetterPropertyCallback()
PropertyCallback
fired when the value of this
Property
is accessed from CLUC code.public void setGetterPropertyCallback(PropertyCallback getterPropertyCallback)
PropertyCallback
fired when the value of this
Property
is accessed (read) from CLUC code.getterPropertyCallback
- the PropertyCallback
fired when the
value of this Property
is accessed from CLUC code.public PropertyCallback getSetterPropertyCallback()
PropertyCallback
fired when the value of this
Property
is accessed (changed) from CLUC code.
value of this Property
is adjusted from CLUC code.public void setSetterPropertyCallback(PropertyCallback setterPropertyCallback)
PropertyCallback
fired when the value of this
Property
is accessed (changed) from CLUC code.setterPropertyCallback
- the PropertyCallback
fired when the
value of this Property
is adjusted from CLUC code.public boolean updatesModule()
Property
public void setIfIShouldUpdateToModule(boolean shouldIt)
Property
shouldIt
- whether any module is notified about the changes of this
Property
public void sendValue()
Property
about the fact it has
been updated, sending the new value.public void recompile()
Property
, if possible (that is, if the respective bodies
of the getter and setter are present in the user code).public T getValueSilent()
public T getValue()
public T getValue(boolean javaCallbacks, boolean userCallbacks)
javaCallbacks
- whether Java callbacks should be fireduserCallbacks
- whether user callbacks should be firedpublic void setValueSilent(T newValue)
newValue
- public void setValue(T newValue)
newValue
- public void setValue(T newValue, boolean javaCallbacks, boolean userCallbacks)
newValue
- javaCallbacks
- userCallbacks
- public int getId()
Property
. Objects with properties, such
as GUIelement
can then use this ID to refer to the
Property
. In such a case, this ID is used to uniquely identify
such Property
. Since looking up a Property
by its ID
is less computationally intensive than doing so by the name, this is usually the
preferred way. CLUC user functions, such as SetFloatPropertyUserFunctionToken
refer to the individual properthies by their IDs.Property
getName()
public java.lang.String getName()
Property
. Objects with properties, such
as GUIelement
can then use this name to refer to the
Property
. In such a case, this name is used to uniquely identify
such Property
Property
public abstract java.lang.String getTypeName()