Modifier and Type | Field and Description |
---|---|
static String |
COMMENT_PREFIX
Comment prefix
|
private File |
file
File to read and write
|
private ArrayList<Pair<String,ArrayList<String>>> |
store
Data store
|
Constructor and Description |
---|
SavedSettingsFile(String filename)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all saved settings.
|
ArrayList<String> |
get(String key)
Find a saved setting by key.
|
Pair<String,ArrayList<String>> |
getElementAt(int index)
Array access.
|
Iterator<Pair<String,ArrayList<String>>> |
iterator() |
void |
load()
Read the current file
|
void |
put(String key,
ArrayList<String> value)
Add/Replace a saved setting
|
void |
remove(String key)
Remove a given key from the file.
|
void |
save()
Save the current data to the given file.
|
int |
size()
Return number of saved settings profiles.
|
public static final String COMMENT_PREFIX
private File file
public SavedSettingsFile(String filename)
filename
- Filenamepublic void save() throws IOException
IOException
- thrown on output errors.public void load() throws FileNotFoundException, IOException
FileNotFoundException
- thrown when file not foundIOException
- thrown on IO errprspublic void remove(String key)
key
- Key to removepublic ArrayList<String> get(String key)
key
- Key to search forpublic void clear()
public void put(String key, ArrayList<String> value)
key
- Keyvalue
- (New) value.public int size()