summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils/ioutils
diff options
context:
space:
mode:
Diffstat (limited to 'base/src/main/java/bjc/utils/ioutils')
-rw-r--r--base/src/main/java/bjc/utils/ioutils/DuplicateKeys.java21
-rw-r--r--base/src/main/java/bjc/utils/ioutils/InvalidLineFormat.java20
-rw-r--r--base/src/main/java/bjc/utils/ioutils/SimpleProperties.java51
-rw-r--r--base/src/main/java/bjc/utils/ioutils/blocks/SerialBlockReader.java2
-rw-r--r--base/src/main/java/bjc/utils/ioutils/blocks/package-info.java8
5 files changed, 51 insertions, 51 deletions
diff --git a/base/src/main/java/bjc/utils/ioutils/DuplicateKeys.java b/base/src/main/java/bjc/utils/ioutils/DuplicateKeys.java
new file mode 100644
index 0000000..604cc69
--- /dev/null
+++ b/base/src/main/java/bjc/utils/ioutils/DuplicateKeys.java
@@ -0,0 +1,21 @@
+package bjc.utils.ioutils;
+
+/**
+ * Exception thrown when there is a duplicate key, when they are forbidden.
+ *
+ * @author 15405
+ *
+ */
+public class DuplicateKeys extends RuntimeException {
+ private static final long serialVersionUID = -5521190136366024804L;
+
+ /**
+ * Create a new duplicate key exception.
+ *
+ * @param keyName
+ * The name of the key that has been duplicated.
+ */
+ public DuplicateKeys(String keyName) {
+ super(String.format("Duplicate value encountered for key '%s'", keyName));
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/bjc/utils/ioutils/InvalidLineFormat.java b/base/src/main/java/bjc/utils/ioutils/InvalidLineFormat.java
new file mode 100644
index 0000000..2763eb1
--- /dev/null
+++ b/base/src/main/java/bjc/utils/ioutils/InvalidLineFormat.java
@@ -0,0 +1,20 @@
+package bjc.utils.ioutils;
+
+/**
+ * Exception thrown when a line is formattted incorrectly.
+ * @author Ben Culkin
+ *
+ */
+public class InvalidLineFormat extends RuntimeException {
+ private static final long serialVersionUID = 5332131472090792841L;
+
+ /**
+ * Create a new exception for an incorrectly formatted line.
+ * @param lne The line that was incorrectly formatted.
+ */
+ public InvalidLineFormat(String lne) {
+ super(String.format(
+ "Line '%s' is improperly formatted.\n\tExpected format is a string key, followed by a single space, followed by the value",
+ ""));
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/bjc/utils/ioutils/SimpleProperties.java b/base/src/main/java/bjc/utils/ioutils/SimpleProperties.java
index d380866..0aa18b4 100644
--- a/base/src/main/java/bjc/utils/ioutils/SimpleProperties.java
+++ b/base/src/main/java/bjc/utils/ioutils/SimpleProperties.java
@@ -17,45 +17,6 @@ import java.util.Set;
*
*/
public class SimpleProperties implements Map<String, String> {
- /**
- * Exception thrown when there is a duplicate key, when they are forbidden.
- *
- * @author 15405
- *
- */
- public static class DuplicateKeys extends RuntimeException {
- private static final long serialVersionUID = -5521190136366024804L;
-
- /**
- * Create a new duplicate key exception.
- *
- * @param keyName
- * The name of the key that has been duplicated.
- */
- public DuplicateKeys(String keyName) {
- super(String.format("Duplicate value encountered for key '%s'", keyName));
- }
- }
-
- /**
- * Exception thrown when a line is formattted incorrectly.
- * @author Ben Culkin
- *
- */
- public static class InvalidLineFormat extends RuntimeException {
- private static final long serialVersionUID = 5332131472090792841L;
-
- /**
- * Create a new exception for an incorrectly formatted line.
- * @param lne The line that was incorrectly formatted.
- */
- public InvalidLineFormat(String lne) {
- super(String.format(
- "Line '%s' is improperly formatted.\n\tExpected format is a string key, followed by a single space, followed by the value",
- ""));
- }
- }
-
private final Map<String, String> props;
/**
@@ -170,20 +131,17 @@ public class SimpleProperties implements Map<String, String> {
return props.isEmpty();
}
- @SuppressWarnings("unlikely-arg-type")
- @Override
+ @Override
public boolean containsKey(final Object key) {
return props.containsKey(key);
}
- @SuppressWarnings("unlikely-arg-type")
- @Override
+ @Override
public boolean containsValue(final Object value) {
return props.containsValue(value);
}
- @SuppressWarnings("unlikely-arg-type")
- @Override
+ @Override
public String get(final Object key) {
return props.get(key);
}
@@ -193,8 +151,7 @@ public class SimpleProperties implements Map<String, String> {
return props.put(key, value);
}
- @SuppressWarnings("unlikely-arg-type")
- @Override
+ @Override
public String remove(final Object key) {
return props.remove(key);
}
diff --git a/base/src/main/java/bjc/utils/ioutils/blocks/SerialBlockReader.java b/base/src/main/java/bjc/utils/ioutils/blocks/SerialBlockReader.java
index 265a781..9617ebd 100644
--- a/base/src/main/java/bjc/utils/ioutils/blocks/SerialBlockReader.java
+++ b/base/src/main/java/bjc/utils/ioutils/blocks/SerialBlockReader.java
@@ -102,6 +102,8 @@ public class SerialBlockReader implements BlockReader {
@Override
public void close() throws IOException {
while (!readerQueue.isEmpty()) {
+ // We are explicitly closing these
+ @SuppressWarnings("resource")
final BlockReader reader = readerQueue.pop();
reader.close();
diff --git a/base/src/main/java/bjc/utils/ioutils/blocks/package-info.java b/base/src/main/java/bjc/utils/ioutils/blocks/package-info.java
index 3d05ed4..d321725 100644
--- a/base/src/main/java/bjc/utils/ioutils/blocks/package-info.java
+++ b/base/src/main/java/bjc/utils/ioutils/blocks/package-info.java
@@ -2,16 +2,16 @@
* is structured as a series of 'blocks' or records.
* <p>
*
- * The most fundamental unit here is that of {@link Block}. Each {@link
- * BlockReader} will yield a sequence of these, which contain a piece of text
+ * The most fundamental unit here is that of {@link bjc.utils.ioutils.blocks.Block}. Each {@link
+ * bjc.utils.ioutils.blocks.BlockReader} will yield a sequence of these, which contain a piece of text
* as its contents, as well as the beginning/ending line for that block.
*
- * There are a number of different types of {@link BlockReader}, which are
+ * There are a number of different types of {@link bjc.utils.ioutils.blocks.BlockReader}, which are
* summarized here.
* </p>
*
* <dl>
- * <dt>{@link SimpleBlockReader}</dt>
+ * <dt>{@link bjc.utils.ioutils.blocks.SimpleBlockReader}</dt>
* <dd>
* The most basic form of BlockReader. This uses a regular expression to
* delimit input reader from a {@link Reader} into a series of blocks.