Package modelarium.attributes
Class Property<T>
java.lang.Object
modelarium.attributes.Attribute
modelarium.attributes.Property<T>
- Type Parameters:
T- the type of value this property holds
- All Implemented Interfaces:
Serializable,DeepCopyable<Attribute>
- Direct Known Subclasses:
FunctionalProperty
Represents a stateful, typed property attribute.
Properties hold and expose a value of type T, and are updated during each tick
via the run() method. Property values may represent counters, flags, metrics, etc.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a property with a generated name, a recording flag, and type.Constructs a property with a generated name, recording enabled, and type.Constructs a property with a specific name, recording flag, and type.Constructs a property with a specific name, recording enabled, and type. -
Method Summary
Methods inherited from class modelarium.attributes.Attribute
getAssociatedModelElement, getName, isRecorded, setAssociatedModelElement
-
Constructor Details
-
Property
Constructs a property with a specific name, recording flag, and type.- Parameters:
name- the property nameisRecorded- whether it is recordedtype- the class of the property's value type
-
Property
Constructs a property with a generated name, a recording flag, and type.- Parameters:
isRecorded- whether the property is recordedtype- the class of the property's value type
-
Property
Constructs a property with a specific name, recording enabled, and type.- Parameters:
name- the property nametype- the class of the property's value type
-
Property
Constructs a property with a generated name, recording enabled, and type.- Parameters:
type- the class of the property's value type
-
-
Method Details
-
getType
Gets the runtime type of this property's value.- Returns:
- the value type class
-
set
Updates the value of this property.- Parameters:
value- the new value to assign
-
get
Retrieves the current value of this property.- Returns:
- the value of the property
-
run
public abstract void run()Executes logic for updating or using the property's value. -
deepCopy
-