Package java.util

Examples of java.util.Formatter.format()


  }

  @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));
      }
View Full Code Here


  @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));
      }
    }
View Full Code Here

    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();
  }

  /**
   * Get a CacheDirectory from the path. If not in cache, read OS and put in cache.
View Full Code Here

    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


    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;
View Full Code Here

public class NumberRenderer implements AttributeRenderer {
    public String toString(Object o, String formatString, Locale locale) {
        // o will be instanceof Number
        if ( formatString==null ) return o.toString();
        Formatter f = new Formatter(locale);
        f.format(formatString, o);
        return f.toString();
    }
}
View Full Code Here

        try
        {
            Formatter formatter = new Formatter(builder);

            formatter.format("%s %s extends %s", Modifier.toString(ctClass.getModifiers()), ctClass.getName(), ctClass
                    .getSuperclass().getName());

            CtClass[] interfaces = ctClass.getInterfaces();

            for (int i = 0; i < interfaces.length; i++)
View Full Code Here

                builder.append(interfaces[i].getName());
            }

            if (description != null)
                formatter.format("\n\n%s", description.toString());
        }
        catch (NotFoundException ex)
        {
            builder.append(ex);
        }
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.