Codota Logo
Group.getAttributes
Code IndexAdd Codota to your IDE (free)

How to use
getAttributes
method
in
ucar.nc2.Group

Best Java code snippets using ucar.nc2.Group.getAttributes (Showing top 20 results out of 315)

  • Common ways to obtain Group
private void myMethod () {
Group g =
  • Codota IconNetcdfFile ncfile;ncfile.getRootGroup()
  • Codota IconNetcdfFile ncfile;String str;ncfile.findGroup(str)
  • Codota IconVariable v;v.getParentGroup()
  • Smart code suggestions by Codota
}
origin: apache/tika

protected void unravelStringMet(NetcdfFile ncFile, Group group, Metadata met) {
  if (group == null) {
    group = ncFile.getRootGroup();
  }
  // get file type
  met.set("File-Type-Description", ncFile.getFileTypeDescription());
  // unravel its string attrs
  for (Attribute attribute : group.getAttributes()) {
    if (attribute.isString()) {
      met.add(attribute.getFullName(), attribute.getStringValue());
    } else {
      // try and cast its value to a string
      met.add(attribute.getFullName(), String.valueOf(attribute
          .getNumericValue()));
    }
  }
  for (Group g : group.getGroups()) {
    unravelStringMet(ncFile, g, met);
  }
}
origin: edu.ucar/netcdf

public List getAttributes() {
  return ncd.getRootGroup().getAttributes();
}
origin: Unidata/thredds

public List getAttributes() {
 return ncd.getRootGroup().getAttributes();
}
origin: senbox-org/s1tbx

public static NcAttributeMap create(Group group) {
  return new NcAttributeMap(group.getAttributes());
}
origin: edu.ucar/cdm

public List getAttributes() {
  return ncd.getRootGroup().getAttributes();
}
origin: senbox-org/s1tbx

private static void addAttributes(final MetadataElement parentElem, final Group parentGroup) {
  final List<Attribute> attribList = parentGroup.getAttributes();
  for (Attribute at : attribList) {
    createMetadataAttributes(parentElem, at, at.getName());
  }
}
origin: edu.ucar/netcdf

void dumpClasses(Group g, PrintStream out) {
 out.println("Dimensions:");
 for (Dimension ds : g.getDimensions()) {
  out.println("  " + ds.getShortName() + " " + ds.getClass().getName());
 }
 out.println("Atributes:");
 for (Attribute a : g.getAttributes()) {
  out.println("  " + a.getShortName() + " " + a.getClass().getName());
 }
 out.println("Variables:");
 dumpVariables(g.getVariables(), out);
 out.println("Groups:");
 for (Group nested : g.getGroups()) {
  out.println("  " + nested.getFullName() + " " + nested.getClass().getName());
  dumpClasses(nested, out);
 }
}
origin: Unidata/thredds

void dumpClasses(Group g, PrintWriter out) {
 out.println("Dimensions:");
 for (Dimension ds : g.getDimensions()) {
  out.println("  " + ds.getShortName() + " " + ds.getClass().getName());
 }
 out.println("Atributes:");
 for (Attribute a : g.getAttributes()) {
  out.println("  " + a.getShortName() + " " + a.getClass().getName());
 }
 out.println("Variables:");
 dumpVariables(g.getVariables(), out);
 out.println("Groups:");
 for (Group nested : g.getGroups()) {
  out.println("  " + nested.getFullName() + " " + nested.getClass().getName());
  dumpClasses(nested, out);
 }
}
origin: edu.ucar/cdm

void dumpClasses(Group g, PrintWriter out) {
 out.println("Dimensions:");
 for (Dimension ds : g.getDimensions()) {
  out.println("  " + ds.getShortName() + " " + ds.getClass().getName());
 }
 out.println("Atributes:");
 for (Attribute a : g.getAttributes()) {
  out.println("  " + a.getShortName() + " " + a.getClass().getName());
 }
 out.println("Variables:");
 dumpVariables(g.getVariables(), out);
 out.println("Groups:");
 for (Group nested : g.getGroups()) {
  out.println("  " + nested.getFullName() + " " + nested.getClass().getName());
  dumpClasses(nested, out);
 }
}
origin: Unidata/thredds

