2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2011-2011 - DIGITEO - Sylvestre LEDRU
4 * Copyright (C) 2012 - Scilab Enterprises - Sylvestre LEDRU
6 * This file must be used under the terms of the CeCILL.
7 * This source file is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at
10 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
14 package org.scilab.modules.types;
16 import org.scilab.modules.localization.Messages;
18 public class ScilabTypeEnumDescription {
20 public static String getTypeDescriptionFromId(int type) {
22 switch (ScilabTypeEnum.swigToEnum(type)) {
24 return Messages.gettext("Double");
26 return Messages.gettext("Polynomial");
28 return Messages.gettext("Boolean");
30 return Messages.gettext("Sparse");
31 case sci_boolean_sparse:
32 return Messages.gettext("Boolean Sparse");
33 case sci_matlab_sparse:
34 return Messages.gettext("Matlab Sparse");
36 return Messages.gettext("Integer");
38 return Messages.gettext("Graphic handle");
40 return Messages.gettext("String");
42 return Messages.gettext("User function");
44 return Messages.gettext("Compiled function");
46 return Messages.gettext("Function library");
48 return Messages.gettext("List");
50 return Messages.gettext("Tlist");
52 return Messages.gettext("Mlist");
54 return Messages.gettext("Pointer");
55 case sci_implicit_poly:
56 return Messages.gettext("Implicit polynomial");
57 case sci_intrinsic_function:
58 return Messages.gettext("Intrinsic function");
60 return Messages.gettext("Unknown datatype");
62 } catch (IllegalArgumentException e) {
63 return Messages.gettext("Unknown datatype");
68 * Return the description of the mlist code ('ce' => 'cell', 'st => 'struct', etc)
69 * @param shortCode the short code
70 * @return the full description
72 public static String getListTypeDescription (String shortCode) {
73 // Once we switch to Java 7, we can replace that by a String switch
74 if (shortCode.equals("ce")) {
77 if (shortCode.equals("st")) {
80 if (shortCode.equals("fptr")) {
81 shortCode = "built-in";