Package org.gumtree.data.gdm.core

Examples of org.gumtree.data.gdm.core.Group


  {
    HashMap<String, String> dico = new HashMap<String, String>();
    DataItem item;
    List<?> dataItems;
    List<?> groups;
    Group group;

    // Get all data nodes (means NeXus dataset) sons of currently opened node
    dataItems = curGroup.getDataItems();

    // Add each node to the dictionary
View Full Code Here


    // Instantiate Dataset (Gumtree meaning) on file to be read
    Dataset dataset = Factory.getDataset(new File(filename).toURI());

    // Get the file root
    Group group = dataset.getRootGroup();

    // generate the file's dictionary starting from the file's root
    Map<String, String> dictionary = createDictionary(group);

    // Instantiate the dictionary
    IPathResolver pathResolver = new DictionaryPathResolver(dictionary);

    // Instantiation the "container" that links the dataset and the dictionary
    IDataContainer container = new DataContainer(dataset);

    // Set dictionary on the container
    container.setPathSolver(pathResolver);

    // Parse the file (using the dictionary) to display data
    for (String key : dictionary.keySet())
    {
      String value;
      try
      {
        // get the value of the dataset corresponding to the current key
        value = container.get(key).toString();
        System.out.println(key + ": " + (value.length() < 1000 ? value : "Data to long to be displayed using eclipse!") );
      }
      catch(DataModelException n)
      {
        System.out.println("ERROR on key: " + key);
        n.printStackTrace();
      }

      // Get the group node corresponding to the current key
      group = dataset.getRootGroup();
      DataItem toto = (DataItem) group.getObjectByPath(container.getPathResolver()
          .resolvePath(key));
      group = toto.getParentGroup();

      // Scan node's attribute
      List<?> list_attr = group.getAttributes();
      for (Object name : list_attr) {
        Attribute attr = (Attribute) name;
        System.out.println(">> attribut : " + attr.toString());
      }
    }
View Full Code Here

TOP

Related Classes of org.gumtree.data.gdm.core.Group

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.