/** * Print the constrained <code>DDS</code> on the given * <code>PrintWriter</code>. * * @param os the <code>PrintWriter</code> to use for output. */ public void printConstrained(PrintWriter os) { os.println("Dataset {"); for (Enumeration e = getVariables(); e.hasMoreElements();) { BaseType bt = (BaseType) e.nextElement(); // System.err.println("check: "+bt.getLongName()+" = "+((ServerMethods) bt).isProject()); ServerMethods sm = (ServerMethods) bt; if(sm.isProject()) { bt.printDecl(os, " ", true, true); } } os.print("} "); if (getEncodedName() != null) os.print(getEncodedName()); os.println(";"); }
if (((ServerMethods) bt).isProject()) {
ServerMethods sm = (ServerMethods) e.nextElement(); if (sm.isProject()) sm.serialize(dataset, sink, ce, specialO);
if (((ServerMethods) bt).isProject()) { if (!firstPass) os.print(", ");
((BaseType) s).getEncodedName()); if (s.isProject()) {
boolean ctormarked(BaseType bt) { if (!(bt instanceof DConstructor)) return false; try { DConstructor ctor = (DConstructor) bt; for (int i = 0; i < ctor.getVarCount(); i++) { BaseType var = ctor.getVar(i); if (!((ServerMethods) var).isProject()) return false; } } catch (NoSuchVariableException nsve) { return false; } return true; }
throws IOException, NoSuchVariableException { if (!((ServerMethods) bt).isProject()) return;
if (sm.isProject()) { if (_Debug) System.out.println("Sending variable: " + ((BaseType) sm).getEncodedName()); sm.serialize(dataset, sink, ce, specialO);
void dumpEvaluator(CEEvaluator cev, PrintWriter os) { // Get the variables and grids in the DDS and print their projections List<BaseType> dumplist = new ArrayList<BaseType>(); for (int i = 0; i < allnodes.size(); i++) { BaseType node = allnodes.get(i); if (!((ServerMethods) node).isProject()) continue; // // suppress all children of marked ctor // if(ctormarked(getTrueParent(node))) continue; // // suppress all non-marked ctors // if(node instanceof DConstructor && !ctormarked(node)) continue; dumplist.add(node); } // Sort dumplist dumplist = sort(dumplist); // Dump dumplist for (int i = 0; i < dumplist.size(); i++) { BaseType node = dumplist.get(i); if (i > 0) os.print(","); List<BaseType> path = getPath((BaseType) node); node.printConstraint(os); //dumpPath(path,os); } Enumeration ec = cev.getClauses(); while (ec.hasMoreElements()) { Clause c = (Clause) ec.nextElement(); os.print('&'); c.printConstraint(os); } }