Package dap4.core.dmr
Class DapDataset
- java.lang.Object
-
- dap4.core.dmr.DapNode
-
- dap4.core.dmr.DapGroup
-
- dap4.core.dmr.DapDataset
-
-
Field Summary
Fields Modifier and Type Field Description protected List<DapStructure>
allcompounds
protected List<DapDimension>
alldimensions
protected List<DapEnumeration>
allenums
protected List<DapGroup>
allgroups
protected List<DapVariable>
allvariables
protected List<DapDimension>
anonymousdims
protected String
base
protected CEConstraint
ce
protected Map<DapVariable,Long>
checksummap
protected String
dapversion
protected String
dmrversion
protected boolean
finished
protected Map<String,DapNode>
fqnmap
protected List<DapNode>
nodelist
protected String
ns
protected List<DapVariable>
topvariables
protected List<DapNode>
visiblenodes
-
Fields inherited from class dap4.core.dmr.DapGroup
compounds, decls, dimensions, enums, groups, variables
-
Fields inherited from class dap4.core.dmr.DapNode
annotations, attributes, dataset, escapedname, fqn, index, parent, shortname, sort, xmlattributes
-
-
Constructor Summary
Constructors Constructor Description DapDataset()
DapDataset(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNode(DapNode newnode)
DapDimension
createAnonymous(long size)
void
finish()
protected void
finishR(DapNode node)
Recursive helperString
getBase()
CEConstraint
getConstraint()
String
getDapVersion()
String
getDMRVersion()
Map<String,DapNode>
getFQNMap()
DapIterator
getIterator(EnumSet<DapSort> sortset)
List<DapNode>
getNodeList()
String
getNS()
List<DapVariable>
getTopVariables()
DapNode
lookup(String fqn, DapSort... sortset)
Parse an FQN and use it to trace to a specific object in a dataset.void
setBase(String value)
void
setConstraint(CEConstraint ce)
void
setDapVersion(String value)
void
setDMRVersion(String value)
void
setFQNMap(Map<String,DapNode> fqnmap)
void
setNS(String value)
void
sort()
Sort the nodelist into prefix left to right ordervoid
sortR(DapNode node, List<DapNode> sortlist)
Sort helper-
Methods inherited from class dap4.core.dmr.DapGroup
addDecl, containsDecl, findByFQN, findByName, findInGroup, findVariable, getCompounds, getDecls, getDimensions, getEnums, getGroups, getVariables, setDecls
-
Methods inherited from class dap4.core.dmr.DapNode
addAttribute, addXMLAttribute, annotate, annotation, computefqn, findAttribute, getAttributes, getContainer, getContainerPath, getDataset, getEscapedShortName, getFQN, getGroup, getGroupPath, getIndex, getParent, getPath, getShortName, getSort, getXMLAttributes, isTopLevel, overrideParent, removeAttribute, removeXMLAttribute, setAttribute, setAttributes, setDataset, setIndex, setParent, setShortName, setSort, toString
-
-
-
-
Field Detail
-
ce
protected CEConstraint ce
-
anonymousdims
protected List<DapDimension> anonymousdims
-
dapversion
protected String dapversion
-
dmrversion
protected String dmrversion
-
base
protected String base
-
ns
protected String ns
-
topvariables
protected List<DapVariable> topvariables
-
allvariables
protected List<DapVariable> allvariables
-
allenums
protected List<DapEnumeration> allenums
-
allcompounds
protected List<DapStructure> allcompounds
-
alldimensions
protected List<DapDimension> alldimensions
-
finished
protected boolean finished
-
checksummap
protected Map<DapVariable,Long> checksummap
-
-
Constructor Detail
-
DapDataset
public DapDataset()
-
DapDataset
public DapDataset(String name)
-
-
Method Detail
-
finish
public void finish()
-
finishR
protected void finishR(DapNode node)
Recursive helper- Parameters:
node
- to walk
-
getConstraint
public CEConstraint getConstraint()
-
setConstraint
public void setConstraint(CEConstraint ce)
-
getDapVersion
public String getDapVersion()
-
setDapVersion
public void setDapVersion(String value)
-
getDMRVersion
public String getDMRVersion()
-
setDMRVersion
public void setDMRVersion(String value)
-
getNS
public String getNS()
-
setNS
public void setNS(String value)
-
getBase
public String getBase()
-
setBase
public void setBase(String value)
-
getTopVariables
public List<DapVariable> getTopVariables()
-
addNode
public void addNode(DapNode newnode)
-
createAnonymous
public DapDimension createAnonymous(long size) throws DapException
- Throws:
DapException
-
getIterator
public DapIterator getIterator(EnumSet<DapSort> sortset)
-
lookup
public DapNode lookup(String fqn, DapSort... sortset) throws DapException
Parse an FQN and use it to trace to a specific object in a dataset. Note that this is quite tricky in the face of backslash escapes. Because of backslash escapes, we cannot use the String.split function because it does appear to be possible to write a regexp that handles preceding backslashes correctly. Instead, we must parse character by character left to right. Traversal into structs: In theory, a map variable could point to a field of a structure. However, in practice, this will not work because we would need a specific instance of that field, which means including dimension indices must be included starting from some top-level variable. We choose, for now, to make that illegal until such time as there is a well-defined meaning for this. Note: this assumes the fqn is absolute (i.e. starts with '/').- Parameters:
fqn
- the fully qualified namesortset
- the kind(s) of object we are looking for- Returns:
- the matching Dap Node or null if not found
- Throws:
DapException
-
sort
public void sort()
Sort the nodelist into prefix left to right order
-
-