/******************************************************************************* * 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.trend; import java.text.ParseException; import java.util.regex.Matcher; import org.simantics.utils.format.TimeFormat; public class TestTimeFormat { static void pn(double x, int s) { TimeFormat tf = new TimeFormat(x, s); System.out.println("decimals="+s+", v="+x+", time="+tf.format(x)); } static void pr(String s) throws ParseException { TimeFormat tf = new TimeFormat(1000, 3); System.out.print("\""+s+"\""); Matcher m = TimeFormat.PATTERN.matcher(s); if (m.matches()) { System.out.print(", groups="+m.groupCount()+", group={"); for (int i=0; i<=m.groupCount(); i++) { System.out.print("\""+m.group(i)+"\""); if (i