com.ibm.streams.operator

Interface Type

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface and Description
      static class  Type.Factory
      Factory for creating SPL type related objects.
      static class  Type.MetaType
      Enumeration of SPL types.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.Class<?> getAsCompositeElementType()
      Get the type of the object returned for this type when stored in a collection type.
      java.lang.Object getDefaultValue()
      Get an object that represents the default initial value for this type.
      java.lang.String getLanguageType()
      Returns the type name as it appears in SPL.
      Type.MetaType getMetaType()
      Return the enumeration representing the meta-type.
      java.lang.Class<?> getObjectType()
      Get the type of the object returned for this type from a generic object based getter.
      java.lang.Object randomValue(java.util.Random rand)
      Return a randomly generated value for testing.
      java.lang.String toString(java.lang.Object value)
      Returns a string that textually represents a value of this type, typically using Object.toString() of getObjectType().
    • Method Detail

      • getMetaType

        Type.MetaType getMetaType()
        Return the enumeration representing the meta-type.
        Returns:
        Enumeration for the meta-type.
      • getLanguageType

        java.lang.String getLanguageType()
        Returns the type name as it appears in SPL.
        Returns:
        SPL name of the type
      • getObjectType

        java.lang.Class<?> getObjectType()
        Get the type of the object returned for this type from a generic object based getter.
        Returns:
        Java Class reference describing the type.
        See Also:
        Tuple.getObject(int)
      • getAsCompositeElementType

        java.lang.Class<?> getAsCompositeElementType()
        Get the type of the object returned for this type when stored in a collection type.
        Returns:
        Class of type when stored in a collection.
      • getDefaultValue

        java.lang.Object getDefaultValue()
        Get an object that represents the default initial value for this type. For numeric values this corresponds to zero, for string values the empty string and for collections an empty collection.
        Returns:
        Default value for this type.
      • randomValue

        java.lang.Object randomValue(java.util.Random rand)
        Return a randomly generated value for testing.
        Parameters:
        rand - Random object used to generate value.
        Returns:
        A random value valid for this type
      • toString

        java.lang.String toString(java.lang.Object value)
        Returns a string that textually represents a value of this type, typically using Object.toString() of getObjectType(). The returned value is not always the same as SPL character encoding for the type, specifically:
        • USTRING and RSTRING attributes return the corresponding Java String value, not an SPL string literal with escaped values.
        • XML attributes return the corresponding Java String value, not an SPL XML literal with escaped values and suffix x.
        Parameters:
        value - Value to be represented as a String.
        Returns:
        String that textually represents value.
        Throws:
        java.lang.ClassCastException - value is not an instance of getObjectType().
        See Also:
        Tuple.getString(int)