com.ibm.streams.operator
Interface TupleAttribute<T,A>
-
public interface TupleAttribute<T,A>
Defines an attribute for a specific port. AnOperator
that requires anAttribute
parameter must contain a property of this type.The setter method for the property of type
TupleAttribute
must then be annotated with theParameter
annotation. At operator initialization, the Java runtime will initialize the property with the attribute information as specified in the SPL application by calling its setter method.
For example, an operator property can be specified as follows:private TupleAttribute<Tuple,Integer> sortBy; ... @Parameter public void setSortBy(TupleAttribute<Tuple,Integer> s) { this.sortBy = s; }
In an SPL application, the parameter can then be used as follows:param param1: s;
s
is an attribute on an input stream of the operator.
To specify a default attribute to be used with anAtribute
parameter, specify the attribute name using thecom.ibm.streams.operator.model.DefaultAttribute
annotation.- Since:
- InfoSphere® Streams Version 4.0
- See Also:
Parameter
,DefaultAttribute
-
-
Method Summary
Methods Modifier and Type Method and Description Attribute
getAttribute()
A reference to the actual attribute objectStreamingInput<T>
getPort()
The port whose schema includes the referenced attributeA
getValue(T tuple)
The value of the attribute in the specified tuple.
-
-
-
Method Detail
-
getPort
StreamingInput<T> getPort()
The port whose schema includes the referenced attribute
-
getAttribute
Attribute getAttribute()
A reference to the actual attribute object
-
-