Examples of Formatter


Examples of java.util.Formatter

    }

    private PointFeatureIterator getNextIterator() throws IOException {
      if (!iter.hasNext()) return null;
      TimedCollection.Dataset td = iter.next();
      Formatter errlog = new Formatter();
      currentDataset = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.POINT, td.getLocation(), null, errlog);
      if (CompositeDatasetFactory.debug)
        System.out.printf("CompositePointFeatureIterator open dataset %s%n", td.getLocation());
      List<FeatureCollection> fcList = currentDataset.getPointFeatureCollectionList();
      PointFeatureCollection pc = (PointFeatureCollection) fcList.get(0);
View Full Code Here

Examples of java.util.Formatter

    }

    private PointFeatureIterator getNextIterator() throws IOException {
      if (!iter.hasNext()) return null;
      TimedCollection.Dataset td = iter.next();
      Formatter errlog = new Formatter();

      // open the next dataset
      currentDataset = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.STATION, td.getLocation(), null, errlog);
      if (currentDataset == null) {
        logger.error("FeatureDatasetFactoryManager failed to open: " + td.getLocation() + " \nerrlog = " + errlog);
View Full Code Here

Examples of java.util.Formatter

    compareFiles(org, copy, false, false, false);
  }

  static public void compareFiles(NetcdfFile org, NetcdfFile copy, boolean _compareData, boolean _showCompare, boolean _showEach) {
    CompareNetcdf tc = new CompareNetcdf(_showCompare, _showEach, _compareData);
    tc.compare(org, copy, new Formatter(System.out));
  }
View Full Code Here

Examples of java.util.Formatter

    // do it in memory for speed
    NetcdfFile ncfile = inMemory ? NetcdfFile.openInMemory(fileIn) : NetcdfFile.open(fileIn);
    NetcdfDataset ncd = new NetcdfDataset(ncfile);

    Formatter errlog = new Formatter();
    FeatureDataset fd = FeatureDatasetFactoryManager.wrap(FeatureType.ANY_POINT, ncd, null, errlog);
    if (fd == null) return false;

    if (fd instanceof FeatureDatasetPoint) {
      writePointFeatureCollection((FeatureDatasetPoint) fd, fileOut);
View Full Code Here

Examples of java.util.logging.Formatter

               // Handler[] tmpHandlers = defLogger.getHandlers();
               // Handler[] refHandlers = new Handler[tmpHandlers.length];
               Handler[] refHandlers = defLogger.getHandlers();
               for (int i=0; i < refHandlers.length; i++) {
                  refHandlers[i].setLevel(Level.FINEST);
                  Formatter formatter = refHandlers[i].getFormatter();
                  if (formatter instanceof XbFormatter) {
                     XbFormatter xb = (XbFormatter)formatter;
                     xb.setGlobal(this);
                  }
               }
View Full Code Here

Examples of java.util.logging.Formatter

    }
    if(outHandlerList.size() == 0){
        outHandlerList.add(new ConsoleHandler());
    }
    String loggingFormat = getString("loggings.format", "java.util.logging.XMLFormatter");
    Formatter format=null;
    try {
      Class c = Class.forName(loggingFormat);
      if(Formatter.class.isAssignableFrom(c)){
        try {
          format=(Formatter)c.newInstance();
View Full Code Here

Examples of lupos.endpoint.server.format.Formatter

            Math.min(message.length(), MAX_DEBUG_LENGTH))));
    /*
     * get the JSON formatter, because we know, subgraphs are serialized in
     * JSON
     */
    final Formatter formatter = new JSONFormatter();

    /*
     * try to parse the message
     */
    P2PMessage msg = null;
    try {
      msg = P2PMessage.parse(message);
    } catch (RuntimeException e) {
      l.error(String.format(
          "Error unmarshalling received message from %s: %s", from,
          message), e);
    }

    /*
     * if this message is a response of subgraph requests, store this result
     * and inform waiting instance, that result is received.
     */
    if (msg.type != null && msg.type.equals(P2PMessage.SUBGRAPH_RESPONSE)) {
      l.debug(String.format(
          "Got result from message %s: %s",
          msg.id,
          msg.message.substring(0,
              Math.min(msg.message.length(), MAX_DEBUG_LENGTH))));
      /*
       * add the result and inform the waiting thread
       */
      addMessageResult(msg.id, msg.message);
      return;
    } else if (msg.type != null
        && msg.type.equals(P2PMessage.SUBGRAPH_REQUEST)) {
      /*
       * so here, the message is a request, so evaluate the request with
       * local evaluator and sent the result back
       */
      // Get the subgraph and data for unmarshalling the subgraph into
      // operator graph.
      final String subgraphSerializedAsJSONString = msg.message;
      if (!hasEvaluator())
        throw new RuntimeException(
            "No local executer found for evaluation subgraph.");

      final String _answerId = msg.id;
      final Runnable task = new Runnable() {

        public void run() {
          // get the local evaluator and things for unmarshalling data
          QueryEvaluator<?> eval = getEvaluator();
          Dataset dataset = null;
          // get the creator
          IOperatorCreator creater = new QueryClientOperatorCreator();
          // get the dataset
          if (eval instanceof BasicIndexQueryEvaluator) {
            dataset = ((BasicIndexQueryEvaluator) eval)
                .getDataset();
          }
          try {
            /*
             * now evaluate the subgraph and get the result back as
             * Tuple, where the first component is the serialized
             * result, and the second is the MIME-type (would be
             * here: JSON)
             */
            l.debug(String.format(
                "Local executing subgraph: %s on %s",
                subgraphSerializedAsJSONString, this));

           
            LiteralFactory.setType(MapType.NOCODEMAP);
           
            /*
             * this message request is sent via streaming, because
             * P2P network does support
             */
            if (getP2PNetwork().supportsStreaming()) {
              /*
               * for streaming we use XML als formatter
               */
              final Formatter _formatter = new XMLFormatter();
              /*
               * create header and evaluate the subgraph
               */
              byte[] head = P2PInputStreamMessage.createHeader(
                  _answerId, true);
View Full Code Here

Examples of net.sourceforge.align.formatter.Formatter

    }

    filter = FilterDecorators.decorate(filter);

    Parser parser = new AlParser(getIn());
    Formatter formatter = new AlFormatter(getOut());
    List<Alignment> alignmentList = parser.parse();
    alignmentList = filter.apply(alignmentList);
    formatter.format(alignmentList);
  }
View Full Code Here

Examples of net.sourceforge.retroweaver.harmony.runtime.java.util.Formatter

        return buffer.toString();
  }

  public static String format(String s, Object... params) {
    return new Formatter().format(s, params).toString();
  }
View Full Code Here

Examples of net.sourceforge.retroweaver.runtime.java.util.Formatter

    return p.matcher(s).replaceAll(replacement.toString());
  }

  public static String format(String s, Object... params) {
    return new Formatter().format(s, params).toString();
  }
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.