public class MapFile
extends java.lang.Object
Constructor and Description |
---|
MapFile(java.lang.String path,
java.lang.String extension)
A wrapper class for quick Map saving
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the file of all data
|
void |
delete()
Deletes the file
|
void |
put(java.lang.String key,
java.lang.String value)
Adds a line to the end of the file or updates an existing line
|
java.util.Map<java.lang.String,java.lang.String> |
read()
Turns a file into a Map
|
void |
write(java.util.Map<java.lang.String,?> map)
Writes a Map to the file in a key: value format
|
public MapFile(java.lang.String path, java.lang.String extension)
path
- The path to the new, or existing fileextension
- The extension of the file excluding the periodpublic void write(java.util.Map<java.lang.String,?> map)
map
- The Map to savepublic java.util.Map<java.lang.String,java.lang.String> read()
public void put(java.lang.String key, java.lang.String value)
key
- The line to addvalue
- The value assigned to the keypublic void clear()
public void delete()