From 4e1a13330028b57818ece6741e029ebdbc9c7572 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Sat, 7 Apr 2018 15:20:50 -0400 Subject: Documentation --- base/src/main/java/bjc/utils/PropertyDB.java | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'base/src/main/java/bjc/utils/PropertyDB.java') 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 compiledRegexes; + /* Regex storage. */ + private static SimpleProperties regexes; + private static Map 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)); }); -- cgit v1.2.3