opendap/src/main/java/opendap/dap/DDS.java
private DConstructor isVectorOfDConstructor(BaseType var)
    {
        if (!(var instanceof DVector))
            return null;
        if (!(((DVector) var).getPrimitiveVector()
                instanceof BaseTypePrimitiveVector))
            return null;
        // OK. We have a DVector whose template is a BaseTypePrimitiveVector.
        BaseTypePrimitiveVector btpv = (BaseTypePrimitiveVector)
                ((DVector) var).getPrimitiveVector();
        // After that nasty cast, is the template a DConstructor?
        if (btpv.getTemplate() instanceof DConstructor)
            return (DConstructor) btpv.getTemplate();
        else
            return isVectorOfDConstructor(btpv.getTemplate());
    }
private DConstructor isVectorOfDConstructor(BaseType var)
    {
        if (!(var instanceof DVector))
            return null;
        if (!(((DVector) var).getPrimitiveVector()
                instanceof BaseTypePrimitiveVector))
            return null;
        // OK. We have a DVector whose template is a BaseTypePrimitiveVector.
        BaseTypePrimitiveVector btpv = (BaseTypePrimitiveVector)
                ((DVector) var).getPrimitiveVector();
        // After that nasty cast, is the template a DConstructor?
        if (btpv.getTemplate() instanceof DConstructor)
            return (DConstructor) btpv.getTemplate();
        else
            return isVectorOfDConstructor(btpv.getTemplate());
    }
private DConstructor isVectorOfDConstructor ( BaseType var ) { if ( ! ( var instanceof DVector ) ) return null ; if ( ! ( ( ( DVector ) var ) . getPrimitiveVector ( ) instanceof BaseTypePrimitiveVector ) ) return null ; // OK. We have a DVector whose template is a BaseTypePrimitiveVector. BaseTypePrimitiveVector btpv = ( BaseTypePrimitiveVector ) ( ( DVector ) var ) . getPrimitiveVector ( ) ; // After that nasty cast, is the template a DConstructor? if ( btpv . getTemplate ( ) instanceof DConstructor ) return ( DConstructor ) btpv . getTemplate ( ) ; else return isVectorOfDConstructor ( btpv . getTemplate ( ) ) ; }
Is the variable <code>var</code> a vector of DConstructors? Return
true if it is, false otherwise. This mess will recurse into a
DVector's template BaseType (which is a BaseTypePrimivitiveVector) and
look to see if that is either a DConstructor or <em>contains</em> a
DConstructor. So the <code>List Strucutre { ... } g[10];</code> should
be handled correctly. <p>
<p/>
Note that the List type modifier may only appear once.
Is the variable <code > var< / code > a vector of DConstructors? Return true if it is false otherwise . This mess will recurse into a DVector s template BaseType ( which is a BaseTypePrimivitiveVector ) and look to see if that is either a DConstructor or <em > contains< / em > a DConstructor . So the <code > List Strucutre { ... } g [ 10 ] ; < / code > should be handled correctly . <p > <p / > Note that the List type modifier may only appear once .