Exemplo n.º 1
0
  @SuppressWarnings({"StringConcatenationInsideStringBufferAppend"})
  private static String formatMessage(Exception e, Object message, Object[] args) {
    StringBuilder sb = new StringBuilder();

    if (message != null) sb.append(message.toString());

    if (e != null) sb.append((sb.length() > 0 ? "\n" : "") + e.toString());

    for (Object o : args) {
      if (o != null) sb.append((sb.length() > 0 ? "\n" : "") + o.toString());
    }

    return sb.toString();
  }
 public String toString() {
   StringBuilder sb = new StringBuilder();
   for (int i = 0; i < 5; i++) {
     sb.append("level ");
     sb.append(String.valueOf(i));
     sb.append(" : ");
     UTMExtremes levelExtremes = this.extremes[i];
     if (levelExtremes.minX < levelExtremes.maxX
         || !(levelExtremes.maxYHemisphere.equals(AVKey.SOUTH) && levelExtremes.maxY == 0)) {
       sb.append(levelExtremes.minX);
       sb.append(", ");
       sb.append(levelExtremes.maxX);
       sb.append(" - ");
       sb.append(levelExtremes.minY);
       sb.append(AVKey.NORTH.equals(levelExtremes.minYHemisphere) ? "N" : "S");
       sb.append(", ");
       sb.append(levelExtremes.maxY);
       sb.append(AVKey.NORTH.equals(levelExtremes.maxYHemisphere) ? "N" : "S");
     } else {
       sb.append("empty");
     }
     sb.append("\n");
   }
   return sb.toString();
 }
Exemplo n.º 3
0
 public static String getNextName(String base) {
   StringBuilder sb = new StringBuilder();
   sb.append(base);
   sb.append(nextEntryNumber++);
   return sb.toString();
 }