Package java.util

Examples of java.util.Formatter$FormatSpecifier


    dataset.close();
  }

  private String showShape( int[] shape) {
    Formatter f = new Formatter();
    for (int s : shape)
      f.format(" %d", s);
    return f.toString();
  }
View Full Code Here


     *
     * @see  java.util.Formatter
     * @since  1.5
     */
    public static String format(String format, Object ... args) {
  return new Formatter().format(format, args).toString();
    }
View Full Code Here

     *
     * @see  java.util.Formatter
     * @since  1.5
     */
    public static String format(Locale l, String format, Object ... args) {
  return new Formatter(l).format(format, args).toString();
    }
View Full Code Here

            throws NoSuchAlgorithmException, MalformedURLException, URISyntaxException
      {
         // buffer
         StringBuffer buffer = new StringBuffer();
         // formatter
         Formatter f = new Formatter(buffer);
         // get the bytez
         byte[] bytez = internalCreateHash(pathName);
         for(byte b : bytez)
         {
            // format the byte
            f.format("%02x", b);
         }
         // toString
         return f.toString();
      }
View Full Code Here

    return children;
  }

  @Override
  public String toString() {
    Formatter p = new Formatter();
    p.format("CacheDirector path=%s num=%d %n", getPath(), children.length);
    for (CacheFile f : children)
      p.format("  %s%n", f);
    return p.toString();
  }
View Full Code Here

    return att.get(key);
  }

  @Override
  public String toString() {
    Formatter f = new Formatter();
    f.format("CacheFile{ shortName='%s' lastModified=%d length=%d isDirectory=%s%n", shortName, lastModified, length, isDirectory);
    if (att != null ) {
      f.format(" attributes:%n");
      for (String key : att.keySet()) {
        f.format("  %s = %s %n", key, att.get(key));
      }
    }

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

  static public String show(String cacheName) {
    if (cacheManager == null) return "no cacheManager set";
    Cache cache = cacheManager.getCache(cacheName);
    if (cache == null) return "no cache named "+cacheName;
    Formatter f = new Formatter();
    f.format("Cache %s%n %s%n", cache, cache.getStatistics().toString());
    return f.toString();
  }
View Full Code Here

    dirProto.stats();

    shutdown();


    Formatter f = new Formatter(System.out);
    f.format(" Proto count = %d size = %d %n", CacheFileProto.countWrite, CacheFileProto.countWriteSize);
    int avg = CacheFileProto.countWrite == 0 ? 0 : CacheFileProto.countWriteSize / CacheFileProto.countWrite;
    f.format("       avg = %d %n", avg);
    f.flush();
  }
View Full Code Here

      if (retMessage == null) {
        retMessage = key;
      }

      Formatter formatter = new Formatter();
      formatter.format("!!! missing resource message key=[%s] args=%s", retMessage, Arrays.asList(varargs));

      retMessage = formatter.toString();
    }

    m_lastMessage = retMessage;

    return retMessage;
View Full Code Here

    }

    @Override
    public void channelDisconnected(ChannelHandlerContext ctx,
            ChannelStateEvent e) throws Exception {
        logger.info(new Formatter().format(
                "Factorial of %,d is: %,d", lastMultiplier, factorial).toString());
    }
View Full Code Here

TOP

Related Classes of java.util.Formatter$FormatSpecifier

Copyright © 2018 www.massapicom. 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.