public class Helper extends Object
Modifier and Type | Field and Description |
---|---|
static AngleCalc |
ANGLE_CALC |
static DistanceCalc |
DIST_EARTH |
static DistancePlaneProjection |
DIST_PLANE |
static long |
MB |
static TimeZone |
UTC |
static Charset |
UTF_CS |
Modifier and Type | Method and Description |
---|---|
static int |
calcIndexSize(BBox graphBounds) |
static String |
camelCaseToUnderScore(String key) |
static void |
close(Closeable cl) |
static int |
countBitValue(int maxTurnCosts) |
static List<Double> |
createDoubleList(double[] values) |
static DateFormat |
createFormatter()
This creates a date formatter for yyyy-MM-dd'T'HH:mm:ss'Z' which is has to be identical to
buildDate used in pom.xml
|
static DateFormat |
createFormatter(String str)
Creates a SimpleDateFormat with the UK locale.
|
static PointList |
createPointList(double... list) |
static PointList |
createPointList3D(double... list) |
static int |
degreeToInt(double deg)
Converts into an integer to be compatible with the still limited DataAccess class (accepts
only integer values).
|
static int |
eleToInt(double ele)
Converts elevation value (in meters) into integer for storage.
|
static String |
firstBig(String sayText) |
static Locale |
getLocale(String param) |
static String |
getMemInfo() |
static int |
getSizeOfLongArray(int length,
int factor) |
static int |
getSizeOfObjectArray(int length,
int factor) |
static int |
getSizeOfObjectRef(int factor) |
static long |
getTotalMB() |
static long |
getUsedMB() |
static int |
getUsedMBAfterGC() |
static int |
idealByteArraySize(int need) |
static int |
idealIntArraySize(int need) |
static double |
intToDegree(int storedInt)
Converts back the integer value.
|
static double |
intToEle(int integEle)
Converts the integer value retrieved from storage into elevation (in meters).
|
static boolean |
isEmpty(String str) |
static boolean |
isFileMapped(ByteBuffer bb)
Determines if the specified ByteBuffer is one which maps to a file!
|
static String |
isToString(InputStream inputStream) |
static String |
join(String delimiter,
List<String> strings)
Equivalent to java 8 String#join
|
static double |
keepIn(double value,
double min,
double max)
This methods returns the value or min if too small or max if too big.
|
static String |
nf(long no) |
static List<String> |
parseList(String listStr)
parses a string like [a,b,c]
|
static String |
pruneFileEnd(String file) |
static List<String> |
readFile(Reader simpleReader) |
static List<String> |
readFile(String file) |
static boolean |
removeDir(File file) |
static double |
round(double value,
int exponent)
Round the value to the specified exponent
|
static double |
round2(double value) |
static double |
round4(double value) |
static double |
round6(double value) |
static void |
saveProperties(Map<String,String> map,
Writer tmpWriter) |
static int |
staticHashCode(String str)
Produces a static hashcode for a string that is platform independent and still compatible to the default
of openjdk.
|
static String |
toLowerCase(String string) |
static Object |
toObject(String string)
This method probes the specified string for a boolean, int, long, float and double.
|
static int |
toSignedInt(long x)
Converts the specified long back into a signed int (reverse method for toUnsignedLong)
|
static long |
toUnsignedLong(int x)
This method handles the specified (potentially negative) int as unsigned bit representation
and returns the positive converted long.
|
static String |
toUpperCase(String string) |
static String |
underScoreToCamelCase(String key) |
public static final DistanceCalc DIST_EARTH
public static final DistancePlaneProjection DIST_PLANE
public static final AngleCalc ANGLE_CALC
public static final Charset UTF_CS
public static final TimeZone UTC
public static final long MB
public static int countBitValue(int maxTurnCosts)
public static void saveProperties(Map<String,String> map, Writer tmpWriter) throws IOException
IOException
public static List<String> readFile(String file) throws IOException
IOException
public static List<String> readFile(Reader simpleReader) throws IOException
IOException
public static String isToString(InputStream inputStream) throws IOException
IOException
public static int idealIntArraySize(int need)
public static int idealByteArraySize(int need)
public static boolean removeDir(File file)
public static long getTotalMB()
public static long getUsedMB()
public static String getMemInfo()
public static int getUsedMBAfterGC()
public static int getSizeOfObjectRef(int factor)
public static int getSizeOfLongArray(int length, int factor)
public static int getSizeOfObjectArray(int length, int factor)
public static void close(Closeable cl)
public static boolean isEmpty(String str)
public static boolean isFileMapped(ByteBuffer bb)
public static int calcIndexSize(BBox graphBounds)
public static PointList createPointList(double... list)
public static PointList createPointList3D(double... list)
public static int degreeToInt(double deg)
public static double intToDegree(int storedInt)
public static int eleToInt(double ele)
public static double intToEle(int integEle)
public static String nf(long no)
public static double keepIn(double value, double min, double max)
public static double round(double value, int exponent)
public static double round6(double value)
public static double round4(double value)
public static double round2(double value)
public static DateFormat createFormatter()
public static DateFormat createFormatter(String str)
public static long toUnsignedLong(int x)
public static int toSignedInt(long x)
public static Object toObject(String string)
public static String join(String delimiter, List<String> strings)
public static int staticHashCode(String str)
String.hashCode()
Copyright © 2012–2020. All rights reserved.