com.ibm.streams.operator
Enum Type.MetaType
- java.lang.Object
-
- java.lang.Enum<Type.MetaType>
-
- com.ibm.streams.operator.Type.MetaType
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<Type.MetaType>
- Enclosing interface:
- Type
public static enum Type.MetaType extends java.lang.Enum<Type.MetaType>
Enumeration of SPL types. AMetaType
describes the SPL type that aType
represents and the mapping between the SPL type and Java. Each enumerated type's documentation includes a table that describes the mapping between the SPL type and Java using the InfoSphere Streams Java Operator API. This is the key to a type's table:Type Information Key SPL type Name of the SPL type Object type Java class used for instances of the enumerated type by getObject
andsetObject
.Primitive type Primary Java primitive the enumerated type can be got as using getter methods of Tuple
or set as using setter methods ofOutputTuple
.Type interfaces List of interfaces implemented by any instance of Type
whoseType.getMetaType()
method returns the enumerated type.In a type's table, for any SPL type
T
,Tc
represents its mapping as an element in a Java composite. For all types exceptLIST
andBLIST
this is its Java object type, e.g.java.lang.String
for SPLustring
leading to a SPLset<ustring>
being represented as ajava.util.Set<String>
in Java.
ForLIST
andBLIST
types the composite element type is always itsjava.util.List
type instead of its Java object type. E.g. SPLlist<int32>
has a Java object type ofint[]
but SPLset<list<int32>>
maps to Javajava.util.Set<java.util.List<Integer>>
.
The mapping from an SPL type to its composite type can be obtained usingType.getAsCompositeElementType()
.
-
-
Enum Constant Summary
Enum Constants Enum Constant and Description BLIST
SPLlist<T>[n]
bounded list of at most n elements.BLOB
SPLblob
sequence of bytes.BMAP
SPLmap<K,V>[n]
bounded map.BOOLEAN
SPLboolean
.BSET
SPLset<T>[n]
bounded set.BSTRING
SPLrstring[n]
bounded-length string of at most n raw 8-bit bytes.COMPLEX32
SPLcomplex32
32-bit binary floating point complex number.COMPLEX64
SPLcomplex64
64-bit binary floating point complex number.DECIMAL128
SPLdecimal128
IEEE 754 decimal 128-bit floating point number.DECIMAL32
SPLdecimal32
IEEE 754 decimal 32-bit floating point number.DECIMAL64
SPLdecimal64
IEEE 754 decimal 64-bit floating point number.ENUM
SPLenum
.FLOAT32
SPLfloat32
IEEE 754 binary 32-bit floating point number.FLOAT64
SPLfloat64
IEEE 754 binary 64-bit floating point number.INT16
SPLint16
signed 16-bit integer.INT32
SPLint32
signed 32-bit integer.INT64
SPLint64
signed 64-bit integer.INT8
SPLint8
signed 8-bit integer.LIST
SPLlist<T>
sequence of elements of SPL typeT
.MAP
SPLmap<K,V>
unordered mapping from key SPL typeK
to value SPL typeV
.RSTRING
SPLrstring
string of raw 8-bit bytes.SET
SPLset<T>
unordered collection elements of SPL typeT
without duplicates.TIMESTAMP
SPLtimestamp
point in time, with nanosecond precision.TUPLE
SPLtuple<T name, ...>
sequence of attributes.UINT16
SPLuint16
unsigned 16-bit integer.UINT32
SPLuint32
unsigned 32-bit integer.UINT64
SPLuint64
unsigned 64-bit integer.UINT8
SPLuint8
unsigned 8-bit integer.USTRING
SPLustring
string of UTF-16 Unicode characters.XML
SPLXML
.
-
Method Summary
Methods Modifier and Type Method and Description java.lang.String
getLanguageType()
Returns the type name as it appears in SPL, null if it is a composite type that does not have a single representation in SPL.java.math.MathContext
getMathContext()
Return a suitable MathContext.java.lang.Class<? extends Type>
getMetaTypeInteface()
Get the interface that provide the meta-data about the type.boolean
isCollectionType()
Is the type a SPL collection type.boolean
isList()
Is the type a SPL list type.boolean
isMap()
Is the type a SPL map type.boolean
isSet()
Is the type a SPL set type.static Type.MetaType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Type.MetaType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOLEAN
public static final Type.MetaType BOOLEAN
SPLboolean
.Type information SPL type boolean
Object type java.lang.Boolean
Primitive type boolean
Type interface Type
-
INT8
public static final Type.MetaType INT8
SPLint8
signed 8-bit integer.Type information SPL type int8
Object type java.lang.Byte
Primitive type byte
Type interface Type
-
INT16
public static final Type.MetaType INT16
SPLint16
signed 16-bit integer.Type information SPL type int16
Object type java.lang.Short
Primitive type short
Type interface Type
-
INT32
public static final Type.MetaType INT32
SPLint32
signed 32-bit integer.Type information SPL type int32
Object type java.lang.Integer
Primitive type int
Type interface Type
-
INT64
public static final Type.MetaType INT64
SPLint64
signed 64-bit integer.Type information SPL type int64
Object type java.lang.Long
Primitive type long
Type interface Type
-
UINT8
public static final Type.MetaType UINT8
SPLuint8
unsigned 8-bit integer. SPLuint8
is mapped to Java's 8-bit signed type in primitive (byte
) and object form (java.lang.Byte
) as Java does not support unsigned integral values.
Anyuint8
within an SPL collection type will be represented usingjava.lang.Byte
objects and thus contain signed values.
Applications can handle such values as unsigned values, by converting them to ashort
(or larger) integer primitive. SeeTuple.getByte(int)
for details on howuint8
attributes can be retrieved as unsigned values.Type information SPL type uint8
Object type java.lang.Byte
Primitive type byte
Type interface Type
-
UINT16
public static final Type.MetaType UINT16
SPLuint16
unsigned 16-bit integer. SPLuint16
is mapped to Java's 16-bit signed type in primitive (short
) and object form (java.lang.Short
) as Java does not support unsigned integral values.
Anyuint16
within an SPL collection type will be represented usingjava.lang.Short
objects and thus contain signed values.
Applications can handle such values as unsigned values, by converting them to aint
(or larger) integer primitive. SeeTuple.getShort(int)
for details on howuint16
attributes can be retrieved as unsigned values.Type information SPL type uint16
Object type java.lang.Short
Primitive type short
Type interface Type
-
UINT32
public static final Type.MetaType UINT32
SPLuint32
unsigned 32-bit integer. SPLuint32
is mapped to Java's 32-bit signed type in primitive (int
) and object form (java.lang.Integer
) as Java does not support unsigned integral values.
Anyuint32
within an SPL collection type will be represented usingjava.lang.Integer
objects and thus contain signed values.
Applications can handle such values as unsigned values, by converting them to along
primitive. SeeTuple.getInt(int)
for details on howuint32
attributes can be retrieved as unsigned values.Type information SPL type uint32
Object type java.lang.Integer
Primitive type int
Type interface Type
-
UINT64
public static final Type.MetaType UINT64
SPLuint64
unsigned 64-bit integer. SPLuint64
is mapped to Java's 32-bit signed type in primitive (long
) and object form (java.lang.Long
) as Java does not support unsigned integral values.
Anyuint64
within an SPL collection type will be represented usingjava.lang.Long
objects and thus contain signed values.
Applications can handle such values as unsigned values, by converting them to ajava.math.BigInteger
object. SeeTuple.getLong(int)
for details on howuint64
attributes can be retrieved as unsigned values.Type information SPL type uint64
Object type java.lang.Long
Primitive type long
Type interface Type
-
FLOAT32
public static final Type.MetaType FLOAT32
SPLfloat32
IEEE 754 binary 32-bit floating point number.Type information SPL type float32
Object type java.lang.Float
Primitive type float
Type interface Type
-
FLOAT64
public static final Type.MetaType FLOAT64
SPLfloat64
IEEE 754 binary 64-bit floating point number.Type information SPL type float64
Object type java.lang.Double
Primitive type double
Type interface Type
-
DECIMAL32
public static final Type.MetaType DECIMAL32
SPLdecimal32
IEEE 754 decimal 32-bit floating point number.Type information SPL type decimal32
Object type java.math.BigDecimal
java.math.MathContext
DECIMAL32
Primitive type none Type interface Type
-
DECIMAL64
public static final Type.MetaType DECIMAL64
SPLdecimal64
IEEE 754 decimal 64-bit floating point number.Type information SPL type decimal64
Object type java.math.BigDecimal
java.math.MathContext
DECIMAL64
Primitive type none Type interface Type
-
DECIMAL128
public static final Type.MetaType DECIMAL128
SPLdecimal128
IEEE 754 decimal 128-bit floating point number.Type information SPL type decimal128
Object type java.math.BigDecimal
java.math.MathContext
DECIMAL128
Primitive type none Type interface Type
-
COMPLEX32
public static final Type.MetaType COMPLEX32
SPLcomplex32
32-bit binary floating point complex number.Type information SPL type complex32
Object type org.apache.commons.math.complex.Complex
Primitive type none Type interface Type
-
COMPLEX64
public static final Type.MetaType COMPLEX64
SPLcomplex64
64-bit binary floating point complex number.Type information SPL type complex64
Object type org.apache.commons.math.complex.Complex
Primitive type none Type interface Type
-
TIMESTAMP
public static final Type.MetaType TIMESTAMP
-
RSTRING
public static final Type.MetaType RSTRING
-
USTRING
public static final Type.MetaType USTRING
SPLustring
string of UTF-16 Unicode characters.Type information SPL type ustring
Object type java.lang.String
Primitive type none Type interface Type
-
BSTRING
public static final Type.MetaType BSTRING
SPLrstring[n]
bounded-length string of at most n raw 8-bit bytes.Type information SPL type rstring[n]
Object type RString
Primitive type none Type interface Type
,BoundedType
-
BLOB
public static final Type.MetaType BLOB
-
LIST
public static final Type.MetaType LIST
SPLlist<T>
sequence of elements of SPL typeT
. Its Java representation as a generic object type depends on the list's element SPL type.Type information SPL type list<T>
Object type Depends on the element type T
, see Specific List Type Information tablePrimitive type none Type interface CollectionType
Specific List Type Information SPL type Object type java.util.List
typelist<boolean>
boolean[]
List<Boolean>
list<int8>
byte[]
List<Byte>
list<int16>
short[]
List<Short>
list<int32>
int[]
List<Integer>
list<int64>
long[]
List<Long>
list<float32>
float[]
List<Float>
list<float64>
double[]
List<Double>
list<ustring>
String[]
List<String>
list<rstring>
java.util.List<
RString
>list<T>
java.util.List<Tc>
-
BLIST
public static final Type.MetaType BLIST
SPLlist<T>[n]
bounded list of at most n elements.Type information SPL type list<T>
Object type Depends on the element type T
, see Specific List Type Information table forLIST
Primitive type none Type interfaces CollectionType
,BoundedType
-
SET
public static final Type.MetaType SET
SPLset<T>
unordered collection elements of SPL typeT
without duplicates.Type information SPL type set<T>
Object type java.util.Set<Tc>
Primitive type none Type interface CollectionType
-
BSET
public static final Type.MetaType BSET
SPLset<T>[n]
bounded set.Type information SPL type set<T>
Object type java.util.Set<Tc>
Primitive type none Type interfaces CollectionType
,BoundedType
-
MAP
public static final Type.MetaType MAP
SPLmap<K,V>
unordered mapping from key SPL typeK
to value SPL typeV
.Type information SPL type map<K,V>
Object type java.util.Map<Kc,Vc>
Primitive type none Type interface MapType
-
BMAP
public static final Type.MetaType BMAP
SPLmap<K,V>[n]
bounded map.Type information SPL type map<K,V>[n]
Object type java.util.Map<Kc,Vc>
Primitive type none Type interfaces MapType
,BoundedType
-
TUPLE
public static final Type.MetaType TUPLE
-
XML
public static final Type.MetaType XML
- Since:
- InfoSphere® Streams Version 3.0
-
ENUM
public static final Type.MetaType ENUM
SPLenum
. An SPLenum
attribute is represented as aString
when accessed generically as anObject
. An attribute of typeENUM
may be converted to a Java eumeration usingTuple.getEnum(Class, int)
andOutputTuple.setEnum(Class, int, Enum)
.Type information SPL type enum{identifier, ...}
Object type java.lang.String
Primitive type none Type interface EnumType
- Since:
- InfoSphere® Streams Version 3.0
- See Also:
EnumType.verifyMapping(Class)
-
-
Method Detail
-
values
public static Type.MetaType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Type.MetaType c : Type.MetaType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Type.MetaType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getLanguageType
public final java.lang.String getLanguageType()
Returns the type name as it appears in SPL, null if it is a composite type that does not have a single representation in SPL.- Returns:
- SPL name of the type.
-
getMetaTypeInteface
public final java.lang.Class<? extends Type> getMetaTypeInteface()
Get the interface that provide the meta-data about the type.- Returns:
- Type or a sub-interface of Type.
-
isList
public final boolean isList()
Is the type a SPL list type.- Returns:
- True if the type is a list, false otherwise.
-
isMap
public final boolean isMap()
Is the type a SPL map type.- Returns:
- True if the type is a map, false otherwise.
-
isSet
public final boolean isSet()
Is the type a SPL set type.- Returns:
- True if the type is a set, false otherwise.
-
isCollectionType
public final boolean isCollectionType()
Is the type a SPL collection type.- Returns:
- True if the type is a list, set or map type, false otherwise.
-
getMathContext
public java.math.MathContext getMathContext()
Return a suitable MathContext. For DECIMAL32, DECIMAL64 and DECIMAL128 the corresponding MathContext field is returned. For non-decimal numeric types MathContext.UNLIMITED is returned. For non-numeric types null is returned,- Returns:
- Suitable MathContext object for type.
-
-