-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathTimeUtils.java
More file actions
61 lines (47 loc) · 1.9 KB
/
TimeUtils.java
File metadata and controls
61 lines (47 loc) · 1.9 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package org.anddev.andengine.util;
import org.anddev.andengine.util.constants.TimeConstants;
/**
* (c) 2010 Nicolas Gramlich
* (c) 2011 Zynga Inc.
*
* @author Nicolas Gramlich
* @since 22:48:49 - 04.04.2011
*/
public class TimeUtils implements TimeConstants {
// ===========================================================
// Constants
// ===========================================================
private TimeUtils() {}
// ===========================================================
// Fields
// ===========================================================
// ===========================================================
// Constructors
// ===========================================================
// ===========================================================
// Getter & Setter
// ===========================================================
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
// ===========================================================
// Methods
// ===========================================================
public static String formatSeconds(final int pSecondsTotal) {
return formatSeconds(pSecondsTotal, new StringBuilder());
}
public static String formatSeconds(final int pSecondsTotal, final StringBuilder pStringBuilder) {
final int minutes = pSecondsTotal / SECONDSPERMINUTE;
final int seconds = pSecondsTotal % SECONDSPERMINUTE;
pStringBuilder.append(minutes);
pStringBuilder.append(':');
if(seconds < 10) {
pStringBuilder.append('0');
}
pStringBuilder.append(seconds);
return pStringBuilder.toString();
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
}