X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.trend%2Fexample%2Forg%2Fsimantics%2Ftrend%2FTestTimeFormat.java;h=4c48e6de3a378c325bcfa87a5ddbfc733aa549a2;hb=6fe905dfb156d33eecf37d3748864db9e0868e06;hp=2148d142287e60c2df97eb976b1d1070c624b5f3;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.trend/example/org/simantics/trend/TestTimeFormat.java b/bundles/org.simantics.trend/example/org/simantics/trend/TestTimeFormat.java index 2148d1422..4c48e6de3 100644 --- a/bundles/org.simantics.trend/example/org/simantics/trend/TestTimeFormat.java +++ b/bundles/org.simantics.trend/example/org/simantics/trend/TestTimeFormat.java @@ -1,171 +1,171 @@ -/******************************************************************************* - * 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