Package java.util

Examples of java.util.Formatter.format()


    long val1 = -1;
    long val2 = 234872309;
    int val3 = 2348;
    int val4 = 32;
    Formatter f = new Formatter(System.out);
    f.format("  address            dataPos            offset size\n");
    f.format("  %#-18x %#-18x %5d  %4d%n", val1, val2, val3, val4);

  }

View Full Code Here


    long val2 = 234872309;
    int val3 = 2348;
    int val4 = 32;
    Formatter f = new Formatter(System.out);
    f.format("  address            dataPos            offset size\n");
    f.format("  %#-18x %#-18x %5d  %4d%n", val1, val2, val3, val4);

  }


  static public String showBytes(byte[] buff) {
View Full Code Here

   */
  @Override
  public String cdmVariableName(GridTableLookup lookup, boolean useLevel, boolean useStat) {
    Formatter f = new Formatter();
    String desc = getParameterDescription();
    f.format("%s", desc);

    if (edition == 2) {
      Grib2Pds pds2 = (Grib2Pds) pds;
      String useGenType = pds2.getUseGenProcessType();
      if (useGenType != null)
View Full Code Here

    if (edition == 2) {
      Grib2Pds pds2 = (Grib2Pds) pds;
      String useGenType = pds2.getUseGenProcessType();
      if (useGenType != null)
        f.format("_%s", useGenType);
    }

    if (useLevel) {
      String levelName = lookup.getLevelName(this);
      if (levelName.length() != 0) {
View Full Code Here

      String levelName = lookup.getLevelName(this);
      if (levelName.length() != 0) {
        boolean hasLayerInName = levelName.indexOf("layer") >= 0;
        boolean isLayer = lookup.isLayer(this);
        if (isLayer && !hasLayerInName)
          f.format("_%s_layer", levelName);
        // else if (!isLayer && hasLayerInName) LOOK remove for now - but see NAM_CONUS_12km_conduit
        //  f.format("_%s_level", levelName);
        else
          f.format("_%s", levelName);
      }
View Full Code Here

        if (isLayer && !hasLayerInName)
          f.format("_%s_layer", levelName);
        // else if (!isLayer && hasLayerInName) LOOK remove for now - but see NAM_CONUS_12km_conduit
        //  f.format("_%s_level", levelName);
        else
          f.format("_%s", levelName);
      }
    }

    if (useStat) {
      f.format("%s", makeSuffix());
View Full Code Here

          f.format("_%s", levelName);
      }
    }

    if (useStat) {
      f.format("%s", makeSuffix());
    }

    return f.toString();
  }
View Full Code Here

    Formatter f = new Formatter();
    boolean disambig = false;

    String statName = getStatisticalProcessTypeNameShort();
    if (statName != null) {
       f.format("_%s", statName);
       disambig = true;
    }

    if (edition == 2) {
       Grib2Pds pds2 = (Grib2Pds) pds;
View Full Code Here

       Grib2Pds pds2 = (Grib2Pds) pds;

       if (pds2.isEnsembleDerived()) {
         Grib2Pds.PdsEnsembleDerived pdsDerived = (Grib2Pds.PdsEnsembleDerived) pds2;
         int type = pdsDerived.getDerivedForecastType(); // derived type (table 4.7)
         f.format("_%s", Grib2Tables.codeTable4_7short(type));
         disambig = true;

       } else if (pds2.isProbability()) {
         Grib2Pds.PdsProbability pdsProb = (Grib2Pds.PdsProbability) pds2;
         String name = getProbabilityVariableNameSuffix(pdsProb.getProbabilityLowerLimit(), pdsProb.getProbabilityUpperLimit(), pdsProb.getProbabilityType());
View Full Code Here

         disambig = true;

       } else if (pds2.isProbability()) {
         Grib2Pds.PdsProbability pdsProb = (Grib2Pds.PdsProbability) pds2;
         String name = getProbabilityVariableNameSuffix(pdsProb.getProbabilityLowerLimit(), pdsProb.getProbabilityUpperLimit(), pdsProb.getProbabilityType());
         f.format("_%s", name);
         disambig = true;
       }

        //if (!disambig) {
        //  f.format("_template%d", pds2.getProductDefinitionTemplate());
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.