Class FieldProperty
java.lang.Object
nl.tudelft.simulation.introspection.AbstractProperty
nl.tudelft.simulation.introspection.fields.FieldProperty
- All Implemented Interfaces:
Property
The field implementation of the Property interface. See for details.
Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Since:
- 1.5
- Author:
- Peter Jacobs , Alexander Verbraeck, Niels Lang.
-
Constructor Summary
ConstructorDescriptionFieldProperty
(Object owner, Field descriptor) constructs a new FieldProperty.FieldProperty
(Object owner, Field descriptor, boolean editable) constructs a new FieldProperty. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the introspected object, which contains this Property.getName()
Retrieves the name of the property.Class<?>
getType()
Returns the type of this property's value.getValue()
Returns the current value of this property.boolean
Returns whether the value of this property may be altered.void
setRegularValue
(Object value) Method used to set a regular (i.e. not-composite) property value.Methods inherited from class nl.tudelft.simulation.introspection.AbstractProperty
getComponentType, getComposedType, setValue, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.tudelft.simulation.introspection.Property
getComponentType, getComposedType, setValue
-
Constructor Details
-
FieldProperty
constructs a new FieldProperty.- Parameters:
owner
- Object; its ownerdescriptor
- Field; the descriptoreditable
- boolean; is the property editable
-
FieldProperty
constructs a new FieldProperty.- Parameters:
owner
- Object; its ownerdescriptor
- Field; the descriptor
-
-
Method Details
-
getName
Retrieves the name of the property. -
getType
Returns the type of this property's value. -
setRegularValue
Method used to set a regular (i.e. not-composite) property value.- Specified by:
setRegularValue
in classAbstractProperty
- Parameters:
value
- Object; the new value
-
getValue
Returns the current value of this property. -
getInstance
Retrieves the introspected object, which contains this Property.- Specified by:
getInstance
in interfaceProperty
- Returns:
- the instance
-
isEditable
public boolean isEditable()Returns whether the value of this property may be altered.- Specified by:
isEditable
in interfaceProperty
- Returns:
- 'True', when this property's value can be altered, 'false' otherwise.
-