summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils/PropertyDB.java
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2018-04-07 15:20:50 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2018-04-07 15:20:50 -0400
commit4e1a13330028b57818ece6741e029ebdbc9c7572 (patch)
treea9ce7ea5912d736f7c3c06bf59680f0483a7fe61 /base/src/main/java/bjc/utils/PropertyDB.java
parente51542d6c5f0db3717c91dae77458445bc01094c (diff)
Documentation
Diffstat (limited to 'base/src/main/java/bjc/utils/PropertyDB.java')
-rw-r--r--base/src/main/java/bjc/utils/PropertyDB.java23
1 files changed, 9 insertions, 14 deletions
diff --git a/base/src/main/java/bjc/utils/PropertyDB.java b/base/src/main/java/bjc/utils/PropertyDB.java
index 77ebb3d..85f1e2f 100644
--- a/base/src/main/java/bjc/utils/PropertyDB.java
+++ b/base/src/main/java/bjc/utils/PropertyDB.java
@@ -15,9 +15,11 @@ import bjc.utils.ioutils.SimpleProperties;
*
*/
public class PropertyDB {
- private static SimpleProperties regexes;
- private static Map<String, Pattern> compiledRegexes;
+ /* Regex storage. */
+ private static SimpleProperties regexes;
+ private static Map<String, Pattern> compiledRegexes;
+ /* Format string storage. */
private static SimpleProperties formats;
/*
@@ -31,6 +33,7 @@ public class PropertyDB {
private static LambdaLock loadLock = new LambdaLock();
static {
+ /* Reload properties on class load. */
reloadProperties();
}
@@ -41,17 +44,13 @@ public class PropertyDB {
* being loaded will block, to prevent reads from partial states.
*/
public static void reloadProperties() {
- /*
- * Do the load with the write lock taken.
- */
+ /* * Do the load with the write lock taken. */
loadLock.write(() -> {
if(LOGLOAD) {
System.out.println("Reading regex properties:");
}
- /*
- * Load regexes.
- */
+ /* * Load regexes. */
regexes = new SimpleProperties();
regexes.loadFrom(PropertyDB.class.getResourceAsStream("/regexes.sprop"), false);
if(LOGLOAD) {
@@ -64,9 +63,7 @@ public class PropertyDB {
System.out.println("Reading format properties:");
}
- /*
- * Load formats.
- */
+ /* * Load formats. */
formats = new SimpleProperties();
formats.loadFrom(PropertyDB.class.getResourceAsStream("/formats.sprop"), false);
if(LOGLOAD) {
@@ -113,9 +110,7 @@ public class PropertyDB {
throw new NoSuchElementException(msg);
}
- /*
- * Get the regex, and cache a compiled version.
- */
+ /* * Get the regex, and cache a compiled version. */
return compiledRegexes.computeIfAbsent(key, strang -> {
return Pattern.compile(regexes.get(strang));
});