|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.gui.util.SavedSettingsFile
public class SavedSettingsFile
Class to manage saved settings in a text file.
Field Summary | |
---|---|
static String |
COMMENT_PREFIX
Comment prefix |
private File |
file
File to read and write |
private ArrayList<Pair<String,ArrayList<String>>> |
store
Data store |
Constructor Summary | |
---|---|
SavedSettingsFile(String filename)
Constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String COMMENT_PREFIX
private File file
private ArrayList<Pair<String,ArrayList<String>>> store
Constructor Detail |
---|
public SavedSettingsFile(String filename)
filename
- FilenameMethod Detail |
---|
public void save() throws IOException
IOException
- thrown on output errors.public void load() throws FileNotFoundException, IOException
FileNotFoundException
- thrown when file not found
IOException
- thrown on IO errprspublic Iterator<Pair<String,ArrayList<String>>> iterator()
iterator
in interface Iterable<Pair<String,ArrayList<String>>>
public void remove(String key)
key
- Key to removepublic ArrayList<String> get(String key)
key
- Key to search for
public void clear()
public void put(String key, ArrayList<String> value)
key
- Keyvalue
- (New) value.public int size()
public Pair<String,ArrayList<String>> getElementAt(int index)
index
- settings index
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |