Examples of Output


Examples of com.xmlcalabash.model.Output

        rpipe.canReadSequence(true); // FIXME: I should be able to set this correctly!
        return rpipe;
    }

    public Serialization getSerialization(String port) {
        Output output = step.getOutput(port);
        return output.getSerialization();
    }
View Full Code Here

Examples of com.xmlcalabash.util.Output

        Map<String, Output> portOutputs = new HashMap<String, Output>();

        Map<String, Output> userArgsOutputs = userArgs.getOutputs();
        for (String port : pipeline.getOutputs()) {
            // Bind to "-" implicitly
            Output output = null;

            if (userArgsOutputs.containsKey(port)) {
                output = userArgsOutputs.get(port);
            } else if (config.outputs.containsKey(port)) {
                output = new Output(config.outputs.get(port));
            } else if (userArgsOutputs.containsKey(null)
                       && pipeline.getDeclareStep().getOutput(port).getPrimary()) {
                // Bind unnamed port to primary output port
                output = userArgsOutputs.get(null);
            }

            // Look for explicit binding to "-"
            if ((output != null) && (output.getKind() == Kind.URI) && "-".equals(output.getUri())) {
                output = null;
            }

            portOutputs.put(port, output);
        }

        for (QName optname : config.options.keySet()) {
            RuntimeValue value = new RuntimeValue(config.options.get(optname), null, null);
            pipeline.passOption(optname, value);
        }

        for (QName optname : userArgs.getOptionNames()) {
            RuntimeValue value = new RuntimeValue(userArgs.getOption(optname), null, null);
            pipeline.passOption(optname, value);
        }

        pipeline.run();

        for (String port : pipeline.getOutputs()) {
            Output output;
            if (portOutputs.containsKey(port)) {
                output = portOutputs.get(port);
            } else {
                // You didn't bind it, and it isn't going to stdout, so it's going into the bit bucket.
                continue;
            }

            if ((output == null) || ((output.getKind() == OUTPUT_STREAM) && System.out.equals(output.getOutputStream()))) {
                logger.trace("Copy output from " + port + " to stdout");
            } else {
                switch (output.getKind()) {
                    case URI:
                        logger.trace("Copy output from " + port + " to " + output.getUri());
                        break;

                    case OUTPUT_STREAM:
                        String outputStreamClassName = output.getOutputStream().getClass().getName();
                        logger.trace("Copy output from " + port + " to " + outputStreamClassName + " stream");
                        break;

                    default:
                        throw new UnsupportedOperationException(format("Unsupported output kind '%s'", output.getKind()));
                }
            }

            Serialization serial = pipeline.getSerialization(port);

            if (serial == null) {
                // Use the configuration options
                // FIXME: should each of these be considered separately?
                // FIXME: should there be command-line options to override these settings?
                serial = new Serialization(runtime, pipeline.getNode()); // The node's a hack
                for (String name : config.serializationOptions.keySet()) {
                    String value = config.serializationOptions.get(name);

                    if ("byte-order-mark".equals(name)) serial.setByteOrderMark("true".equals(value));
                    if ("escape-uri-attributes".equals(name)) serial.setEscapeURIAttributes("true".equals(value));
                    if ("include-content-type".equals(name)) serial.setIncludeContentType("true".equals(value));
                    if ("indent".equals(name)) serial.setIndent("true".equals(value));
                    if ("omit-xml-declaration".equals(name)) serial.setOmitXMLDeclaration("true".equals(value));
                    if ("undeclare-prefixes".equals(name)) serial.setUndeclarePrefixes("true".equals(value));
                    if ("method".equals(name)) serial.setMethod(new QName("", value));

                    // FIXME: if ("cdata-section-elements".equals(name)) serial.setCdataSectionElements();
                    if ("doctype-public".equals(name)) serial.setDoctypePublic(value);
                    if ("doctype-system".equals(name)) serial.setDoctypeSystem(value);
                    if ("encoding".equals(name)) serial.setEncoding(value);
                    if ("media-type".equals(name)) serial.setMediaType(value);
                    if ("normalization-form".equals(name)) serial.setNormalizationForm(value);
                    if ("standalone".equals(name)) serial.setStandalone(value);
                    if ("version".equals(name)) serial.setVersion(value);
                }
            }

            // I wonder if there's a better way...
            WritableDocument wd = null;
            if (output == null) {
                wd = new WritableDocument(runtime, null, serial);
            } else {
                switch (output.getKind()) {
                    case URI:
                        URI furi = new URI(output.getUri());
                        String filename = furi.getPath();
                        FileOutputStream outfile = new FileOutputStream(filename);
                        wd = new WritableDocument(runtime, filename, serial, outfile);
                        break;

                    case OUTPUT_STREAM:
                        OutputStream outputStream = output.getOutputStream();
                        wd = new WritableDocument(runtime, null, serial, outputStream);
                        break;

                    default:
                        throw new UnsupportedOperationException(format("Unsupported output kind '%s'", output.getKind()));
                }
            }

            try {
                ReadablePipe rpipe = pipeline.readFrom(port);
View Full Code Here

Examples of de.iritgo.aktera.model.Output

      Configuration config = getConfiguration();
      java.util.List configPath = ModelTools.getDerivationPath(req, this);

      ModelResponse res = req.createResponse();
      ListingDescriptor listing = createListingFromConfig(config, configPath);
      Output output = res.createOutput("listing");

      output.setContent(listing);
      res.add(output);

      return res;
    }
    catch (ConfigurationException x)
View Full Code Here

Examples of ec.util.Output

             */
            void initializeEvolutionState()
                throws BadParameterException, ParamClassLoadException
                {
                listeners.removeAllElements();
                Output output = initializeOutput();
               
                // 2. set up thread values
                /*
                  int breedthreads = parameters.getInt(
                  new Parameter(Evolve.P_BREEDTHREADS),null,1);
                  if (breedthreads < 1)
                  Output.initialError("Number of breeding threads should be an integer >0.",
                  new Parameter(Evolve.P_BREEDTHREADS));
               
                  int evalthreads = parameters.getInt(
                  new Parameter(Evolve.P_EVALTHREADS),null,1);
                  if (evalthreads < 1)
                  Output.initialError("Number of eval threads should be an integer >0.",
                  new Parameter(Evolve.P_EVALTHREADS));
                */
               
                int breedthreads = Evolve.determineThreads(output, parameters, new Parameter(Evolve.P_BREEDTHREADS));
                int evalthreads = Evolve.determineThreads(output, parameters, new Parameter(Evolve.P_EVALTHREADS));
                @SuppressWarnings("unused")
        boolean auto = (Evolve.V_THREADS_AUTO.equalsIgnoreCase(parameters.getString(new Parameter(Evolve.P_BREEDTHREADS),null)) ||
                    Evolve.V_THREADS_AUTO.equalsIgnoreCase(parameters.getString(new Parameter(Evolve.P_EVALTHREADS),null)))// at least one thread is automatic.  Seeds may need to be dynamic.

                // 3. create the Mersenne Twister random number generators,
                // one per thread
                MersenneTwisterFast[] random = new MersenneTwisterFast[breedthreads > evalthreads ?
                    breedthreads : evalthreads];
                int[] seeds = new int[breedthreads > evalthreads ?
                    breedthreads : evalthreads];
               
                String seed_message = "Seed: ";
                for (int x=0;x<random.length;x++)
                   
                    {
                    seeds[x] = conPanel.getSeed(currentJob,x);
                    seed_message = seed_message + seeds[x] + " ";
                    }
               
                for (int x=0;x<random.length;x++)
                   
                    {
                    for (int y=x+1;y<random.length;y++)
                        if (seeds[x]==seeds[y])
                           
                            {
                            Output.initialError(Evolve.P_SEED+"."+x+" ("+seeds[x]+") and "+Evolve.P_SEED+"."+y+" ("+seeds[y]+") ought not be the same seed.");
                            }
                    random[x] = Evolve.primeGenerator(new MersenneTwisterFast(seeds[x]));   // we prime the generator to be more sure of randomness.
                    }
               
                state = (EvolutionState)parameters.getInstanceForParameter(
                    new Parameter(Evolve.P_STATE),null,EvolutionState.class);
               
                state.parameters = parameters;
                state.random = random;
                state.output = output;
                String jobFilePrefix = Console.this.conPanel.getJobFilePrefix();
                if (Console.this.conPanel.getNumJobs() > 1)
                    {
                    if (jobFilePrefix == null || jobFilePrefix.length()<1)
                        {
                        jobFilePrefix = "job";
                        }
                    jobFilePrefix = jobFilePrefix+"."+Console.this.currentJob+".";
                    state.output.setFilePrefix(jobFilePrefix);
                    }
               
                state.evalthreads = evalthreads;
                state.breedthreads = breedthreads;
               
                output.systemMessage("Threads:  breed/" + breedthreads + " eval/" + evalthreads);
                output.systemMessage(seed_message);
               
                state.startFresh();

                if (Console.this.conPanel.getNumJobs() > 0)
                    {
View Full Code Here

Examples of edu.neu.ccs.task.dialogue.Output

      currentOutput = currentTurn.getOutputText();
    return currentOutput;
  }
 
  public String getCurrentPlainOutput() {
    Output o = getCurrentOutput();
    return o==null ? null : o.getPlain(getFocusTask());
  }
View Full Code Here

Examples of es.unex.sextante.outputs.Output

    Map<String, Object> results = new HashMap<String, Object>();

    OutputObjectsSet outputs = m_Algorithm.getOutputObjects();
    for (int i = 0; i < outputs.getOutputObjectsCount(); i++) {
      Output output = outputs.getOutput(i);
      Object outputObject = output.getOutputObject();
      // if the output object is a layer or a table, we return
      // the inner GeoTools object
      if (outputObject instanceof IDataObject){
        IDataObject dataObject = (IDataObject) outputObject;
        results.put(output.getName(), dataObject.getBaseDataObject());
      }
      else{
        results.put(output.getName(), outputObject);
      }
    }
    return results;

  }
View Full Code Here

Examples of etch.compiler.Output

    }

    // ok, we're ready to generate code. make sure the
    // output directories exist.

    Output dir = options.output;
    Output templateDir = options.templateOutput;
   
    String m = module.name().name;
    if (m.length() > 0)
    {
      dir = dir.newPackage( m );
      templateDir = templateDir.newPackage( m );
    }
   
    // generate code for each service.

    for (Service intf : module)
