use of org.orcid.jaxb.model.record_rc3.Group in project bioformats by openmicroscopy.
the class NetCDFServiceImpl method getVariableAttributes.
/* (non-Javadoc)
* @see loci.formats.NetCDFService#getVariableAttributes(java.lang.String)
*/
@Override
public Hashtable<String, Object> getVariableAttributes(String name) {
String groupName = getDirectory(name);
String variableName = getName(name);
Group group = getGroup(groupName);
Variable variable = group.findVariable(variableName);
Hashtable<String, Object> toReturn = new Hashtable<String, Object>();
if (variable != null) {
List<Attribute> attributes = variable.getAttributes();
for (Attribute attribute : attributes) {
toReturn.put(attribute.getName(), arrayToString(attribute.getValues()));
}
}
return toReturn;
}
use of org.orcid.jaxb.model.record_rc3.Group in project bioformats by openmicroscopy.
the class NetCDFServiceImpl method getAttributeValue.
/* (non-Javadoc)
* @see loci.formats.NetCDFService#getAttributeValue(java.lang.String)
*/
@Override
public String getAttributeValue(String path) {
String groupName = getDirectory(path);
String attributeName = getName(path);
Group group = getGroup(groupName);
Attribute attribute = group.findAttribute(attributeName);
if (attribute == null)
return null;
return arrayToString(attribute.getValues());
}
use of org.orcid.jaxb.model.record_rc3.Group in project bioformats by openmicroscopy.
the class NetCDFServiceImpl method getGroup.
/**
* Retrieves a group based on its fully qualified path.
* @param path Fully qualified path to the group.
* @return Group or <code>root</code> if the group cannot be found.
*/
private Group getGroup(String path) {
if (path.indexOf('/') == -1) {
return root;
}
StringTokenizer tokens = new StringTokenizer(path, "/");
Group parent = root;
while (tokens.hasMoreTokens()) {
String token = tokens.nextToken();
Group nextParent = parent.findGroup(token);
if (nextParent == null) {
break;
}
parent = nextParent;
}
return parent == null ? root : parent;
}
Aggregations