diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-04-13 18:36:26 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-04-13 18:36:26 -0400 |
| commit | 10b6688ef898285924026e695240a1de2f332bcb (patch) | |
| tree | 8985098d4b7006908b91581f8c94ed2d5fbb2eec /src/main | |
| parent | a3634be021e5f51d20bc2c6c010578f37c82e5a8 (diff) | |
Add some javadoc
Add some javadoc comments
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/java/bjc/everge/Everge.java | 16 | ||||
| -rw-r--r-- | src/main/java/bjc/everge/LogStream.java | 29 |
2 files changed, 44 insertions, 1 deletions
diff --git a/src/main/java/bjc/everge/Everge.java b/src/main/java/bjc/everge/Everge.java index a3f66b6..f061200 100644 --- a/src/main/java/bjc/everge/Everge.java +++ b/src/main/java/bjc/everge/Everge.java @@ -68,18 +68,34 @@ public class Everge { */ private LogStream errStream = new LogStream(System.err); + /** + * Set the output stream. + * @param out The output stream.. + */ public void setOutput(PrintStream out) { outStream = out; } + /** + * Set the output stream. + * @param out The output stream.. + */ public void setOutput(OutputStream out) { outStream = new PrintStream(out); } + /** + * Set the error stream. + * @param err The error stream. + */ public void setError(PrintStream err) { errStream = new LogStream(err); } + /** + * Set the error stream. + * @param err The error stream. + */ public void setError(OutputStream err) { errStream = new LogStream(new PrintStream(err)); } diff --git a/src/main/java/bjc/everge/LogStream.java b/src/main/java/bjc/everge/LogStream.java index 9bc5a43..f4dd217 100644 --- a/src/main/java/bjc/everge/LogStream.java +++ b/src/main/java/bjc/everge/LogStream.java @@ -73,26 +73,48 @@ public class LogStream { verbosity = level; } + /** + * Get the verbosity of the stream. + * @return The verbosity of the stream. + */ public int verbosity() { return verbosity; } + /** + * Set the verbosity of the stream. + * @param verb The verbosity of the stream. + */ public void verbosity(int verb) { verbosity = verb; } + /** + * Increment the verbosity of the stream. + */ public void louder() { louder(1); } + /** + * Increase the verbosity of the stream by an amount. + * @param amt The amount to increase the verbosity by. + */ public void louder(int amt) { verbosity += amt; } - + + /** + * Decrement the verbosity of the stream. + */ public void quieter() { quieter(1); } + /** + * Decrease the verbosity of the stream by an amount. + * @param amt The amount to decrease the verbosity by. + */ public void quieter(int amt) { verbosity -= amt; } @@ -120,6 +142,11 @@ public class LogStream { output.printf(msg, args); } + /** + * Print a message at a given verbosity level. + * @param lvl The verbosity level. + * @param msg The message to print. + */ public void message(int lvl, String msg) { if (verbosity >= lvl) { output.print(msg); |
