Package org.pentaho.reporting.libraries.formula.typing

## Interface TypeRegistry

- All Known Implementing Classes:
    `DefaultTypeRegistry`

      public interface TypeRegistry

  The type registry manages the known value types.
  Author:
    Thomas Morgner

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `TypeValuePair` | `convertTo​(Type targetType, TypeValuePair valuePair)` | Checks whether the target type would accept the specified value object and value type.
    `ArrayCallback` | `convertToArray​(Type type, java.lang.Object value)` |
    `java.util.Date` | `convertToDate​(Type type1, java.lang.Object value)` | Converts the object of the given type into a date.
    `java.lang.Boolean` | `convertToLogical​(Type type1, java.lang.Object value)` | Converts the object of the given type into a boolean.
    `java.lang.Number` | `convertToNumber​(Type type1, java.lang.Object value)` | Converts the object of the given type into a number.
    `NumberSequence` | `convertToNumberSequence​(Type type, java.lang.Object value, boolean strictTypeChecks)` | Converts the given (type,value) pair into a numeric sequence.
    `Sequence` | `convertToSequence​(Type type, java.lang.Object value)` |
    `java.lang.String` | `convertToText​(Type type1, java.lang.Object value)` | (This conversion is used by the operator implementations.)
    `ExtendedComparator` | `getComparator​(Type type1, Type type2)` | Returns an comparator for the given types.
    `Type` | `guessTypeOfObject​(java.lang.Object o)` |

- - ### Method Detail

    - #### getComparator

          ExtendedComparator getComparator​(Type type1,
                                           Type type2)

      Returns an comparator for the given types.
      Parameters:
        `type1` -
        `type2` -
      Returns:

    - #### convertToNumber

          java.lang.Number convertToNumber​(Type type1,
                                           java.lang.Object value)
                                    throws EvaluationException

      Converts the object of the given type into a number. If the object is not convertible, a NumberFormatException is thrown. (This conversion is used by the operator implementations.)
      Parameters:
        `type1` -
        `value` -
      Returns:
        the value as number or ZERO if the value is unconvertible.
      Throws:
        `TypeConversionException` - if the type cannot be represented as number.
        `EvaluationException`

    - #### convertToText

          java.lang.String convertToText​(Type type1,
                                         java.lang.Object value)
                                  throws EvaluationException

      (This conversion is used by the operator implementations.)
      Parameters:
        `type1` -
        `value` -
      Returns:
        the value as string or an empty string, if the value given is null.
      Throws:
        `TypeConversionException`
        `EvaluationException`

    - #### convertToLogical

          java.lang.Boolean convertToLogical​(Type type1,
                                             java.lang.Object value)
                                      throws EvaluationException

      Converts the object of the given type into a boolean.
      Parameters:
        `type1` -
        `value` -
      Returns:
        The value as Boolean or null.
      Throws:
        `EvaluationException`

    - #### convertToDate

          java.util.Date convertToDate​(Type type1,
                                       java.lang.Object value)
                                throws EvaluationException

      Converts the object of the given type into a date.
      Parameters:
        `type1` -
        `value` -
      Returns:
        The value as Date or null.
      Throws:
        `EvaluationException`

    - #### convertToNumberSequence

          NumberSequence convertToNumberSequence​(Type type,
                                                 java.lang.Object value,
                                                 boolean strictTypeChecks)
                                          throws EvaluationException

      Converts the given (type,value) pair into a numeric sequence. If the flag "strictTypeChecks" is set to true, the value sequence will only evaluate numeric values. A non-strict sequence will treat text as zero and logical values as 0 or 1.
      Parameters:
        `type` -
        `value` -
        `strictTypeChecks` -
      Returns:
      Throws:
        `TypeConversionException`
        `EvaluationException`

    - #### convertToSequence

          Sequence convertToSequence​(Type type,
                                     java.lang.Object value)
                              throws EvaluationException

      Throws:
        `EvaluationException`

    - #### convertToArray

          ArrayCallback convertToArray​(Type type,
                                       java.lang.Object value)
                                throws EvaluationException

      Throws:
        `EvaluationException`

    - #### convertTo

          TypeValuePair convertTo​(Type targetType,
                                  TypeValuePair valuePair)
                           throws EvaluationException

      Checks whether the target type would accept the specified value object and value type. (This conversion is used by the functions.)
      Parameters:
        `targetType` -
        `valuePair` -
      Throws:
        `EvaluationException`

    - #### guessTypeOfObject

          Type guessTypeOfObject​(java.lang.Object o)