Package java.util

Examples of java.util.Formatter.format()


    } catch (final Exception e) {

      final Formatter out = new Formatter();

      logger.error(out.format("Unable to load factory class [%s]", path)
          .toString());

//      throw new IllegalStateException(e);
    }
  }
View Full Code Here


            suffix = "";
        else
            suffix = "s";
        final StringBuilder sb = new StringBuilder();
        final Formatter formatter = new Formatter(sb, Locale.US);
        formatter.format("%d %s%s", this.length, this.units.getLongFormat(),
                suffix);
        return sb.toString();
    }

    /**
 
View Full Code Here

     * Output periods in short format (e.g. "2w")
     */
    private String getInternalShortFormat() {
        final StringBuilder sb = new StringBuilder();
        final Formatter formatter = new Formatter(sb, Locale.US);
        formatter.format("%d%s", this.length, this.units.getShortFormat());
        return sb.toString();
    }

    public void normalize() {
        if (length!=0)
View Full Code Here

    }

    private void logTimecards(TimecardSummaryVO[] timecards) {

        Formatter formatter = new Formatter();
        formatter.format(TimecardHdrFormat, "Submitter", "Approver", "Status",    "Start Date");
        logger.info(formatter.toString());
        for (int i = 0; i < timecards.length; i++) {
            formatter = new Formatter();
            formatter.format(
                    TimecardRowFormat,
View Full Code Here

        Formatter formatter = new Formatter();
        formatter.format(TimecardHdrFormat, "Submitter", "Approver", "Status",    "Start Date");
        logger.info(formatter.toString());
        for (int i = 0; i < timecards.length; i++) {
            formatter = new Formatter();
            formatter.format(
                    TimecardRowFormat,
                    timecards[i].getSubmitterName(),
                    timecards[i].getApproverName(),
                    timecards[i].getStatus(),
                    timecards[i].getStartDate());
View Full Code Here

            if ( isNull() )
                return "null date";
            else {
                final StringBuilder sb = new StringBuilder();
                final Formatter formatter = new Formatter(sb, Locale.US);
                formatter.format("%s %d, %d", month(), dayOfMonth(), year());
                return sb.toString();
            }
        }
    }
View Full Code Here

            if ( isNull() )
                return "null date";
            else {
                final StringBuilder sb = new StringBuilder();
                final Formatter formatter = new Formatter(sb, Locale.US);
                formatter.format("%02d/%02d/%4d", month().value(), dayOfMonth(), year());
                return sb.toString();
            }
        }
    }
View Full Code Here

            if ( isNull() )
                return "null date";
            else {
                final StringBuilder sb = new StringBuilder();
                final Formatter formatter = new Formatter(sb, Locale.US);
                formatter.format("%04d-%02d-%02d", year(), month().value(), dayOfMonth());
                return sb.toString();
            }
        }
    }
View Full Code Here

    }

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

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

      if (useLevel) {
        String levelName = lookup.getLevelName(this);
        if (levelName.length() != 0) {
          if (lookup.isLayer(this))
            f.format("_%s_layer", lookup.getLevelName(this));
           else
            f.format("_%s", lookup.getLevelName(this));
        }
      }
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.