枚举 DataType
- java.lang.Object
-
- java.lang.Enum<DataType>
-
- org.meteoinfo.ndarray.DataType
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classDataType.SignednessA property ofintegraldata types that determines whether they can represent both positive and negative numbers (signed), or only non-negative numbers (unsigned).
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 java.lang.ClassgetClassType()intgetNumber()Returns A unique number for each of the different built-in types.java.lang.ClassgetPrimitiveClassType()The primitive class type: char, byte, float, double, short, int, long, boolean, String, StructureData, StructureDataIterator, ByteBuffer.DataType.SignednessgetSignedness()Returns thesignednessof this data type.intgetSize()Size in bytes of one element of this data type.static DataTypegetType(java.lang.Class c)Find the DataType that matches this class.static DataTypegetType(java.lang.Class c, boolean isUnsigned)Find the DataType that matches this class.static DataTypegetType(java.lang.String name)Find the DataType that matches this name.booleanisBoolean()Is BooleanbooleanisEnum()Is this an enumeration types?booleanisFloatingPoint()Is Float or DoublebooleanisIntegral()Is Byte, Int, Short, or LongbooleanisNumeric()Is Byte, Float, Double, Int, Short, or LongbooleanisString()Is String or CharbooleanisUnsigned()Returnstrueif the data type isunsigned.static voidmain(java.lang.String[] args)java.lang.StringtoString()The DataType name, eg "byte", "float", "String".static shortunsignedByteToShort(byte b)widen an unsigned byte to a shortstatic longunsignedIntToLong(int i)widen an unsigned int to a longstatic java.lang.StringunsignedLongToString(long li)convert an unsigned long to a Stringstatic intunsignedShortToInt(short s)widen an unsigned short to an intstatic DataTypevalueOf(java.lang.String name)返回带有指定名称的该类型的枚举常量。static DataType[]values()按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。
-
-
-
枚举常量详细资料
-
BOOLEAN
public static final DataType BOOLEAN
-
BYTE
public static final DataType BYTE
-
CHAR
public static final DataType CHAR
-
SHORT
public static final DataType SHORT
-
INT
public static final DataType INT
-
LONG
public static final DataType LONG
-
FLOAT
public static final DataType FLOAT
-
DOUBLE
public static final DataType DOUBLE
-
COMPLEX
public static final DataType COMPLEX
-
DATE
public static final DataType DATE
-
SEQUENCE
public static final DataType SEQUENCE
-
STRING
public static final DataType STRING
-
STRUCTURE
public static final DataType STRUCTURE
-
ENUM1
public static final DataType ENUM1
-
ENUM2
public static final DataType ENUM2
-
ENUM4
public static final DataType ENUM4
-
OPAQUE
public static final DataType OPAQUE
-
OBJECT
public static final DataType OBJECT
-
UBYTE
public static final DataType UBYTE
-
USHORT
public static final DataType USHORT
-
UINT
public static final DataType UINT
-
ULONG
public static final DataType ULONG
-
-
方法详细资料
-
values
public static DataType[] values()
按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:for (DataType c : DataType.values()) System.out.println(c);
- 返回:
- 按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
-
valueOf
public static DataType valueOf(java.lang.String name)
返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
java.lang.IllegalArgumentException- 如果该枚举类型没有带有指定名称的常量java.lang.NullPointerException- 如果参数为空值
-
toString
public java.lang.String toString()
The DataType name, eg "byte", "float", "String".- 覆盖:
toString在类中java.lang.Enum<DataType>- 返回:
- The DataType name
-
getSize
public int getSize()
Size in bytes of one element of this data type. Strings dont know, so return 0. Structures return 1.- 返回:
- Size in bytes of one element of this data type.
-
getClassType
public java.lang.Class getClassType()
-
getPrimitiveClassType
public java.lang.Class getPrimitiveClassType()
The primitive class type: char, byte, float, double, short, int, long, boolean, String, StructureData, StructureDataIterator, ByteBuffer.- 返回:
- the primitive class type
-
getSignedness
public DataType.Signedness getSignedness()
Returns thesignednessof this data type. For non-integraldata types, it is guaranteed to beDataType.Signedness.SIGNED.- 返回:
- the signedness of this data type.
-
isUnsigned
public boolean isUnsigned()
Returnstrueif the data type isunsigned. For non-integraldata types, it is guaranteed to befalse.- 返回:
trueif the data type is unsigned.
-
getNumber
public int getNumber()
Returns A unique number for each of the different built-in types. These are roughly ordered from least-to-most precision.- 返回:
-
isString
public boolean isString()
Is String or Char- 返回:
- true if String or Char
-
isBoolean
public boolean isBoolean()
Is Boolean- 返回:
- true if Boolean
-
isNumeric
public boolean isNumeric()
Is Byte, Float, Double, Int, Short, or Long- 返回:
- true if numeric
-
isIntegral
public boolean isIntegral()
Is Byte, Int, Short, or Long- 返回:
- true if integral
-
isFloatingPoint
public boolean isFloatingPoint()
Is Float or Double- 返回:
- true if floating point type
-
isEnum
public boolean isEnum()
Is this an enumeration types?- 返回:
- true if ENUM1, 2, or 4
-
getType
public static DataType getType(java.lang.String name)
Find the DataType that matches this name.- 参数:
name- find DataType with this name.- 返回:
- DataType or null if no match.
-
getType
public static DataType getType(java.lang.Class c)
Find the DataType that matches this class.- 参数:
c- primitive or object class, eg float.class or Float.class- 返回:
- DataType or null if no match.
-
getType
public static DataType getType(java.lang.Class c, boolean isUnsigned)
Find the DataType that matches this class.- 参数:
c- primitive or object class, eg float.class or Float.class- 返回:
- DataType or null if no match.
-
unsignedLongToString
public static java.lang.String unsignedLongToString(long li)
convert an unsigned long to a String- 参数:
li- unsigned int- 返回:
- equivilent long value
-
unsignedIntToLong
public static long unsignedIntToLong(int i)
widen an unsigned int to a long- 参数:
i- unsigned int- 返回:
- equivilent long value
-
unsignedShortToInt
public static int unsignedShortToInt(short s)
widen an unsigned short to an int- 参数:
s- unsigned short- 返回:
- equivilent int value
-
unsignedByteToShort
public static short unsignedByteToShort(byte b)
widen an unsigned byte to a short- 参数:
b- unsigned byte- 返回:
- equivilent short value
-
main
public static void main(java.lang.String[] args)
-
-