/** * Eliminates array dimensions whose dimensions are 1 (and thus in practice don't exisit) * * @param dds The DDS to traverse and squeeze its member arrays. */ public static void squeezeArrays(DConstructor dds) { DArray a; Enumeration e = dds.getVariables(); while (e.hasMoreElements()) { opendap.dap.BaseType bt = (opendap.dap.BaseType) e.nextElement(); if (bt instanceof DArray) { a = (DArray) bt; log.debug("Squeezing array " + a.getTypeName() + " " + a.getLongName() + ";"); a.squeeze(); // System.out.print("Post squeezing: "); // a.printDecl(System.out); bt = a.getPrimitiveVector().getTemplate(); if (bt instanceof DConstructor) squeezeArrays((DConstructor) bt); } else if (bt instanceof DConstructor) { squeezeArrays((DConstructor) bt); } } }