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>allcompoundsprotected List<DapDimension>alldimensionsprotected List<DapEnumeration>allenumsprotected List<DapGroup>allgroupsprotected List<DapVariable>allvariablesprotected List<DapDimension>anonymousdimsprotected Stringbaseprotected CEConstraintceprotected Map<DapVariable,Long>checksummapprotected Stringdapversionprotected Stringdmrversionprotected booleanfinishedprotected Map<String,DapNode>fqnmapprotected List<DapNode>nodelistprotected Stringnsprotected List<DapVariable>topvariablesprotected 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 voidaddNode(DapNode newnode)DapDimensioncreateAnonymous(long size)voidfinish()protected voidfinishR(DapNode node)Recursive helperStringgetBase()CEConstraintgetConstraint()StringgetDapVersion()StringgetDMRVersion()Map<String,DapNode>getFQNMap()DapIteratorgetIterator(EnumSet<DapSort> sortset)List<DapNode>getNodeList()StringgetNS()List<DapVariable>getTopVariables()DapNodelookup(String fqn, DapSort... sortset)Parse an FQN and use it to trace to a specific object in a dataset.voidsetBase(String value)voidsetConstraint(CEConstraint ce)voidsetDapVersion(String value)voidsetDMRVersion(String value)voidsetFQNMap(Map<String,DapNode> fqnmap)voidsetNS(String value)voidsort()Sort the nodelist into prefix left to right ordervoidsortR(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
-
-