Package pulse.input
Class Metadata
- java.lang.Object
-
- pulse.util.UpwardsNavigable
-
- pulse.util.Group
-
- pulse.util.Accessible
-
- pulse.util.PropertyHolder
-
- pulse.input.Metadata
-
- All Implemented Interfaces:
Serializable,Descriptive,Reflexive
public class Metadata extends PropertyHolder implements Reflexive
Metadatais the information relating to a specific experiment, which can be used by aSearchTaskto process an instance ofExperimentalData. It is used to populate the associatedProblem,DifferenceScheme, andRangeof theExperimentalData.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Metadata(NumericProperty temperature, int externalId)Creates aMetadatawith the specified parameters and a default rectangular pulse shape.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Property>data()Creates a list of data that contain allNumericPropertyobjects belonging to thisMetadataand anInstanceDescriptorrelating to the pulse shape.booleanequals(Object o)intgetExternalID()Gets the external ID usually specified in the experimental files.NumericPulseDatagetPulseData()If a Numerical Pulse has been loaded (for example, when importing from Proteus), this will return an object describing this data.InstanceDescriptor<? extends PulseTemporalShape>getPulseDescriptor()Retrieves the pulse shape recorded in thisMetadataSampleNamegetSampleName()Retrieves the sample name.Identifieridentify()Retrieves the Identifier of the SearchTaks this UpwardsNavigable belongs to.Set<NumericPropertyKeyword>listedKeywords()By default, this will search the children of thisPropertyHolderto collect the types of their listed numeric parameters recursively.List<Property>listedTypes()The listed types includeTEST_TEMPERATURE,THICKNESS,DIAMETER,PULSE_WIDTH,SPOT_DIAMETER,LASER_ENERGY,DETECTOR_GAIN,DETECTOR_IRIS, sample name and the types listed by the pulse descriptor.NumericPropertynumericProperty(NumericPropertyKeyword key)Searches the internal list of this class for a property with thekeytype.voidset(NumericPropertyKeyword type, NumericProperty property)Iftypeis listed by thisMetadata, will attempt to either set a value to the property belonging to thisMetadataand identified bytypeor addpropertyto the internal repository of thisMetadata.voidsetPulseData(NumericPulseData pulseData)voidsetSampleName(SampleName sampleName)Sets the sample name property.StringtoString()-
Methods inherited from class pulse.util.PropertyHolder
addListener, areDetailsHidden, describe, firePropertyChanged, getDescriptor, getListeners, getPrefix, ignoreSiblings, initListeners, isListedNumericType, isListedParameter, numericData, parameterListChanged, removeListeners, setPrefix, updateProperties, updateProperty
-
Methods inherited from class pulse.util.Accessible
accessibleChildren, genericProperties, genericProperty, numericProperties, property, update, update
-
Methods inherited from class pulse.util.UpwardsNavigable
addHierarchyListener, getHierarchyListeners, getParent, removeHierarchyListener, removeHierarchyListeners, setParent, specificAncestor, tellParent
-
-
-
-
Constructor Detail
-
Metadata
public Metadata(NumericProperty temperature, int externalId)
Creates aMetadatawith the specified parameters and a default rectangular pulse shape. Properties are stored in aTreeSet.- Parameters:
temperature- the NumericProperty of the typeNumericPropertyKeyword.TEST_TEMPERATUREexternalId- an integer, specifying the external ID recorded by the experimental setup.
-
-
Method Detail
-
getExternalID
public int getExternalID()
Gets the external ID usually specified in the experimental files. Note this is not aNumericProperty- Returns:
- an integer, representing the external ID
-
getPulseDescriptor
public InstanceDescriptor<? extends PulseTemporalShape> getPulseDescriptor()
Retrieves the pulse shape recorded in thisMetadata- Returns:
- a
PulseShapeobject
-
getSampleName
public SampleName getSampleName()
Retrieves the sample name. This name is used to create directories when exporting the data and also to fill the legend when plotting.- Returns:
- the sample name
-
setSampleName
public void setSampleName(SampleName sampleName)
Sets the sample name property.- Parameters:
sampleName- the sample name
-
setPulseData
public final void setPulseData(NumericPulseData pulseData)
-
getPulseData
public final NumericPulseData getPulseData()
If a Numerical Pulse has been loaded (for example, when importing from Proteus), this will return an object describing this data.- Returns:
-
numericProperty
public NumericProperty numericProperty(NumericPropertyKeyword key)
Searches the internal list of this class for a property with thekeytype.- Overrides:
numericPropertyin classAccessible- Parameters:
key- the type of theNumericProperty.- Returns:
- if present, returns a property belonging to this
Metadatawith the specified type, otherwise return null. - See Also:
Accessible.numericProperties()
-
set
public void set(NumericPropertyKeyword type, NumericProperty property)
Iftypeis listed by thisMetadata, will attempt to either set a value to the property belonging to thisMetadataand identified bytypeor addpropertyto the internal repository of thisMetadata. TriggersfirePropertyChangedupon successful completion.- Specified by:
setin classAccessible- Parameters:
type- the type to be searched forproperty- a property with the type specified by its first argument. The value of this property will be used to update its counterpart in thisMetadata. The signature of this method is dictated by the use of Reflection API.- Throws:
IllegalArgumentException- if the types of the arguments do not match or if property is not a listed parameter
-
listedTypes
public List<Property> listedTypes()
The listed types includeTEST_TEMPERATURE,THICKNESS,DIAMETER,PULSE_WIDTH,SPOT_DIAMETER,LASER_ENERGY,DETECTOR_GAIN,DETECTOR_IRIS, sample name and the types listed by the pulse descriptor.- Overrides:
listedTypesin classPropertyHolder- Returns:
- a list of
Propertyinstances, which have been explicitly marked as a listed parameter for thisPropertyHolder.
-
listedKeywords
public Set<NumericPropertyKeyword> listedKeywords()
Description copied from class:PropertyHolderBy default, this will search the children of this
PropertyHolderto collect the types of their listed numeric parameters recursively.- Overrides:
listedKeywordsin classPropertyHolder- Returns:
- a set of
NumericPropertyKeywordinstances, which have been explicitly marked as a listed parameter for thisPropertyHolder.
-
data
public List<Property> data()
Creates a list of data that contain allNumericPropertyobjects belonging to thisMetadataand anInstanceDescriptorrelating to the pulse shape.- Overrides:
datain classPropertyHolder- Returns:
- a list of data, which combines generic and numeric properties.
-
identify
public Identifier identify()
Description copied from class:UpwardsNavigableRetrieves the Identifier of the SearchTaks this UpwardsNavigable belongs to.- Overrides:
identifyin classUpwardsNavigable- Returns:
- If this
Metadatais NOT assigned to aSearchTask, returns a newIdentifierbased on theexternalID. Otherwise, callssuper.identify().
-
-