MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / toString

Method toString

Ports/CLDC11/src/java/time/Duration.java:73–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71 }
72
73 public String toString() {
74 StringBuffer sb = new StringBuffer("PT");
75 long absSeconds = Math.abs(seconds);
76 if (seconds < 0 && absSeconds > 0) {
77 sb.append('-');
78 }
79 sb.append(absSeconds);
80 if (nanos != 0) {
81 sb.append('.');
82 String frac = String.valueOf(1000000000L + nanos).substring(1);
83 while (frac.endsWith("0")) {
84 frac = frac.substring(0, frac.length() - 1);
85 }
86 sb.append(frac);
87 }
88 sb.append('S');
89 return sb.toString();
90 }
91}

Callers

nothing calls this directly

Calls 8

absMethod · 0.95
appendMethod · 0.95
valueOfMethod · 0.95
endsWithMethod · 0.95
substringMethod · 0.95
lengthMethod · 0.95
toStringMethod · 0.95
substringMethod · 0.65

Tested by

no test coverage detected