X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2FuserComponent%2FTypeConversion.java;h=b0adaa88efaf9e4c90f44ac2a0588a76b3ec930e;hb=8c029a9e23802007d0c9701fbfbcca7e6cc16b03;hp=274e65bb8e401d55cb45d0f7e00bde9995cdec71;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/userComponent/TypeConversion.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/userComponent/TypeConversion.java index 274e65bb8..b0adaa88e 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/userComponent/TypeConversion.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/userComponent/TypeConversion.java @@ -1,49 +1,49 @@ -/******************************************************************************* - * Copyright (c) 2012 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.modeling.userComponent; - -import gnu.trove.map.hash.THashMap; - -import org.simantics.databoard.Datatypes; -import org.simantics.databoard.type.ArrayType; -import org.simantics.databoard.type.Datatype; - -public class TypeConversion { - - private static final THashMap CONVERSION_MAP = - new THashMap(); - - private static void add(String sclType, Datatype dataType) { - CONVERSION_MAP.put(sclType, dataType); - CONVERSION_MAP.put("[" + sclType + "]", new ArrayType(dataType)); - CONVERSION_MAP.put("Array " + sclType, new ArrayType(dataType)); - CONVERSION_MAP.put("Vector " + sclType, new ArrayType(dataType)); - } - - static { - add("Boolean", Datatypes.BOOLEAN); - add("Integer", Datatypes.INTEGER); - add("Long", Datatypes.LONG); - add("Float", Datatypes.FLOAT); - add("Double", Datatypes.DOUBLE); - add("String", Datatypes.STRING); - } - - /** - * This is a workaround solution currently for converting SCL types - * to datatypes. - */ - public static Datatype convertSCLTypeToDatatype(String type) { - return CONVERSION_MAP.get(type); - } - -} +/******************************************************************************* + * Copyright (c) 2012 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.modeling.userComponent; + +import gnu.trove.map.hash.THashMap; + +import org.simantics.databoard.Datatypes; +import org.simantics.databoard.type.ArrayType; +import org.simantics.databoard.type.Datatype; + +public class TypeConversion { + + private static final THashMap CONVERSION_MAP = + new THashMap(); + + private static void add(String sclType, Datatype dataType) { + CONVERSION_MAP.put(sclType, dataType); + CONVERSION_MAP.put("[" + sclType + "]", new ArrayType(dataType)); + CONVERSION_MAP.put("Array " + sclType, new ArrayType(dataType)); + CONVERSION_MAP.put("Vector " + sclType, new ArrayType(dataType)); + } + + static { + add("Boolean", Datatypes.BOOLEAN); + add("Integer", Datatypes.INTEGER); + add("Long", Datatypes.LONG); + add("Float", Datatypes.FLOAT); + add("Double", Datatypes.DOUBLE); + add("String", Datatypes.STRING); + } + + /** + * This is a workaround solution currently for converting SCL types + * to datatypes. + */ + public static Datatype convertSCLTypeToDatatype(String type) { + return CONVERSION_MAP.get(type); + } + +}