public class FormatUtils extends Object
Constructor and Description |
---|
FormatUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
cutDecimals(double d) |
static String |
formatLocation(org.bukkit.Location loc)
Formats a Minecraft Location into readable format.
|
static String |
formatTimeAmount(String string)
Formats a String of long in ms to readable format.
|
static String |
formatTimeAmountSinceDate(Date before,
Date now)
Formats the difference between the two dates into readable format.
|
static String |
formatTimeAmountSinceString(String string,
Date now)
Formats the difference between the two dates, where first is in String of
Long format, into readable format.
|
static String |
formatTimeStamp(String string)
Creates a new Date with Epoch second and returns Date and Time String.
|
static String[] |
mergeArrays(String[]... arrays)
Merges multiple arrays into one.
|
static int |
parseVersionNumber(String versionString)
Turns the version string into a integer
|
static String |
removeLetters(String dataPoint)
Removes letters from a string leaving only numbers and dots.
|
static String |
removeNumbers(String dataPoint) |
public static String formatTimeAmount(String string) throws NumberFormatException
string
- String of a Long in msNumberFormatException
- if String is not long.public static String formatTimeAmountSinceDate(Date before, Date now) throws NumberFormatException
before
- now
- NumberFormatException
public static String formatTimeStamp(String string) throws NumberFormatException
string
- NumberFormatException
- String is not Longpublic static String formatTimeAmountSinceString(String string, Date now) throws NumberFormatException
string
- Long in ms, datenow
- NumberFormatException
public static String removeLetters(String dataPoint)
dataPoint
- public static int parseVersionNumber(String versionString) throws NumberFormatException
versionString
- String - number format 1.1.1NumberFormatException
- When wrong formatpublic static String[] mergeArrays(String[]... arrays)
arrays
- String arrays that need to be combinedpublic static String formatLocation(org.bukkit.Location loc)
loc
- Location to formatpublic static String cutDecimals(double d)
d
- Copyright © 2017. All rights reserved.