Add removeAll to preferences (#987)

This removes all keys except for .type.
This commit is contained in:
Austin Shalit
2018-05-16 22:50:35 -04:00
committed by Peter Johnson
parent 2e0709f05b
commit f90e429bf9
4 changed files with 43 additions and 0 deletions

View File

@@ -173,6 +173,17 @@ public class Preferences {
m_table.delete(key);
}
/**
* Remove all preferences.
*/
public void removeAll() {
for (String key : m_table.getKeys()) {
if (!".type".equals(key)) {
remove(key);
}
}
}
/**
* Returns the string at the given key. If this table does not have a value for that position,
* then the given backup value will be returned.