public class TypeUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_BYTE
Deprecated.
use
DataType.BYTE instead |
static int |
TYPE_DOUBLE
Deprecated.
use
DataType.DOUBLE instead |
static int |
TYPE_FLOAT
Deprecated.
use
DataType.FLOAT instead |
static int |
TYPE_INT
Deprecated.
use
DataType.INT instead |
static int |
TYPE_SHORT
Deprecated.
use
DataType.SHORT instead |
static int |
TYPE_UNDEFINED
Deprecated.
use
DataType.UNDEFINED instead |
Constructor and Description |
---|
TypeUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
dataBufferTypeToDataType(int dataBufferType)
Deprecated.
use
DataType.getDataTypeFromDataBufferType(int) instead |
static ome.xml.model.enums.PixelType |
dataTypeToPixelType(int dataType,
boolean signed)
Deprecated.
use
DataType.toPixelType() instead |
static int |
formatToolsTypeToDataType(int type)
Deprecated.
use
DataType.getDataTypeFromFormatToolsType(int) instead |
static int |
getDataType(java.lang.Object value)
Deprecated.
use
ArrayUtil.getDataType(Object) method instead |
static int |
getDataType(java.lang.String value)
Deprecated.
use
DataType.getDataType(String) method instead |
static double[] |
getDefaultBounds(int dataType,
boolean signed)
Deprecated.
use
DataType.getDefaultBounds() instead |
static double |
getDouble(java.lang.Double obj,
double defaultValue)
Safe double evaluation from Double object.
|
static double |
getDouble(java.lang.Double obj,
double defaultValue,
boolean allowInfinite)
Safe double evaluation from Double object.
|
static float |
getFloat(java.lang.Float obj,
float defaultValue)
Safe float evaluation from Float object.
|
static int |
getInt(java.lang.Integer obj,
int defaultValue)
Safe integer evaluation from Integer object.
|
static java.lang.String[] |
getItems(boolean longString,
boolean wantUndef)
Deprecated.
use
DataType.getItems(boolean, boolean, boolean) instead |
static double |
getMaxValue(int dataType,
boolean signed)
Deprecated.
use
DataType.getMaxValue() instead |
static double |
getMinValue(int dataType,
boolean signed)
Deprecated.
use
DataType.getMinValue() instead |
static int |
getNumDimension(java.lang.Object value)
Deprecated.
use
ArrayUtil.getDim(Object) method instead |
static ArrayTypeInfo |
getTypeInfo(java.lang.Object value)
Deprecated.
use
ArrayDataType.getArrayDataType(Object) instead |
static boolean |
isFloat(int dataType)
Deprecated.
use
DataType method instead |
static boolean |
isSignedDataBufferType(int type)
Return true if specified DataBuffer type is considered as signed type
|
static boolean |
isSignedFormatToolsType(int type)
Return true if specified FormatTools type is a signed type
|
static boolean |
isSignedPixelType(ome.xml.model.enums.PixelType type)
Return true if specified PixelType is signed
|
static int |
pixelTypeToDataType(ome.xml.model.enums.PixelType type)
Deprecated.
use
DataType.getDataTypeFromPixelType(PixelType) instead |
static int |
sizeOf(int dataType)
Deprecated.
use
DataType method instead |
static java.awt.Dimension |
toDimension(java.awt.Point p) |
static double |
toDouble(byte value,
boolean signed) |
static double |
toDouble(int value,
boolean signed) |
static double |
toDouble(long value,
boolean signed) |
static double |
toDouble(short value,
boolean signed) |
static float |
toFloat(byte value,
boolean signed) |
static float |
toFloat(int value,
boolean signed) |
static float |
toFloat(long value,
boolean signed) |
static float |
toFloat(short value,
boolean signed) |
static int |
toInt(byte value,
boolean signed) |
static int |
toInt(double value) |
static int |
toInt(float value) |
static int |
toInt(short value,
boolean signed) |
static long |
toLong(byte value,
boolean signed) |
static long |
toLong(double value) |
static long |
toLong(float value) |
static long |
toLong(int value,
boolean signed) |
static long |
toLong(short value,
boolean signed) |
static java.lang.String |
toLongString(int dataType)
Deprecated.
use
DataType method instead |
static java.lang.String |
toLongString(int dataType,
boolean signed) |
static java.awt.Point |
toPoint(java.awt.Dimension d) |
static java.awt.Point[] |
toPoint(int[] input)
Create an array of Point from the input integer array.
|
static java.awt.Point |
toPoint(java.awt.geom.Point2D p) |
static java.awt.geom.Point2D.Double |
toPoint2D(java.awt.Dimension d) |
static java.awt.geom.Point2D.Double |
toPoint2D(java.awt.Point p) |
static int |
toShort(byte value,
boolean signed) |
static java.lang.String |
toString(boolean signed) |
static java.lang.String |
toString(int dataType)
Deprecated.
use
DataType method instead |
static java.lang.String |
toString(int dataType,
boolean signed) |
static int |
unsign(byte value)
Unsign the specified byte value and return it as int
|
static long |
unsign(int value)
Unsign the specified int value and return it as long
|
static double |
unsign(long value)
Unsign the specified long value and return it as double (possible information loss)
|
static int |
unsign(short value)
Unsign the specified short value and return it as int
|
static float |
unsignF(long value)
Unsign the specified long value and return it as float (possible information loss)
|
static long |
unsignL(byte value)
Unsign the specified byte value and return it as long
|
static long |
unsignL(short value)
Unsign the specified short value and return it as long
|
@Deprecated public static final int TYPE_BYTE
DataType.BYTE
instead@Deprecated public static final int TYPE_SHORT
DataType.SHORT
instead@Deprecated public static final int TYPE_INT
DataType.INT
instead@Deprecated public static final int TYPE_FLOAT
DataType.FLOAT
instead@Deprecated public static final int TYPE_DOUBLE
DataType.DOUBLE
instead@Deprecated public static final int TYPE_UNDEFINED
DataType.UNDEFINED
insteadpublic TypeUtil()
@Deprecated public static int sizeOf(int dataType)
DataType
method instead@Deprecated public static boolean isFloat(int dataType)
DataType
method instead@Deprecated public static java.lang.String toLongString(int dataType)
DataType
method instead@Deprecated public static java.lang.String toString(int dataType)
DataType
method insteadpublic static java.lang.String toLongString(int dataType, boolean signed)
public static java.lang.String toString(int dataType, boolean signed)
public static java.lang.String toString(boolean signed)
@Deprecated public static java.lang.String[] getItems(boolean longString, boolean wantUndef)
DataType.getItems(boolean, boolean, boolean)
instead@Deprecated public static ArrayTypeInfo getTypeInfo(java.lang.Object value)
ArrayDataType.getArrayDataType(Object)
instead@Deprecated public static int getDataType(java.lang.Object value)
ArrayUtil.getDataType(Object)
method instead@Deprecated public static int getNumDimension(java.lang.Object value)
ArrayUtil.getDim(Object)
method instead@Deprecated public static int getDataType(java.lang.String value)
DataType.getDataType(String)
method instead@Deprecated public static int dataBufferTypeToDataType(int dataBufferType)
DataType.getDataTypeFromDataBufferType(int)
insteadpublic static boolean isSignedDataBufferType(int type)
@Deprecated public static int formatToolsTypeToDataType(int type)
DataType.getDataTypeFromFormatToolsType(int)
insteadpublic static boolean isSignedFormatToolsType(int type)
@Deprecated public static int pixelTypeToDataType(ome.xml.model.enums.PixelType type)
DataType.getDataTypeFromPixelType(PixelType)
insteadpublic static boolean isSignedPixelType(ome.xml.model.enums.PixelType type)
@Deprecated public static ome.xml.model.enums.PixelType dataTypeToPixelType(int dataType, boolean signed)
DataType.toPixelType()
insteadpublic static int unsign(byte value)
public static int unsign(short value)
public static long unsignL(byte value)
public static long unsignL(short value)
public static long unsign(int value)
public static double unsign(long value)
public static float unsignF(long value)
public static int toShort(byte value, boolean signed)
public static int toInt(byte value, boolean signed)
public static int toInt(short value, boolean signed)
public static int toInt(float value)
public static int toInt(double value)
public static long toLong(byte value, boolean signed)
public static long toLong(short value, boolean signed)
public static long toLong(int value, boolean signed)
public static long toLong(float value)
public static long toLong(double value)
public static float toFloat(byte value, boolean signed)
public static float toFloat(short value, boolean signed)
public static float toFloat(int value, boolean signed)
public static float toFloat(long value, boolean signed)
public static double toDouble(byte value, boolean signed)
public static double toDouble(short value, boolean signed)
public static double toDouble(int value, boolean signed)
public static double toDouble(long value, boolean signed)
public static int getInt(java.lang.Integer obj, int defaultValue)
defaultValue
if specified object is null.public static float getFloat(java.lang.Float obj, float defaultValue)
defaultValue
if specified object is null.public static double getDouble(java.lang.Double obj, double defaultValue, boolean allowInfinite)
defaultValue
if obj
is null or equal to infinite with
allowInfinite
set to false.public static double getDouble(java.lang.Double obj, double defaultValue)
defaultValue
if specified object is null.public static java.awt.Point toPoint(java.awt.geom.Point2D p)
public static java.awt.geom.Point2D.Double toPoint2D(java.awt.Point p)
public static java.awt.Point toPoint(java.awt.Dimension d)
public static java.awt.geom.Point2D.Double toPoint2D(java.awt.Dimension d)
public static java.awt.Dimension toDimension(java.awt.Point p)
public static java.awt.Point[] toPoint(int[] input)
input.lenght
= number of point * 2.input[(pt * 2) + 0]
= X coordinate for point ptinput[(pt * 2) + 1]
= Y coordinate for point pt@Deprecated public static double getMinValue(int dataType, boolean signed)
DataType.getMinValue()
instead@Deprecated public static double getMaxValue(int dataType, boolean signed)
DataType.getMaxValue()
instead@Deprecated public static double[] getDefaultBounds(int dataType, boolean signed)
DataType.getDefaultBounds()
instead