Search in sources :

Example 41 with Group

use of org.orcid.jaxb.model.record_rc4.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;
}
Also used : Group(ucar.nc2.Group) Variable(ucar.nc2.Variable) Attribute(ucar.nc2.Attribute) Hashtable(java.util.Hashtable)

Example 42 with Group

use of org.orcid.jaxb.model.record_rc4.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());
}
Also used : Group(ucar.nc2.Group) Attribute(ucar.nc2.Attribute)

Example 43 with Group

use of org.orcid.jaxb.model.record_rc4.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;
}
Also used : Group(ucar.nc2.Group) StringTokenizer(java.util.StringTokenizer)

Example 44 with Group

use of org.orcid.jaxb.model.record_rc4.Group in project sis by apache.

the class DecoderWrapper method addAttributesTo.

/**
 * Adds all attributes of the given group, then create nodes for sub-groups (if any).
 * This method invokes itself recursively.
 *
 * @param  branch  where to add new nodes for the children of given group.
 * @param  group   group for which to add sub-group, variables and attributes.
 */
private void addAttributesTo(final TreeTable.Node branch, final Group group) {
    for (final Group sub : group.getGroups()) {
        final TreeTable.Node node = branch.newChild();
        node.setValue(TableColumn.NAME, sub.getShortName());
        addAttributesTo(node, sub);
    }
    for (final ucar.nc2.Variable variable : group.getVariables()) {
        final TreeTable.Node node = branch.newChild();
        node.setValue(TableColumn.NAME, variable.getShortName());
        addAttributesTo(node, variable.attributes());
    }
    addAttributesTo(branch, group.attributes());
}
Also used : Group(ucar.nc2.Group) TreeTable(org.apache.sis.util.collection.TreeTable)

Example 45 with Group

use of org.orcid.jaxb.model.record_rc4.Group in project sis by apache.

the class DecoderWrapper method setSearchPath.

/**
 * Defines the groups where to search for named attributes, in preference order.
 * The {@code null} group name stands for the global attributes.
 */
@Override
public void setSearchPath(final String... groupNames) {
    final Group[] groups = new Group[groupNames.length];
    int count = 0;
    for (final String name : groupNames) {
        if (name != null) {
            final Group group = file.findGroup(name);
            if (group == null) {
                // Group not found - do not increment the counter.
                continue;
            }
            groups[count] = group;
        }
        count++;
    }
    this.groups = ArraysExt.resize(groups, count);
}
Also used : Group(ucar.nc2.Group) FeatureDatasetPoint(ucar.nc2.ft.FeatureDatasetPoint)

Aggregations

ArrayList (java.util.ArrayList)10 Group (ucar.nc2.Group)10 Test (org.junit.Test)9 Group (org.gluu.oxtrust.model.scim2.Group)8 Group (org.openstack4j.model.identity.v3.Group)8 GluuGroup (org.gluu.oxtrust.model.GluuGroup)7 DuplicateEntryException (org.gluu.site.ldap.exception.DuplicateEntryException)7 Group (com.google.monitoring.v3.Group)5 EntryPersistenceException (org.gluu.site.ldap.persistence.exception.EntryPersistenceException)5 GroupName (com.google.monitoring.v3.GroupName)3 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)3 ClientResponse (com.sun.jersey.api.client.ClientResponse)3 ApiOperation (com.wordnik.swagger.annotations.ApiOperation)3 URI (java.net.URI)3 Date (java.util.Date)3 DefaultValue (javax.ws.rs.DefaultValue)3 HeaderParam (javax.ws.rs.HeaderParam)3 Produces (javax.ws.rs.Produces)3 Response (javax.ws.rs.core.Response)3 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)3