Class Format
java.lang.Object
us.ajg0702.leaderboards.formatting.Format
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
getName()
abstract boolean
Tests if the provided placeholder (and possibly output) is readable with this formatabstract double
Converts the provided input to a double using this formatabstract String
toFormat
(double input) Converts a double into this format
-
Constructor Details
-
Format
public Format()
-
-
Method Details
-
matches
Tests if the provided placeholder (and possibly output) is readable with this format- Parameters:
output
- The string output from the placeholderplaceholder
- the placeholder without %- Returns:
- True if this format supports parsing the output, false if it doesn't, or we're not sure
-
toDouble
Converts the provided input to a double using this format- Parameters:
input
- The string output from the placeholder- Returns:
- A double representing the string format
- Throws:
NumberFormatException
- if the input does not match the format, or some other issue occurred with parsing
-
toFormat
Converts a double into this format- Parameters:
input
- The provided double- Returns:
- A string that is the provided double in this format
-
getName
- Returns:
- the (unique) name of this format
-