X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.simulation%2Fsrc%2Forg%2Fsimantics%2Fsimulation%2Fexperiment%2FSimulationTimeUtil.java;h=82fb1511c3d09e87bcc99100af6672b68d690bb5;hb=3a3626edc446b26d7acff93f9d4ce3dda2e4ad0c;hp=0877fd8c58f0a166cae0e2683ad07d3587511872;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git
diff --git a/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/SimulationTimeUtil.java b/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/SimulationTimeUtil.java
index 0877fd8c5..82fb1511c 100644
--- a/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/SimulationTimeUtil.java
+++ b/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/SimulationTimeUtil.java
@@ -1,54 +1,58 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Association for Decentralized Information Management
- * in Industry THTH ry.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VTT Technical Research Centre of Finland - initial API and implementation
- *******************************************************************************/
-package org.simantics.simulation.experiment;
-
-import java.math.RoundingMode;
-import java.text.NumberFormat;
-import java.util.Locale;
-
-import org.simantics.utils.format.TimeFormat;
-
-/**
- * @author Tuukka Lehtonen
- */
-public class SimulationTimeUtil {
-
- private static final NumberFormat secondFormatter;
- private static final TimeFormat timeFormat;
-
- static {
- secondFormatter = NumberFormat.getNumberInstance(Locale.US);
- secondFormatter.setMinimumFractionDigits(2);
- secondFormatter.setMaximumFractionDigits(3);
- secondFormatter.setRoundingMode(RoundingMode.HALF_EVEN);
-
- timeFormat = new TimeFormat(Double.MAX_VALUE, 3);
- }
-
- public static String formatSeconds(double time) {
- return secondFormatter.format(time);
- }
-
- /**
- * Formats a time specified as a double value in seconds in format
- * [Y]y [D]d hh:mm:ss.SSS
- *
- * @param time
- * @return
- */
- public static String formatHMSS(double time) {
- String result = timeFormat.format(time);
-// System.out.println("formatHMSS(" + time + "): " + result);
- return result;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.simulation.experiment;
+
+import java.math.RoundingMode;
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import org.simantics.utils.format.TimeFormat;
+
+/**
+ * @author Tuukka Lehtonen
+ */
+public class SimulationTimeUtil {
+
+ private static final NumberFormat secondFormatter;
+ private static final TimeFormat timeFormat;
+
+ static {
+ secondFormatter = NumberFormat.getNumberInstance(Locale.US);
+ secondFormatter.setMinimumFractionDigits(2);
+ secondFormatter.setMaximumFractionDigits(3);
+ secondFormatter.setRoundingMode(RoundingMode.HALF_EVEN);
+
+ timeFormat = new TimeFormat(Double.MAX_VALUE, 3);
+ }
+
+ public static String formatSeconds(double time) {
+ return secondFormatter.format(time);
+ }
+
+ /**
+ * Formats a time specified as a double value in seconds in format
+ * [Y]y [D]d hh:mm:ss.SSS
+ *
+ * @param time
+ * @return
+ */
+ public static String formatHMSS(double time) {
+ String result = timeFormat.format(time);
+// System.out.println("formatHMSS(" + time + "): " + result);
+ return result;
+ }
+
+ public static TimeFormat getTimeFormat() {
+ return timeFormat;
+ }
+
+}