View Full Code Here

Examples of eu.admire.dispel.parameters.Output

  /**
   * @generated
   */
  public static List<DispelLinkDescriptor> getOutput_3007IncomingLinks(
      View view) {
    Output modelElement = (Output) view.getElement();
    Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
        .find(view.eResource().getResourceSet().getResources());
    LinkedList<DispelLinkDescriptor> result = new LinkedList<DispelLinkDescriptor>();
    result.addAll(getIncomingTypeModelFacetLinks_ConnectionExpression_4001(
        modelElement, crossReferences));
View Full Code Here

Examples of gri.gridp.modules.Output

    if (refAttribute != null) {
      String ref = refAttribute.getValue();
      if (globalOutputs == null)
        throw new InvalidModuleException("Reference to output '" + ref + "' was made, but no output map was supplied");

      Output output = (Output)globalOutputs.get(ref);
      if (output == null)
        throw new InvalidModuleException("Reference to output '" + ref + "' was made, but output was not found in supplied output list");
      else
        return (Output)output.clone();
    }

    //parse regular:
    String paramName = element.getAttributeValue("name");
    if (paramName == null)
      throw new InvalidModuleException("Output parameter missing required 'name' attribute");

    Output output = new Output(paramName);

    String type = element.getAttributeValue("type");
    if (type == null)
      type = Types.FILE;     //or is FILE_LIST better because it's safer?
    output.setType(type);

    List children = element.getChildren();
    Element child;
    for (int i=0; i<children.size(); i++) {
      child = (Element)children.get(i);
      String name = child.getName().toLowerCase();

      if (name.equals("title"))
        output.setTitle(child.getText());
      else if (name.equals("help"))
        output.setHelp(child.getText());
      else if (name.equals("pattern"))
        output.setPattern(child.getText());
    }

    //validate:
    if (output.getPattern() == null)
      throw new InvalidModuleException("Output parameter missing required 'pattern' element");

    return output;
  }
View Full Code Here

Examples of javax.wsdl.Output

                                schemaWSDLValidator.addError(errNode, " input : " + input.getName()
                                                                      + " reference is not defined");
                                isValid = false;
                            }

                            Output output = operation.getOutput();
                            if (output != null && output.getMessage() != null
                                && !msgPartsMap.containsKey(output.getMessage().getQName())) {
                                Node errNode = ErrNodeLocator.getNode(document,
                                                                      WSDLConstants.QNAME_OPERATION,
                                                                      operation.getName(), output.getName());
                                schemaWSDLValidator.addError(errNode, " output : " + output.getName()
                                                                      + " reference is not defined");
                                isValid = false;
                            }

                            Map faultMap = operation.getFaults();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.