Package uk.ac.rdg.resc.edal.metadata
Class VariableMetadata
- java.lang.Object
-
- uk.ac.rdg.resc.edal.metadata.VariableMetadata
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DiscreteLayeredVariableMetadata
public class VariableMetadata extends Object implements Serializable
Describes a variable held within aDataset. Variables can be hierarchically nested.- Author:
- Guy Griffiths, Jon Blower
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description VariableMetadata(Parameter parameter, HorizontalDomain hDomain, VerticalDomain zDomain, TemporalDomain tDomain)Constructs aVariableMetadataobject holding metadata about a plottable variable.VariableMetadata(Parameter parameter, HorizontalDomain hDomain, VerticalDomain zDomain, TemporalDomain tDomain, boolean scalar)Constructs aVariableMetadataobject holding metadata about a variable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<VariableMetadata>getChildren()VariableMetadatagetChildWithRole(String role)Returns all childVariableMetadatawith the designated roleDatasetgetDataset()The dataset to which this variable belongsHorizontalDomaingetHorizontalDomain()Returns the horizontal domain of the variable.StringgetId()ParametergetParameter()Describes what is being measured by the values of this variable.VariableMetadatagetParent()TemporalDomaingetTemporalDomain()Returns the temporal domain of the variableMap<String,Object>getVariableProperties()VerticalDomaingetVerticalDomain()Returns the vertical domain of the variablebooleanisScalar()voidsetDataset(Dataset dataset)Recursively set the dataset for thisVariableMetadatavoidsetParent(VariableMetadata parent, String relationshipToParent)Sets the parent-child relationship of thisVariableMetadataand another one.
-
-
-
Constructor Detail
-
VariableMetadata
public VariableMetadata(Parameter parameter, HorizontalDomain hDomain, VerticalDomain zDomain, TemporalDomain tDomain)
Constructs aVariableMetadataobject holding metadata about a plottable variable.Note that the this
VariableMetadataobject will not have aDatasetassociated with it, since these objects are usually created before being attached to aDataset. It is expected that whenDatasetis created it will set itself using thesetDataset(Dataset)method- Parameters:
parameter- TheParameterwhich the variable is measuring - the ID is used as the variable ID and must be unique amongst its siblingshDomain- TheHorizontalDomainon which the variable is measuredzDomain- TheVerticalDomainon which the variable is measuredtDomain- TheTemporalDomainon which the variable is measured
-
VariableMetadata
public VariableMetadata(Parameter parameter, HorizontalDomain hDomain, VerticalDomain zDomain, TemporalDomain tDomain, boolean scalar)
Constructs aVariableMetadataobject holding metadata about a variable.Note that the this
VariableMetadataobject will not have aDatasetassociated with it, since these objects are usually created before being attached to aDataset. It is expected that whenDatasetis created it will set itself using thesetDataset(Dataset)method- Parameters:
parameter- TheParameterwhich the variable is measuring - the ID is used as the variable ID and must be unique amongst its siblingshDomain- TheHorizontalDomainon which the variable is measuredzDomain- TheVerticalDomainon which the variable is measuredtDomain- TheTemporalDomainon which the variable is measuredscalar- Whether or not thisVariableMetadatacan be read as a scalar quantity
-
-
Method Detail
-
setDataset
public void setDataset(Dataset dataset)
Recursively set the dataset for thisVariableMetadata- Parameters:
dataset-
-
getId
public String getId()
- Returns:
- The identifier of the variable.
-
getDataset
public Dataset getDataset()
The dataset to which this variable belongs
-
getParameter
public Parameter getParameter()
Describes what is being measured by the values of this variable.
-
getHorizontalDomain
public HorizontalDomain getHorizontalDomain()
Returns the horizontal domain of the variable.
-
getVerticalDomain
public VerticalDomain getVerticalDomain()
Returns the vertical domain of the variable
-
getTemporalDomain
public TemporalDomain getTemporalDomain()
Returns the temporal domain of the variable
-
getParent
public VariableMetadata getParent()
-
getChildren
public Set<VariableMetadata> getChildren()
Returns aSetcontaining the children of thisVariableMetadata, or an emptySetif there are none. This method may not returnnull
-
setParent
public void setParent(VariableMetadata parent, String relationshipToParent)
Sets the parent-child relationship of thisVariableMetadataand another one.- Parameters:
parent- The parentVariableMetadataobjectrelationshipToParent- AStringrepresenting the relationship thisVariableMetadatahas with its parent. This is an arbitrary value which can be used to accessgetChildWithRole(String)
-
getChildWithRole
public VariableMetadata getChildWithRole(String role)
Returns all childVariableMetadatawith the designated role- Parameters:
role- The role to search for- Returns:
- The child
VariableMetadatawhich has this role, ornullif there are none
-
isScalar
public boolean isScalar()
- Returns:
- Whether this
VariableMetadatarepresents a scalar quantity.VariableMetadatawhich doesn't is generally used for grouping otherVariableMetadata.
-
-