blob: 7281f3cd9d613186d8595ec39294c366db4a723c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.text;
/**
* Utility class to format a double into a String.
* <p>
* This was intended as a lower-cost replacement for the standard
* String.valueOf(double) since that method used to cause contention.
* <p>
* The contention issue is fixed in Java 8u96 so this class is now obsolete.
*
* @author arnej27959
*/
@Deprecated
public final class DoubleFormatter {
public static StringBuilder fmt(StringBuilder target, double v) {
target.append(v);
return target;
}
public static String stringValue(double v) {
return String.valueOf(v);
}
public static void append(StringBuilder s, double d) {
s.append(d);
}
public static void append(StringBuilder s, int i) {
s.append(i);
}
}
|