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 booleanidenticalLength(String source1, String source2)check whether the supplied parameter is identical SVGLength.static String[]parseViewBox(String viewBox)Return viewBox parsed as Stringstatic NumbervalidateInteger(String source)Parses text represent SVGNumber from the beginning of the given string to produce a number.static NumbervalidateLength(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 SVGLengthstatic NumbervalidateNumber(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 Datastatic List<Point2D>validatePointList(String source)used with polyline and polygon point list
-
-
-
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 SVGLengthsource2- 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
-
-