/**
 * Copy attributes from src to target, skip ones that already exist (by name)
 * @param src copy from here
 * @param target copy to here
 */
static public void transferGroupAttributes(Group src, Group target) {
 for (Attribute a : src.getAttributes()) {
  if (null == target.findAttribute(a.getShortName()))
   target.addAttribute(a);
 }
}
origin: edu.ucar/netcdf

/**
 * Copy attributes from src to target, skip ones that already exist (by name)
 * @param src copy from here
 * @param target copy to here
 */
static public void transferGroupAttributes(Group src, Group target) {
 for (Attribute a : src.getAttributes()) {
  if (null == target.findAttribute(a.getShortName()))
   target.addAttribute(a);
 }
}
origin: edu.ucar/cdm

/**
 * Copy attributes from src to target, skip ones that already exist (by name)
 * @param src copy from here
 * @param target copy to here
 */
static public void transferGroupAttributes(Group src, Group target) {
 for (Attribute a : src.getAttributes()) {
  if (null == target.findAttribute(a.getShortName()))
   target.addAttribute(a);
 }
}
origin: Unidata/thredds

 private void count(Group g) {
  ndims += g.getDimensions().size();
  nvars += g.getVariables().size();
  ngatts += g.getAttributes().size();
  ngroups += g.getGroups().size();
  for (Variable v : g.getVariables()) {
   natts += v.getAttributes().size();
   if (v instanceof Structure) {
    nstructFields += ((Structure) v).getVariables().size();
   }
  }
  for (Group ng : g.getGroups())
   count(ng);
 }
}
origin: Unidata/thredds

 private void count(Group g) {
  ndims += g.getDimensions().size();
  nvars += g.getVariables().size();
  ngatts += g.getAttributes().size();
  ngroups += g.getGroups().size();
  for (Variable v : g.getVariables()) {
   natts += v.getAttributes().size();
   if (v instanceof Structure) {
    nstructFields += ((Structure) v).getVariables().size();
   }
  }
  for (Group ng : g.getGroups())
   count(ng);
 }
}
origin: Unidata/thredds

@Test
public void testReadAll() throws IOException
{
  NetcdfFile ncfile = TestDir.openFileLocal("testSpecialAttributes.nc4");
  // Iterate over all top-level attributes and see if it is special
  for(Attribute a : ncfile.getRootGroup().getAttributes()) {
    Assert.assertTrue("Attribute iteration found special attribute: " + a.getShortName(),
        !Attribute.isspecial(a));
  }
  ncfile.close();
}
origin: edu.ucar/cdm

private void convertGroup(Group g, Group from) {
 for (EnumTypedef et : from.getEnumTypedefs())
  g.addEnumeration(et);
 for (Dimension d : from.getDimensions())
  g.addDimension(new Dimension(d.getShortName(), d));
 for (Attribute a : from.getAttributes())
  g.addAttribute(a);
 for (Variable v : from.getVariables())
  g.addVariable(convertVariable(g, v));
 for (Group nested : from.getGroups()) {
  Group nnested = new Group(this, g, nested.getShortName());
  g.addGroup(nnested);
  convertGroup(nnested, nested);
 }
}
origin: edu.ucar/netcdf

private void convertGroup(Group g, Group from) {
 for (EnumTypedef et : from.getEnumTypedefs())
  g.addEnumeration(et);
 for (Dimension d : from.getDimensions())
  g.addDimension(new Dimension(d.getShortName(), d));
 for (Attribute a : from.getAttributes())
  g.addAttribute(a);
 for (Variable v : from.getVariables())
  g.addVariable(convertVariable(g, v));
 for (Group nested : from.getGroups()) {
  Group nnested = new Group(this, g, nested.getShortName());
  g.addGroup(nnested);
  convertGroup(nnested, nested);
 }
}
origin: Unidata/thredds

