com.kuka.nav.fleet.graph.properties
Class ParseUtil

java.lang.Object
  extended by com.kuka.nav.fleet.graph.properties.ParseUtil

public final class ParseUtil
extends Object

Utility class for parsing strings.


Method Summary
static List<Double> degreeToRads(List<Double> degrees)
          Converts a list of angles in degrees into a list of angles in radians.
static
<T extends Number>
String
getCommaSeparatedString(List<T> values, int decDigits)
          Joins a list of values to a comma separated value string.
static
<T> T
parse(Class<T> type, String value)
          Parses the given string and creates an object of the specified type.
static List<Double> parseCommaSeparatedString(String paramStr)
          Parses a string of comma separated double values into a list of doubles.
static List<Integer> parseCommaSeparatedStringAsIntegers(String paramStr)
          Parses a string of comma separated integer values into a list of integers.
static Double parseString(String value)
          Parses a given string to a double.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parse

public static <T> T parse(Class<T> type,
                          String value)
Parses the given string and creates an object of the specified type. type.

Type Parameters:
T - The type.
Parameters:
type - The type.
value - The string.
Returns:
The object.

parseCommaSeparatedString

public static List<Double> parseCommaSeparatedString(String paramStr)
Parses a string of comma separated double values into a list of doubles.

Parameters:
paramStr - the comma separated value string
Returns:
the list of double values

parseCommaSeparatedStringAsIntegers

public static List<Integer> parseCommaSeparatedStringAsIntegers(String paramStr)
Parses a string of comma separated integer values into a list of integers.

Parameters:
paramStr - the comma separated value string
Returns:
the list of double values

getCommaSeparatedString

public static <T extends Number> String getCommaSeparatedString(List<T> values,
                                                                int decDigits)
Joins a list of values to a comma separated value string.

Type Parameters:
T - T extends Number, it can be an Integer, Double..
Parameters:
values - the values
decDigits - the precision
Returns:
comma separated value string

degreeToRads

public static List<Double> degreeToRads(List<Double> degrees)
Converts a list of angles in degrees into a list of angles in radians.

Parameters:
degrees - the list of angles in degrees.
Returns:
the converted list.

parseString

public static Double parseString(String value)
Parses a given string to a double. String can be empty or null or the string representation of a double.

Parameters:
value - the string
Returns:
double value of given string


Copyright © 2019. All rights reserved.