Package kiyut.sketsa.util

## Class DataTypeUtilities

- java.lang.Object
- - kiyut.sketsa.util.DataTypeUtilities

-     public class DataTypeUtilities
      extends Object

  Collection of SVG Data Types utilities
  Author:
    KIYUT

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DataTypeUtilities()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static boolean` | `identicalLength​(String source1, String source2)` | check whether the supplied parameter is identical SVGLength.
    `static String[]` | `parseViewBox​(String viewBox)` | Return viewBox parsed as String
    `static Number` | `validateInteger​(String source)` | Parses text represent SVGNumber from the beginning of the given string to produce a number.
    `static Number` | `validateLength​(String source)` | Parses text represent SVGLength from the beginning of the given string to produce a number.
    `static List<Number>` | `validateLengthList​(String source)` | Parses text represent list of SVGLength
    `static Number` | `validateNumber​(String source)` | Parses text represent SVGNumber from the beginning of the given string to produce a number.
    `static List<Number>` | `validateNumberList​(String source)` |
    `static Number[]` | `validateNumberOptional​(String source)` |
    `static List<String>` | `validatePathData​(String source)` | used with Path Data
    `static List<Point2D>` | `validatePointList​(String source)` | used with polyline and polygon point list

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DataTypeUtilities

          public DataTypeUtilities()

  - ### Method Detail

    - #### validateInteger

          public static Number validateInteger​(String source)
                                        throws ParseException

      Parses text represent SVGNumber from the beginning of the given string to produce a number.
      Parameters:
        `source` - A String whose beginning should be parsed.
      Returns:
        A Number parsed from the string
      Throws:
        `ParseException` - if the beginning of the specified string cannot be parsed.
      See Also:
        `NumberFormat.parse(String)`

    - #### validateNumber

          public static Number validateNumber​(String source)
                                       throws ParseException

      Parses text represent SVGNumber from the beginning of the given string to produce a number.
      Parameters:
        `source` - A String whose beginning should be parsed.
      Returns:
        A Number parsed from the string
      Throws:
        `ParseException` - if the beginning of the specified string cannot be parsed.
      See Also:
        `NumberFormat.parse(String)`

    - #### validateLength

          public static Number validateLength​(String source)
                                       throws ParseException

      Parses text represent SVGLength from the beginning of the given string to produce a number.
      Parameters:
        `source` - A String whose beginning should be parsed.
      Returns:
        A Number parsed from the string
      Throws:
        `ParseException` - if the beginning of the specified string cannot be parsed.
      See Also:
        `NumberFormat.parse(String)`

    - #### validateLengthList

          public static List<Number> validateLengthList​(String source)
                                                 throws ParseException

      Parses text represent list of SVGLength
      Parameters:
        `source` - A String whose beginning should be parsed.
      Returns:
        List of Number parsed from the string
      Throws:
        `ParseException` - for invalid list of length
      See Also:
        `NumberFormat.parse(String)`

    - #### identicalLength

          public static boolean identicalLength​(String source1,
                                                String source2)
                                         throws ParseException

      check whether the supplied parameter is identical SVGLength. eg: 2% identical with 2.00%, 2% not identical with 2mm
      Parameters:
        `source1` - String of SVGLength
        `source2` - String of SVGLength
      Returns:
        true if both parameter is equals, false otherwise
      Throws:
        `ParseException` - if the beginning of the specified string cannot be parsed.

    - #### validateNumberOptional

          public static Number[] validateNumberOptional​(String source)
                                                 throws ParseException

      Throws:
        `ParseException`

    - #### validateNumberList

          public static List<Number> validateNumberList​(String source)
                                                 throws ParseException

      Throws:
        `ParseException`

    - #### validatePointList

          public static List<Point2D> validatePointList​(String source)
                                                 throws ParseException

      used with polyline and polygon point list
      Parameters:
        `source` - point description in string
      Returns:
        List of Point2D, but currently it just return null
      Throws:
        `ParseException` - if parse failed

    - #### validatePathData

          public static List<String> validatePathData​(String source)
                                               throws ParseException

      used with Path Data
      Parameters:
        `source` - the source
      Returns:
        List, but currently it just return null
      Throws:
        `ParseException` - if parse failed

    - #### parseViewBox

          public static String[] parseViewBox​(String viewBox)

      Return viewBox parsed as String
      Parameters:
        `viewBox` - the viewbox
      Returns:
        String array