Examples of Formatter


Examples of java.util.Formatter

      return new ArraySequence(s.makeStructureMembers(), siter, -1);
    }

    StringBuilder sbuff = new StringBuilder(remoteURI);
    sbuff.append("?var=");
    Formatter f = new Formatter();
    f.format("%s", v.getFullNameEscaped()); // full name
    if (section != null && v.getDataType() != DataType.SEQUENCE) {
      f.format("(%s)", section.toString());
    }
    sbuff.append( URLEncoder.encode(f.toString(), "UTF-8")); // % escape entire thing varname and section

    if (showRequest)
      System.out.println(" CdmRemote data request for variable: " + v.getFullName() + " section= " + section + " url=" + sbuff);

    HTTPMethod method = null;
View Full Code Here

Examples of java.util.Formatter

        Attribute bitWidthAtt = v.findAttribute("BUFR:bitWidth");
        int bitWidth = bitWidthAtt.getNumericValue().intValue();
        double sigDigitsD = Math.log10(2 << bitWidth);
        int sigDigits = (int) (sigDigitsD + 1);

        Formatter stringFormatter = new Formatter();
        String format = "%." + sigDigits + "g";
        stringFormatter.format(format, val);
        staxWriter.writeCharacters(stringFormatter.toString());
       
      } else // numeric, not float
        staxWriter.writeCharacters(mdata.toString());
      }
View Full Code Here

Examples of java.util.Formatter

    return dateRange;
  }

  @Override
  public String toString() {
    Formatter f = new Formatter();
    f.format("CollectionManager{%n");
    for (TimedCollection.Dataset d : datasets)
      f.format(" %s%n", d);
    f.format("}%n");
    return f.toString();
  }
View Full Code Here

Examples of java.util.Formatter

      System.out.printf("%s%n", err);
    System.out.printf("-----------------------------------%n");
  }

  public static void main(String arg[]) throws IOException {
    doit("C:/data/formats/gempak/surface/#yyyyMMdd#_sao.gem", new Formatter());
    //doit("C:/data/formats/gempak/surface/#yyyyMMdd#_sao\\.gem", new Formatter());
    // doit("Q:/station/ldm/metar/Surface_METAR_#yyyyMMdd_HHmm#.nc", new Formatter());
  }
View Full Code Here

Examples of java.util.Formatter

    TableAnalyzer getTableAnalyzer() { return analyser; }
  }

  static void doit(PointDatasetStandardFactory fac, String filename) throws IOException {
    System.out.println(filename);
    Formatter errlog = new Formatter(System.out);
    NetcdfDataset ncd = ucar.nc2.dataset.NetcdfDataset.openDataset(filename);
    TableAnalyzer analysis = (TableAnalyzer) fac.isMine(FeatureType.ANY_POINT, ncd, errlog);

    fac.open(FeatureType.ANY_POINT, ncd, analysis, null, errlog);
    analysis.getDetailInfo(errlog);
View Full Code Here

Examples of java.util.Formatter

  protected void initStationHelper() {
    TimedCollection.Dataset td = dataCollection.getPrototype();
    if (td == null)
      throw new RuntimeException("No datasets in the collection");

    Formatter errlog = new Formatter();
    FeatureDatasetPoint openDataset = null;
    try {
      openDataset = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.STATION, td.getLocation(), null, errlog);

      List<FeatureCollection> fcList = openDataset.getPointFeatureCollectionList();
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();
        currentDataset = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.STATION, td.getLocation(), null, errlog);
        List<FeatureCollection> fcList = currentDataset.getPointFeatureCollectionList();
        StationTimeSeriesFeatureCollection stnCollection = (StationTimeSeriesFeatureCollection) fcList.get(0);
        Station s = stnCollection.getStation(getName());
        if (s == null) {
View Full Code Here

Examples of java.util.Formatter

      TimedCollection.Dataset td = datasets.getPrototype();
      if (td == null) return null;

      String loc = td.getLocation();
      Formatter errlog = new Formatter();
      try {
        proto = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.ANY_POINT, loc, null, errlog); // LOOK kludge
        return proto.getNetcdfFile();
      } catch (IOException e) {
        log.error(errlog.toString());
        e.printStackTrace();
      }
      return null;
    }
View Full Code Here

Examples of java.util.Formatter

      // must open a prototype in order to get the data variable
      TimedCollection.Dataset td = pointCollections.getPrototype();
      if (td == null)
        throw new RuntimeException("No datasets in the collection");

      Formatter errlog = new Formatter();
      FeatureDatasetPoint openDataset = null;
      try {
        openDataset = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.POINT, td.getLocation(), null, errlog);
        if (openDataset != null)
          dataVariables = openDataset.getDataVariables();
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();
      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
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.