Class FieldProperty
- java.lang.Object
-
- nl.tudelft.simulation.introspection.AbstractProperty
-
- nl.tudelft.simulation.introspection.fields.FieldProperty
-
- All Implemented Interfaces:
Property
public class FieldProperty extends AbstractProperty implements Property
The field implementation of the Property interface. See for details.Copyright (c) 2002-2023 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
Constructors Constructor Description FieldProperty(Object owner, Field descriptor)constructs a new FieldProperty.FieldProperty(Object owner, Field descriptor, boolean editable)constructs a new FieldProperty.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetInstance()Retrieves the introspected object, which contains this Property.StringgetName()Retrieves the name of the property.Class<?>getType()Returns the type of this property's value.ObjectgetValue()Returns the current value of this property.booleanisEditable()Returns whether the value of this property may be altered.voidsetRegularValue(Object value)Method used to set a regular (i.e.-
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
-
-
-
-
Method Detail
-
getName
public String getName()
Retrieves the name of the property.
-
getType
public Class<?> getType()
Returns the type of this property's value.
-
setRegularValue
public void setRegularValue(Object value)
Method used to set a regular (i.e. not-composite) property value.- Specified by:
setRegularValuein classAbstractProperty- Parameters:
value- Object; the new value
-
getValue
public Object getValue()
Returns the current value of this property.
-
getInstance
public Object getInstance()
Retrieves the introspected object, which contains this Property.- Specified by:
getInstancein interfaceProperty- Returns:
- the instance
-
isEditable
public boolean isEditable()
Returns whether the value of this property may be altered.- Specified by:
isEditablein interfaceProperty- Returns:
- 'True', when this property's value can be altered, 'false' otherwise.
-
-