public class Helper extends Object
for none-Android compatible methods.
Modifier and Type | Field and Description |
---|---|
static AngleCalc |
ANGLE_CALC |
static DistanceCalc3D |
DIST_3D |
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 |
cleanHack()
Trying to force the release of the mapped ByteBuffer.
|
static void |
cleanMappedByteBuffer(ByteBuffer buffer) |
static void |
close(Closeable cl) |
static int |
countBitValue(int maxTurnCosts) |
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 gnu.trove.list.TIntList |
createTList(int... 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 |
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 double |
keepIn(double value,
double min,
double max)
This methods returns the value or min if too small or max if too big.
|
static void |
loadProperties(Map<String,String> map,
Reader tmpReader) |
static String |
nf(long no) |
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 ArrayList<Integer> |
tIntListToArrayList(gnu.trove.list.TIntList from) |
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 |
underScoreToCamelCase(String key) |
public static final DistanceCalc DIST_EARTH
public static final DistanceCalc3D DIST_3D
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 ArrayList<Integer> tIntListToArrayList(gnu.trove.list.TIntList from)
public static int countBitValue(int maxTurnCosts)
public static void loadProperties(Map<String,String> map, Reader tmpReader) throws IOException
IOException
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 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 gnu.trove.list.TIntList createTList(int... list)
public static PointList createPointList(double... list)
public static PointList createPointList3D(double... list)
public static final int degreeToInt(double deg)
public static final double intToDegree(int storedInt)
public static final int eleToInt(double ele)
public static final double intToEle(int integEle)
public static void cleanMappedByteBuffer(ByteBuffer buffer)
public static void cleanHack()
public static String nf(long no)
public static final double keepIn(double value, double min, double max)
public static double round(double value, int exponent)
public static final double round6(double value)
public static final double round4(double value)
public static final double round2(double value)
public static DateFormat createFormatter()
public static DateFormat createFormatter(String str)
public static final long toUnsignedLong(int x)
public static final int toSignedInt(long x)
Copyright © 2012–2016. All rights reserved.