public class Settings
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.HashMap<java.lang.String,java.lang.String> |
items |
private java.util.ArrayList<java.lang.String> |
keys |
private java.lang.String |
settingsFileName |
Constructor and Description |
---|
Settings(java.lang.String settingsFileName)
Creates new Settings importing information from the given file name
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
get(java.lang.String key)
Get the value associated to the field name
|
(package private) java.lang.String |
getKey(int location)
Get the field name from that specific location in the array list
|
(package private) void |
setBooksFilename(java.lang.String newBooksFilename)
Change the file name for the Books
|
private void |
setDefault() |
void |
setTitle(java.lang.String newTitle)
Change the title of the application
|
(package private) void |
setUsersFilename(java.lang.String newUsersFilename)
Change the file name for the Users
|
int |
size()
Amount of fields in the settings
|
private void |
toFile()
Save the settings to the given input file
|
private void |
update(java.lang.String key,
java.lang.String newValue) |
private java.util.HashMap<java.lang.String,java.lang.String> items
private java.util.ArrayList<java.lang.String> keys
private java.lang.String settingsFileName
public Settings(java.lang.String settingsFileName)
settingsFileName
- File name of existing settings storedpublic java.lang.String get(java.lang.String key)
key
- Field namejava.lang.String getKey(int location)
location
- Location of the field in the array listvoid setBooksFilename(java.lang.String newBooksFilename)
newBooksFilename
- New file name for Booksprivate void setDefault()
public void setTitle(java.lang.String newTitle)
newTitle
- New Titlevoid setUsersFilename(java.lang.String newUsersFilename)
newUsersFilename
- New file name for Userspublic int size()
private void toFile()
private void update(java.lang.String key, java.lang.String newValue)