001/* 002 * Copyright 2010-2015 Institut Pasteur. 003 * 004 * This file is part of Icy. 005 * 006 * Icy is free software: you can redistribute it and/or modify 007 * it under the terms of the GNU General Public License as published by 008 * the Free Software Foundation, either version 3 of the License, or 009 * (at your option) any later version. 010 * 011 * Icy is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU General Public License for more details. 015 * 016 * You should have received a copy of the GNU General Public License 017 * along with Icy. If not, see <http://www.gnu.org/licenses/>. 018 */ 019package icy.type; 020 021import icy.math.MathUtil; 022import icy.type.collection.array.ArrayDataType; 023import icy.type.collection.array.ArrayUtil; 024 025import java.awt.Dimension; 026import java.awt.Point; 027import java.awt.geom.Point2D; 028import java.awt.image.DataBuffer; 029 030import loci.formats.FormatTools; 031import ome.xml.model.enums.PixelType; 032 033/** 034 * @author stephane 035 */ 036public class TypeUtil 037{ 038 /** 039 * Tag for byte data (use DataBuffer reference) 040 * 041 * @deprecated use {@link DataType#BYTE} instead 042 */ 043 @Deprecated 044 public static final int TYPE_BYTE = DataBuffer.TYPE_BYTE; 045 046 /** 047 * Tag for short data (use DataBuffer reference) 048 * 049 * @deprecated use {@link DataType#SHORT} instead 050 */ 051 @Deprecated 052 public static final int TYPE_SHORT = DataBuffer.TYPE_SHORT; 053 054 /** 055 * Tag for int data (use DataBuffer reference) 056 * 057 * @deprecated use {@link DataType#INT} instead 058 */ 059 @Deprecated 060 public static final int TYPE_INT = DataBuffer.TYPE_INT; 061 062 /** 063 * Tag for float data (use DataBuffer reference) 064 * 065 * @deprecated use {@link DataType#FLOAT} instead 066 */ 067 @Deprecated 068 public static final int TYPE_FLOAT = DataBuffer.TYPE_FLOAT; 069 070 /** 071 * Tag for double data (use DataBuffer reference) 072 * 073 * @deprecated use {@link DataType#DOUBLE} instead 074 */ 075 @Deprecated 076 public static final int TYPE_DOUBLE = DataBuffer.TYPE_DOUBLE; 077 078 /** 079 * Tag for undefined data (use DataBuffer reference) 080 * 081 * @deprecated use {@link DataType#UNDEFINED} instead 082 */ 083 @Deprecated 084 public static final int TYPE_UNDEFINED = DataBuffer.TYPE_UNDEFINED; 085 086 /** 087 * Return the size (in byte) of the specified dataType 088 * 089 * @deprecated use {@link DataType} method instead 090 */ 091 @Deprecated 092 public static int sizeOf(int dataType) 093 { 094 switch (dataType) 095 { 096 case TYPE_BYTE: 097 return 1; 098 case TYPE_SHORT: 099 return 2; 100 case TYPE_INT: 101 return 4; 102 case TYPE_FLOAT: 103 return 4; 104 case TYPE_DOUBLE: 105 return 8; 106 } 107 108 return 0; 109 } 110 111 /** 112 * Return true if specified dataType is a float type 113 * 114 * @deprecated use {@link DataType} method instead 115 */ 116 @Deprecated 117 public static boolean isFloat(int dataType) 118 { 119 return (dataType == TYPE_FLOAT) || (dataType == TYPE_DOUBLE); 120 } 121 122 /** 123 * Convert dataType to String 124 * 125 * @deprecated use {@link DataType} method instead 126 */ 127 @Deprecated 128 public static String toLongString(int dataType) 129 { 130 switch (dataType) 131 { 132 case TYPE_BYTE: 133 return "byte (8 bpp)"; 134 case TYPE_SHORT: 135 return "short (16 bpp)"; 136 case TYPE_INT: 137 return "int (32 bpp)"; 138 case TYPE_FLOAT: 139 return "float (32 bbp)"; 140 case TYPE_DOUBLE: 141 return "double (64 bbp)"; 142 } 143 144 return "undefined"; 145 } 146 147 /** 148 * convert dataType to String 149 * 150 * @deprecated use {@link DataType} method instead 151 */ 152 @Deprecated 153 public static String toString(int dataType) 154 { 155 switch (dataType) 156 { 157 case TYPE_BYTE: 158 return "byte"; 159 case TYPE_SHORT: 160 return "short"; 161 case TYPE_INT: 162 return "int"; 163 case TYPE_FLOAT: 164 return "float"; 165 case TYPE_DOUBLE: 166 return "double"; 167 } 168 169 return "undefined"; 170 } 171 172 public static String toLongString(int dataType, boolean signed) 173 { 174 if (isFloat(dataType)) 175 return toLongString(dataType); 176 177 return toString(signed) + " " + toLongString(dataType); 178 } 179 180 public static String toString(int dataType, boolean signed) 181 { 182 if (isFloat(dataType)) 183 return toString(dataType); 184 185 return toString(signed) + " " + toString(dataType); 186 } 187 188 public static String toString(boolean signed) 189 { 190 if (signed) 191 return "signed"; 192 193 return "unsigned"; 194 } 195 196 /** 197 * Return all data type as String items (can be used for ComboBox) 198 * 199 * @deprecated use {@link DataType#getItems(boolean, boolean, boolean)} instead 200 */ 201 @Deprecated 202 public static String[] getItems(boolean longString, boolean wantUndef) 203 { 204 final String[] result; 205 206 if (wantUndef) 207 result = new String[6]; 208 else 209 result = new String[5]; 210 211 if (longString) 212 { 213 result[0] = toLongString(TYPE_BYTE); 214 result[1] = toLongString(TYPE_SHORT); 215 result[2] = toLongString(TYPE_INT); 216 result[3] = toLongString(TYPE_FLOAT); 217 result[4] = toLongString(TYPE_DOUBLE); 218 if (wantUndef) 219 result[5] = toLongString(TYPE_UNDEFINED); 220 } 221 else 222 { 223 result[0] = toString(TYPE_BYTE); 224 result[1] = toString(TYPE_SHORT); 225 result[2] = toString(TYPE_INT); 226 result[3] = toString(TYPE_FLOAT); 227 result[4] = toString(TYPE_DOUBLE); 228 if (wantUndef) 229 result[5] = toString(TYPE_UNDEFINED); 230 } 231 232 return result; 233 } 234 235 /** 236 * Return the dataType of specified array (passed as Object) 237 * 238 * @deprecated use {@link ArrayDataType#getArrayDataType(Object)} instead 239 */ 240 @Deprecated 241 public static ArrayTypeInfo getTypeInfo(Object value) 242 { 243 final ArrayTypeInfo result = new ArrayTypeInfo(TYPE_UNDEFINED, 0); 244 245 if (value instanceof byte[]) 246 { 247 result.type = TYPE_BYTE; 248 result.dim = 1; 249 } 250 else if (value instanceof short[]) 251 { 252 result.type = TYPE_SHORT; 253 result.dim = 1; 254 } 255 else if (value instanceof int[]) 256 { 257 result.type = TYPE_INT; 258 result.dim = 1; 259 } 260 else if (value instanceof float[]) 261 { 262 result.type = TYPE_FLOAT; 263 result.dim = 1; 264 } 265 else if (value instanceof double[]) 266 { 267 result.type = TYPE_DOUBLE; 268 result.dim = 1; 269 } 270 else if (value instanceof byte[][]) 271 { 272 result.type = TYPE_BYTE; 273 result.dim = 2; 274 } 275 else if (value instanceof short[][]) 276 { 277 result.type = TYPE_SHORT; 278 result.dim = 2; 279 } 280 else if (value instanceof int[][]) 281 { 282 result.type = TYPE_INT; 283 result.dim = 2; 284 } 285 else if (value instanceof float[][]) 286 { 287 result.type = TYPE_FLOAT; 288 result.dim = 2; 289 } 290 else if (value instanceof double[][]) 291 { 292 result.type = TYPE_DOUBLE; 293 result.dim = 2; 294 } 295 else if (value instanceof byte[][][]) 296 { 297 result.type = TYPE_BYTE; 298 result.dim = 3; 299 } 300 else if (value instanceof short[][][]) 301 { 302 result.type = TYPE_SHORT; 303 result.dim = 3; 304 } 305 else if (value instanceof int[][][]) 306 { 307 result.type = TYPE_INT; 308 result.dim = 3; 309 } 310 else if (value instanceof float[][][]) 311 { 312 result.type = TYPE_FLOAT; 313 result.dim = 3; 314 } 315 else if (value instanceof double[][][]) 316 { 317 result.type = TYPE_DOUBLE; 318 result.dim = 3; 319 } 320 else if (value instanceof byte[][][][]) 321 { 322 result.type = TYPE_BYTE; 323 result.dim = 4; 324 } 325 else if (value instanceof short[][][][]) 326 { 327 result.type = TYPE_SHORT; 328 result.dim = 4; 329 } 330 else if (value instanceof int[][][][]) 331 { 332 result.type = TYPE_INT; 333 result.dim = 4; 334 } 335 else if (value instanceof float[][][][]) 336 { 337 result.type = TYPE_FLOAT; 338 result.dim = 4; 339 } 340 else if (value instanceof double[][][][]) 341 { 342 result.type = TYPE_DOUBLE; 343 result.dim = 4; 344 } 345 else if (value instanceof byte[][][][][]) 346 { 347 result.type = TYPE_BYTE; 348 result.dim = 5; 349 } 350 else if (value instanceof short[][][][][]) 351 { 352 result.type = TYPE_SHORT; 353 result.dim = 5; 354 } 355 else if (value instanceof int[][][][][]) 356 { 357 result.type = TYPE_INT; 358 result.dim = 5; 359 } 360 else if (value instanceof float[][][][][]) 361 { 362 result.type = TYPE_FLOAT; 363 result.dim = 5; 364 } 365 else if (value instanceof double[][][][][]) 366 { 367 result.type = TYPE_DOUBLE; 368 result.dim = 5; 369 } 370 371 return result; 372 } 373 374 /** 375 * Return the dataType of specified array (passed as Object) 376 * 377 * @deprecated use {@link ArrayUtil#getDataType(Object)} method instead 378 */ 379 @Deprecated 380 public static int getDataType(Object value) 381 { 382 return getTypeInfo(value).type; 383 } 384 385 /** 386 * Return the number of dimension specified array (passed as Object) 387 * 388 * @deprecated use {@link ArrayUtil#getDim(Object)} method instead 389 */ 390 @Deprecated 391 public static int getNumDimension(Object value) 392 { 393 return getTypeInfo(value).dim; 394 } 395 396 /** 397 * Return the dataType from string 398 * 399 * @deprecated use {@link DataType#getDataType(String)} method instead 400 */ 401 @Deprecated 402 public static int getDataType(String value) 403 { 404 final String s = value.toLowerCase(); 405 406 if (toString(TYPE_BYTE).equals(s) || toLongString(TYPE_BYTE).equals(s)) 407 return TYPE_BYTE; 408 if (toString(TYPE_SHORT).equals(s) || toLongString(TYPE_SHORT).equals(s)) 409 return TYPE_SHORT; 410 if (toString(TYPE_INT).equals(s) || toLongString(TYPE_INT).equals(s)) 411 return TYPE_INT; 412 if (toString(TYPE_FLOAT).equals(s) || toLongString(TYPE_FLOAT).equals(s)) 413 return TYPE_FLOAT; 414 if (toString(TYPE_DOUBLE).equals(s) || toLongString(TYPE_DOUBLE).equals(s)) 415 return TYPE_DOUBLE; 416 417 return TYPE_UNDEFINED; 418 } 419 420 /** 421 * Return the dataType corresponding to the specified DataBuffer type 422 * 423 * @deprecated use {@link DataType#getDataTypeFromDataBufferType(int)} instead 424 */ 425 @Deprecated 426 public static int dataBufferTypeToDataType(int dataBufferType) 427 { 428 switch (dataBufferType) 429 { 430 case DataBuffer.TYPE_BYTE: 431 return TypeUtil.TYPE_BYTE; 432 433 case DataBuffer.TYPE_SHORT: 434 case DataBuffer.TYPE_USHORT: 435 return TypeUtil.TYPE_SHORT; 436 437 case DataBuffer.TYPE_INT: 438 return TypeUtil.TYPE_INT; 439 440 case DataBuffer.TYPE_FLOAT: 441 return TypeUtil.TYPE_FLOAT; 442 443 case DataBuffer.TYPE_DOUBLE: 444 return TypeUtil.TYPE_DOUBLE; 445 446 default: 447 return TypeUtil.TYPE_UNDEFINED; 448 } 449 } 450 451 /** 452 * Return true if specified DataBuffer type is considered as signed type 453 */ 454 public static boolean isSignedDataBufferType(int type) 455 { 456 switch (type) 457 { 458 case DataBuffer.TYPE_BYTE: 459 // assume byte is unsigned 460 return false; 461 462 case DataBuffer.TYPE_SHORT: 463 return true; 464 465 case DataBuffer.TYPE_USHORT: 466 return false; 467 468 case DataBuffer.TYPE_INT: 469 // assume int is unsigned 470 return false; 471 472 case DataBuffer.TYPE_FLOAT: 473 return true; 474 475 case DataBuffer.TYPE_DOUBLE: 476 return true; 477 478 default: 479 return false; 480 } 481 } 482 483 /** 484 * Return the data type corresponding to the specified FormatTools type 485 * 486 * @deprecated use {@link DataType#getDataTypeFromFormatToolsType(int)} instead 487 */ 488 @Deprecated 489 public static int formatToolsTypeToDataType(int type) 490 { 491 switch (type) 492 { 493 case FormatTools.INT8: 494 case FormatTools.UINT8: 495 return TypeUtil.TYPE_BYTE; 496 497 case FormatTools.INT16: 498 case FormatTools.UINT16: 499 return TypeUtil.TYPE_SHORT; 500 501 case FormatTools.INT32: 502 case FormatTools.UINT32: 503 return TypeUtil.TYPE_INT; 504 505 case FormatTools.FLOAT: 506 return TypeUtil.TYPE_FLOAT; 507 508 case FormatTools.DOUBLE: 509 return TypeUtil.TYPE_DOUBLE; 510 511 default: 512 return TypeUtil.TYPE_UNDEFINED; 513 } 514 } 515 516 /** 517 * Return true if specified FormatTools type is a signed type 518 */ 519 public static boolean isSignedFormatToolsType(int type) 520 { 521 switch (type) 522 { 523 case FormatTools.INT8: 524 case FormatTools.INT16: 525 case FormatTools.INT32: 526 case FormatTools.FLOAT: 527 case FormatTools.DOUBLE: 528 return true; 529 530 case FormatTools.UINT8: 531 case FormatTools.UINT16: 532 case FormatTools.UINT32: 533 return false; 534 535 default: 536 return false; 537 } 538 } 539 540 /** 541 * Return the dataType corresponding to the specified PixelType 542 * 543 * @deprecated use {@link DataType#getDataTypeFromPixelType(PixelType)} instead 544 */ 545 @Deprecated 546 public static int pixelTypeToDataType(PixelType type) 547 { 548 switch (type) 549 { 550 case INT8: 551 case UINT8: 552 return TypeUtil.TYPE_BYTE; 553 554 case INT16: 555 case UINT16: 556 return TypeUtil.TYPE_SHORT; 557 558 case INT32: 559 case UINT32: 560 return TypeUtil.TYPE_INT; 561 562 case FLOAT: 563 return TypeUtil.TYPE_FLOAT; 564 565 case DOUBLE: 566 return TypeUtil.TYPE_DOUBLE; 567 568 default: 569 return TypeUtil.TYPE_UNDEFINED; 570 } 571 } 572 573 /** 574 * Return true if specified PixelType is signed 575 */ 576 public static boolean isSignedPixelType(PixelType type) 577 { 578 switch (type) 579 { 580 case INT8: 581 case INT16: 582 case INT32: 583 case FLOAT: 584 case DOUBLE: 585 return true; 586 587 case UINT8: 588 case UINT16: 589 case UINT32: 590 return false; 591 592 default: 593 return false; 594 } 595 } 596 597 /** 598 * Return the PixelType corresponding to the specified data type 599 * 600 * @deprecated use {@link DataType#toPixelType()} instead 601 */ 602 @Deprecated 603 public static PixelType dataTypeToPixelType(int dataType, boolean signed) 604 { 605 switch (dataType) 606 { 607 case TypeUtil.TYPE_BYTE: 608 if (signed) 609 return PixelType.INT8; 610 return PixelType.UINT8; 611 612 case TypeUtil.TYPE_SHORT: 613 if (signed) 614 return PixelType.INT16; 615 return PixelType.UINT16; 616 617 case TypeUtil.TYPE_FLOAT: 618 return PixelType.FLOAT; 619 620 case TypeUtil.TYPE_DOUBLE: 621 return PixelType.DOUBLE; 622 623 default: 624 if (signed) 625 return PixelType.INT32; 626 return PixelType.UINT32; 627 } 628 } 629 630 /** 631 * Unsign the specified byte value and return it as int 632 */ 633 public static int unsign(byte value) 634 { 635 return value & 0xFF; 636 } 637 638 /** 639 * Unsign the specified short value and return it as int 640 */ 641 public static int unsign(short value) 642 { 643 return value & 0xFFFF; 644 } 645 646 /** 647 * Unsign the specified byte value and return it as long 648 */ 649 public static long unsignL(byte value) 650 { 651 return value & 0xFFL; 652 } 653 654 /** 655 * Unsign the specified short value and return it as long 656 */ 657 public static long unsignL(short value) 658 { 659 return value & 0xFFFFL; 660 } 661 662 /** 663 * Unsign the specified int value and return it as long 664 */ 665 public static long unsign(int value) 666 { 667 return value & 0xFFFFFFFFL; 668 } 669 670 /** 671 * Unsign the specified long value and return it as double (possible information loss) 672 */ 673 public static double unsign(long value) 674 { 675 final double result = value; 676 if (result < 0d) 677 return MathUtil.POW2_64_DOUBLE + result; 678 679 return result; 680 } 681 682 /** 683 * Unsign the specified long value and return it as float (possible information loss) 684 */ 685 public static float unsignF(long value) 686 { 687 final float result = value; 688 if (result < 0f) 689 return MathUtil.POW2_64_FLOAT + result; 690 691 return result; 692 } 693 694 public static int toShort(byte value, boolean signed) 695 { 696 if (signed) 697 return value; 698 699 return unsign(value); 700 } 701 702 public static int toInt(byte value, boolean signed) 703 { 704 if (signed) 705 return value; 706 707 return unsign(value); 708 } 709 710 public static int toInt(short value, boolean signed) 711 { 712 if (signed) 713 return value; 714 715 return unsign(value); 716 } 717 718 public static int toInt(float value) 719 { 720 // we have to cast to long before else value is limited to 721 // [Integer.MIN_VALUE..Integer.MAX_VALUE] range 722 return (int) (long) value; 723 } 724 725 public static int toInt(double value) 726 { 727 // we have to cast to long before else value is limited to 728 // [Integer.MIN_VALUE..Integer.MAX_VALUE] range 729 return (int) (long) value; 730 } 731 732 public static long toLong(byte value, boolean signed) 733 { 734 if (signed) 735 return value; 736 737 return unsignL(value); 738 } 739 740 public static long toLong(short value, boolean signed) 741 { 742 if (signed) 743 return value; 744 745 return unsignL(value); 746 } 747 748 public static long toLong(int value, boolean signed) 749 { 750 if (signed) 751 return value; 752 753 return unsign(value); 754 } 755 756 public static long toLong(float value) 757 { 758 // handle unsigned long type (else value is clamped to Long.MAX_VALUE) 759 if (value > DataType.LONG_MAX_VALUE_F) 760 return ((long) (value - DataType.LONG_MAX_VALUE_F)) + 0x8000000000000000L; 761 762 return (long) value; 763 } 764 765 public static long toLong(double value) 766 { 767 // handle unsigned long type (else value is clamped to Long.MAX_VALUE) 768 if (value > DataType.LONG_MAX_VALUE) 769 return ((long) (value - DataType.LONG_MAX_VALUE)) + 0x8000000000000000L; 770 771 return (long) value; 772 } 773 774 public static float toFloat(byte value, boolean signed) 775 { 776 if (signed) 777 return value; 778 779 return unsign(value); 780 } 781 782 public static float toFloat(short value, boolean signed) 783 { 784 if (signed) 785 return value; 786 787 return unsign(value); 788 } 789 790 public static float toFloat(int value, boolean signed) 791 { 792 if (signed) 793 return value; 794 795 return unsign(value); 796 } 797 798 public static float toFloat(long value, boolean signed) 799 { 800 if (signed) 801 return value; 802 803 return unsignF(value); 804 } 805 806 public static double toDouble(byte value, boolean signed) 807 { 808 if (signed) 809 return value; 810 811 return unsign(value); 812 } 813 814 public static double toDouble(short value, boolean signed) 815 { 816 if (signed) 817 return value; 818 819 return unsign(value); 820 } 821 822 public static double toDouble(int value, boolean signed) 823 { 824 if (signed) 825 return value; 826 827 return unsign(value); 828 } 829 830 public static double toDouble(long value, boolean signed) 831 { 832 if (signed) 833 return value; 834 835 return unsign(value); 836 } 837 838 /** 839 * Safe integer evaluation from Integer object.<br> 840 * Return <code>defaultValue</code> if specified object is null. 841 */ 842 public static int getInt(Integer obj, int defaultValue) 843 { 844 if (obj == null) 845 return defaultValue; 846 847 return obj.intValue(); 848 } 849 850 /** 851 * Safe float evaluation from Float object.<br> 852 * Return <code>defaultValue</code> if specified object is null. 853 */ 854 public static float getFloat(Float obj, float defaultValue) 855 { 856 if (obj == null) 857 return defaultValue; 858 859 return obj.floatValue(); 860 } 861 862 /** 863 * Safe double evaluation from Double object.<br> 864 * Return <code>defaultValue</code> if <code>obj</code> is null or equal to infinite with 865 * <code>allowInfinite</code> set to false. 866 */ 867 public static double getDouble(Double obj, double defaultValue, boolean allowInfinite) 868 { 869 if (obj == null) 870 return defaultValue; 871 872 final double result = obj.doubleValue(); 873 874 if ((!allowInfinite) && Double.isInfinite(result)) 875 return defaultValue; 876 877 return result; 878 } 879 880 /** 881 * Safe double evaluation from Double object.<br> 882 * Return <code>defaultValue</code> if specified object is null. 883 */ 884 public static double getDouble(Double obj, double defaultValue) 885 { 886 return getDouble(obj, defaultValue, true); 887 } 888 889 public static Point toPoint(Point2D p) 890 { 891 return new Point((int) p.getX(), (int) p.getY()); 892 } 893 894 public static Point2D.Double toPoint2D(Point p) 895 { 896 return new Point2D.Double(p.x, p.y); 897 } 898 899 public static Point toPoint(Dimension d) 900 { 901 return new Point(d.width, d.height); 902 } 903 904 public static Point2D.Double toPoint2D(Dimension d) 905 { 906 return new Point2D.Double(d.width, d.height); 907 } 908 909 public static Dimension toDimension(Point p) 910 { 911 return new Dimension(p.x, p.y); 912 } 913 914 /** 915 * Create an array of Point from the input integer array.<br> 916 * <br> 917 * The format of the input array should be as follow:<br> 918 * <code>input.lenght</code> = number of point * 2.<br> 919 * <code>input[(pt * 2) + 0]</code> = X coordinate for point <i>pt</i><br> 920 * <code>input[(pt * 2) + 1]</code> = Y coordinate for point <i>pt</i><br> 921 */ 922 public static Point[] toPoint(int[] input) 923 { 924 final Point[] result = new Point[input.length / 2]; 925 926 int pt = 0; 927 for (int i = 0; i < input.length; i += 2) 928 result[pt++] = new Point(input[i + 0], input[i + 1]); 929 930 return result; 931 } 932 933 /** 934 * Return the minimum value for the specified dataType 935 * 936 * @deprecated use {@link DataType#getMinValue()} instead 937 */ 938 @Deprecated 939 public static double getMinValue(int dataType, boolean signed) 940 { 941 return getDefaultBounds(dataType, signed)[0]; 942 } 943 944 /** 945 * Return the maximum value for the specified dataType 946 * 947 * @deprecated use {@link DataType#getMaxValue()} instead 948 */ 949 @Deprecated 950 public static double getMaxValue(int dataType, boolean signed) 951 { 952 return getDefaultBounds(dataType, signed)[1]; 953 } 954 955 /** 956 * Get the default bounds for the specified dataType 957 * 958 * @deprecated use {@link DataType#getDefaultBounds()} instead 959 */ 960 @Deprecated 961 public static double[] getDefaultBounds(int dataType, boolean signed) 962 { 963 return DataType.getDataType(dataType, signed).getDefaultBounds(); 964 } 965}