private void convertGroup(Group g, Group from) {
 for (EnumTypedef et : from.getEnumTypedefs())
  g.addEnumeration(et);
 for (Dimension d : from.getDimensions())
  g.addDimension(new Dimension(d.getShortName(), d));
 for (Attribute a : from.getAttributes())
  g.addAttribute(a);
 for (Variable v : from.getVariables())
  g.addVariable(convertVariable(g, v));
 for (Group nested : from.getGroups()) {
  Group nnested = new Group(this, g, nested.getShortName());
  g.addGroup(nnested);
  convertGroup(nnested, nested);
 }
}
origin: Unidata/thredds

static NcStreamProto.Group.Builder encodeGroup(Group g, int sizeToCache) throws IOException {
 NcStreamProto.Group.Builder groupBuilder = NcStreamProto.Group.newBuilder();
 groupBuilder.setName(g.getShortName());
 for (Dimension dim : g.getDimensions())
  groupBuilder.addDims(NcStream.encodeDim(dim));
 for (Attribute att : g.getAttributes())
  groupBuilder.addAtts(NcStream.encodeAtt(att));
 for (EnumTypedef enumType : g.getEnumTypedefs())
  groupBuilder.addEnumTypes(NcStream.encodeEnumTypedef(enumType));
 for (Variable var : g.getVariables()) {
  if (var instanceof Structure)
   groupBuilder.addStructs(NcStream.encodeStructure((Structure) var));
  else
   groupBuilder.addVars(NcStream.encodeVar(var, sizeToCache));
 }
 for (Group ng : g.getGroups())
  groupBuilder.addGroups(encodeGroup(ng, sizeToCache));
 return groupBuilder;
}
origin: edu.ucar/netcdf

static NcStreamProto.Group.Builder encodeGroup(Group g, int sizeToCache) throws IOException {
 NcStreamProto.Group.Builder groupBuilder = NcStreamProto.Group.newBuilder();
 groupBuilder.setName(g.getShortName());
 for (Dimension dim : g.getDimensions())
  groupBuilder.addDims(NcStream.encodeDim(dim));
 for (Attribute att : g.getAttributes())
  groupBuilder.addAtts(NcStream.encodeAtt(att));
 for (EnumTypedef enumType : g.getEnumTypedefs())
  groupBuilder.addEnumTypes(NcStream.encodeEnumTypedef(enumType));
 for (Variable var : g.getVariables()) {
  if (var instanceof Structure)
   groupBuilder.addStructs(NcStream.encodeStructure((Structure) var));
  else
   groupBuilder.addVars(NcStream.encodeVar(var, sizeToCache));
 }
 for (Group ng : g.getGroups())
  groupBuilder.addGroups(encodeGroup(ng, sizeToCache));
 return groupBuilder;
}
ucar.nc2GroupgetAttributes

Javadoc

Get the set of attributes contained directly in this Group.

Popular methods of Group

  • findVariable
    Find the Variable with the specified (short) name in this group.
  • getGroups
    Get the Groups contained directly in this Group.
  • getVariables
    Get the Variables contained directly in this group.
  • findAttribute
    Find an Attribute in this Group by its name.
  • findDimension
    Retrieve a Dimension using its (short) name. If it doesnt exist in this group, recursively look in p
  • getDimensions
    Get the Dimensions contained directly in this group.
  • <init>
    Constructor
  • addAttribute
    Add new Attribute; replace old if has same name.
  • getShortName
    Get the "short" name, unique within its parent Group.
  • addEnumeration
    Add an Enumeration
  • findGroup
    Retrieve the Group with the specified (short) name.
  • addGroup
    Add a nested Group
  • findGroup,
  • addGroup,
  • findEnumeration,
  • addDimension,
  • remove,
  • addVariable,
  • equals,
  • findAttributeIgnoreCase,
  • getEnumTypedefs

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • JButton (javax.swing)
  • JFileChooser (javax.swing)
  • JTable (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now