Class PropertyHolder
- java.lang.Object
-
- pulse.util.UpwardsNavigable
-
- pulse.util.Group
-
- pulse.util.Accessible
-
- pulse.util.PropertyHolder
-
- All Implemented Interfaces:
Serializable,Descriptive
- Direct Known Subclasses:
AbsorptionModel,AbstractData,AbstractIntegrator,Baseline,Buffer,Calculation,CorrelationTest,DifferenceScheme,Discretisation,Grid,Harmonic,IterativeSolver,LinearOptimiser,Metadata,ODEIntegrator,OptimisablePolyline,PathOptimiser,Problem,Pulse,PulseTemporalShape,RadiativeTransferCoupling,RadiativeTransferSolver,Range,Statistic,StretchedGrid,ThermalProperties
public abstract class PropertyHolder extends Accessible
AnAccessiblethat has a list of parameters it accepts as its own and a list ofPropertyHolderListenerthat track changes with all properties of theAccessible.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PropertyHolder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(PropertyHolderListener l)booleanareDetailsHidden()By default, this is set tofalse.List<Property>data()Lists all data contained in thisPropertyHolder.Stringdescribe()Uses the SearchTask id (if present) to describe this UpwardsNavigable.voidfirePropertyChanged(Object source, Property property)StringgetDescriptor()If not null, will return the prefix, otherwise calls the superclass method.List<PropertyHolderListener>getListeners()StringgetPrefix()booleanignoreSiblings()ShouldAccessibles that belong to thisPropertyHolderbe ignored when thisPropertyHolderis displayed in a table?voidinitListeners()booleanisListedNumericType(NumericPropertyKeyword p)booleanisListedParameter(Property p)Checks whetherp, which is either a generic or a numeric property, is listed as as parameter for thisPropertyHolder.Set<NumericPropertyKeyword>listedKeywords()By default, this will search the children of thisPropertyHolderto collect the types of their listed numeric parameters recursively.List<Property>listedTypes()By default, collects a list of default properties corresponding to types defined by listedKeywords().List<NumericProperty>numericData()Lists all numeric data contained in thisPropertyHolder.voidparameterListChanged()voidremoveListeners()voidsetPrefix(String prefix)voidupdateProperties(Object sourceComponent, PropertyHolder propertyHolder)This method will update thisPropertyHolderwith all properties that are contained in a differentpropertyHolder, if they also are present in the former.booleanupdateProperty(Object sourceComponent, Property updatedProperty)Attempts to update anupdatedPropertysimilar to one found in thisPropertyHolder.-
Methods inherited from class pulse.util.Accessible
accessibleChildren, genericProperties, genericProperty, numericProperties, numericProperty, property, set, update, update
-
Methods inherited from class pulse.util.UpwardsNavigable
addHierarchyListener, getHierarchyListeners, getParent, identify, removeHierarchyListener, removeHierarchyListeners, setParent, specificAncestor, tellParent
-
-
-
-
Method Detail
-
listedKeywords
public Set<NumericPropertyKeyword> listedKeywords()
By default, this will search the children of this
PropertyHolderto collect the types of their listed numeric parameters recursively.- Returns:
- a set of
NumericPropertyKeywordinstances, which have been explicitly marked as a listed parameter for thisPropertyHolder.
-
listedTypes
public List<Property> listedTypes()
By default, collects a list of default properties corresponding to types defined by listedKeywords(). However, this method is overridable to include non-numeric properties.
- Returns:
- a list of
Propertyinstances, which have been explicitly marked as a listed parameter for thisPropertyHolder.
-
initListeners
public void initListeners()
- Overrides:
initListenersin classUpwardsNavigable
-
isListedNumericType
public boolean isListedNumericType(NumericPropertyKeyword p)
-
isListedParameter
public boolean isListedParameter(Property p)
Checks whetherp, which is either a generic or a numeric property, is listed as as parameter for thisPropertyHolder.- Parameters:
p- theProperty- Returns:
trueifpis listed,falseotherwise.
-
data
public List<Property> data()
Lists all data contained in thisPropertyHolder. The data objects must satisfy the following conditions: (a) they must be explicitly listed; (b) the corresponding property must not be auto-adjustable if the details need to remain hidden.- Returns:
- a list of data, which combines generic and numeric properties.
-
numericData
public List<NumericProperty> numericData()
Lists all numeric data contained in thisPropertyHolder. The data objects must satisfy the following conditions: (a) they must be explicitly listed; (b) the corresponding property must not be auto-adjustable if the details need to remain hidden.- Returns:
- a list of
Propertydata. - See Also:
areDetailsHidden(),isListedNumericType(pulse.properties.NumericProperty)
-
updateProperty
public boolean updateProperty(Object sourceComponent, Property updatedProperty)
Attempts to update an
updatedPropertysimilar to one found in thisPropertyHolder. The call originator is declared to be thesourceComponent. If the originator is not the parent of thisUpwardsNavigable, this object will tell their parent about this behaviour. The update is done by calling the superclass methodupdate(Property-- if and only if a property similar toupdatedPropertyexists and its value is not equal to theupdatedProperty. When the update happens, this will pass the correspondingPropertyEventto the available listeners.- Parameters:
sourceComponent- the originator of the change.updatedProperty- the updated property that will be assigned to thisPropertyHolder.
-
updateProperties
public void updateProperties(Object sourceComponent, PropertyHolder propertyHolder)
This method will update thisPropertyHolderwith all properties that are contained in a differentpropertyHolder, if they also are present in the former.- Parameters:
sourceComponent- the source of the changepropertyHolder- anotherPropertyHolder- See Also:
updateProperty(java.lang.Object,pulse.properties.Property)
-
removeListeners
public void removeListeners()
-
addListener
public void addListener(PropertyHolderListener l)
-
getListeners
public List<PropertyHolderListener> getListeners()
-
areDetailsHidden
public boolean areDetailsHidden()
By default, this is set tofalse. If the overriding subclass sets this totrue, only thoseNumericProperties that have theautoAdjustableflag setfalsewill be shown.- Returns:
trueif the auto-adjustable numeric properties need to stay hidden,falseotherwise.
-
parameterListChanged
public void parameterListChanged()
-
ignoreSiblings
public boolean ignoreSiblings()
ShouldAccessibles that belong to thisPropertyHolderbe ignored when thisPropertyHolderis displayed in a table?- Returns:
falseby default- See Also:
PropertyHolderTable
-
describe
public String describe()
Description copied from class:UpwardsNavigableUses the SearchTask id (if present) to describe this UpwardsNavigable.- Specified by:
describein interfaceDescriptive- Overrides:
describein classUpwardsNavigable- Returns:
- by default, this will return the name of the implementing class and the date of the calculation.
-
getPrefix
public String getPrefix()
-
getDescriptor
public String getDescriptor()
If not null, will return the prefix, otherwise calls the superclass method.- Overrides:
getDescriptorin classGroup- Returns:
- the descriptor
- See Also:
Group.getSimpleName()
-
setPrefix
public void setPrefix(String prefix)
-
-