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 aVariableMetadata
object holding metadata about a plottable variable.VariableMetadata(Parameter parameter, HorizontalDomain hDomain, VerticalDomain zDomain, TemporalDomain tDomain, boolean scalar)
Constructs aVariableMetadata
object holding metadata about a variable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<VariableMetadata>
getChildren()
VariableMetadata
getChildWithRole(String role)
Returns all childVariableMetadata
with the designated roleDataset
getDataset()
The dataset to which this variable belongsHorizontalDomain
getHorizontalDomain()
Returns the horizontal domain of the variable.String
getId()
Parameter
getParameter()
Describes what is being measured by the values of this variable.VariableMetadata
getParent()
TemporalDomain
getTemporalDomain()
Returns the temporal domain of the variableMap<String,Object>
getVariableProperties()
VerticalDomain
getVerticalDomain()
Returns the vertical domain of the variableboolean
isScalar()
void
setDataset(Dataset dataset)
Recursively set the dataset for thisVariableMetadata
void
setParent(VariableMetadata parent, String relationshipToParent)
Sets the parent-child relationship of thisVariableMetadata
and another one.
-
-
-
Constructor Detail
-
VariableMetadata
public VariableMetadata(Parameter parameter, HorizontalDomain hDomain, VerticalDomain zDomain, TemporalDomain tDomain)
Constructs aVariableMetadata
object holding metadata about a plottable variable.Note that the this
VariableMetadata
object will not have aDataset
associated with it, since these objects are usually created before being attached to aDataset
. It is expected that whenDataset
is created it will set itself using thesetDataset(Dataset)
method- Parameters:
parameter
- TheParameter
which the variable is measuring - the ID is used as the variable ID and must be unique amongst its siblingshDomain
- TheHorizontalDomain
on which the variable is measuredzDomain
- TheVerticalDomain
on which the variable is measuredtDomain
- TheTemporalDomain
on which the variable is measured
-
VariableMetadata
public VariableMetadata(Parameter parameter, HorizontalDomain hDomain, VerticalDomain zDomain, TemporalDomain tDomain, boolean scalar)
Constructs aVariableMetadata
object holding metadata about a variable.Note that the this
VariableMetadata
object will not have aDataset
associated with it, since these objects are usually created before being attached to aDataset
. It is expected that whenDataset
is created it will set itself using thesetDataset(Dataset)
method- Parameters:
parameter
- TheParameter
which the variable is measuring - the ID is used as the variable ID and must be unique amongst its siblingshDomain
- TheHorizontalDomain
on which the variable is measuredzDomain
- TheVerticalDomain
on which the variable is measuredtDomain
- TheTemporalDomain
on which the variable is measuredscalar
- Whether or not thisVariableMetadata
can 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 aSet
containing the children of thisVariableMetadata
, or an emptySet
if there are none. This method may not returnnull
-
setParent
public void setParent(VariableMetadata parent, String relationshipToParent)
Sets the parent-child relationship of thisVariableMetadata
and another one.- Parameters:
parent
- The parentVariableMetadata
objectrelationshipToParent
- AString
representing the relationship thisVariableMetadata
has with its parent. This is an arbitrary value which can be used to accessgetChildWithRole(String)
-
getChildWithRole
public VariableMetadata getChildWithRole(String role)
Returns all childVariableMetadata
with the designated role- Parameters:
role
- The role to search for- Returns:
- The child
VariableMetadata
which has this role, ornull
if there are none
-
isScalar
public boolean isScalar()
- Returns:
- Whether this
VariableMetadata
represents a scalar quantity.VariableMetadata
which doesn't is generally used for grouping otherVariableMetadata
.
-
-