public Group addGroup ( Group parent , String name ) { if ( ! defineMode ) throw new UnsupportedOperationException ( "not in define mode" ) ; if ( parent == null ) return ncfile . getRootGroup ( ) ; Group result = new Group ( ncfile , parent , name ) ; parent . addGroup ( result ) ; return result ; }
Add a Group to the file . Must be in define mode . If pass in null as the parent then the root group is returned and the name is ignored . This is how you get the root group . Note this is different from other uses of parent group .