dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMDSP.java
protected DapDimension
    builddim(Dimension cdmdim)
            throws DapException
    {
        if (cdmdim.isVariableLength())
            throw new DapException("* dimensions not supported");
        DapDimension dapdim = null;
        long cdmsize = dapsize(cdmdim);
        String name = cdmdim.getShortName();
        if (name != null && name.length() == 0)
            name = null;
        boolean shared = cdmdim.isShared();
        if (!shared) {
            // Unlike the parser, since we are working
            // from a NetcdfDataset instance, there might
            // be multiple anonymous dimension objects
            // the same size. So, just go ahead and create
            // multiple instances.
            dapdim = (DapDimension) dmrfactory.newDimension(null, cdmsize);
            getDMR().addDecl(dapdim);
        } else { // Non anonymous; create in current group
            dapdim = (DapDimension) dmrfactory.newDimension(name, cdmsize);
            dapdim.setShared(true);
            if (cdmdim.isUnlimited()) {
                dapdim.setUnlimited(true);
            }
            Group cdmparent = cdmdim.getGroup();
            DapGroup dapparent = (DapGroup) this.nodemap.get(cdmparent);
            assert dapparent != null;
            assert (dapparent != null);
            dapparent.addDecl(dapdim);
        }
        recordNode(cdmdim, dapdim);
        return dapdim;
    }
protected DapDimension
    builddim(Dimension cdmdim)
            throws DapException
    {
        if (cdmdim.isVariableLength())
            throw new DapException("* dimensions not supported");
        DapDimension dapdim = null;
        long cdmsize = dapsize(cdmdim);
        String name = cdmdim.getShortName();
        if (name != null && name.length() == 0)
            name = null;
        boolean shared = cdmdim.isShared();
        if (!shared) {
            // Unlike the parser, since we are working
            // from a NetcdfDataset instance, there might
            // be multiple anonymous dimension objects
            // the same size. So, just go ahead and create
            // multiple instances.
            dapdim = (DapDimension) dmrfactory.newDimension(null, cdmsize);
            getDMR().addDecl(dapdim);
        } else { // Non anonymous; create in current group
            dapdim = (DapDimension) dmrfactory.newDimension(name, cdmsize);
            dapdim.setShared(true);
            if (cdmdim.isUnlimited()) {
                dapdim.setUnlimited(true);
            }
            Group cdmparent = cdmdim.getGroup();
            DapGroup dapparent = (DapGroup) this.nodemap.get(cdmparent);
            assert dapparent != null;
            assert (dapparent != null);
            dapparent.addDecl(dapdim);
        }
        recordNode(cdmdim, dapdim);
        return dapdim;
    }
protected DapDimension builddim ( Dimension cdmdim ) throws DapException { if ( cdmdim . isVariableLength ( ) ) throw new DapException ( "* dimensions not supported" ) ; DapDimension dapdim = null ; long cdmsize = dapsize ( cdmdim ) ; String name = cdmdim . getShortName ( ) ; if ( name != null && name . length ( ) == 0 ) name = null ; boolean shared = cdmdim . isShared ( ) ; if ( ! shared ) { // Unlike the parser, since we are working // from a NetcdfDataset instance, there might // be multiple anonymous dimension objects // the same size. So, just go ahead and create // multiple instances. dapdim = ( DapDimension ) dmrfactory . newDimension ( null , cdmsize ) ; getDMR ( ) . addDecl ( dapdim ) ; } else { // Non anonymous; create in current group dapdim = ( DapDimension ) dmrfactory . newDimension ( name , cdmsize ) ; dapdim . setShared ( true ) ; if ( cdmdim . isUnlimited ( ) ) { dapdim . setUnlimited ( true ) ; } Group cdmparent = cdmdim . getGroup ( ) ; DapGroup dapparent = ( DapGroup ) this . nodemap . get ( cdmparent ) ; assert dapparent != null ; assert ( dapparent != null ) ; dapparent . addDecl ( dapdim ) ; } recordNode ( cdmdim , dapdim ) ; return dapdim ; }
Declaration Builders
Declaration Builders