KD8RHO Utility Library
This is the KD8RHO utility library, designed to make commonly used methods more simple to use
Current Version: 1.9.1
Utility class methods static
TextMenu chainable. Added
Utility class with small number of non-class-based convenience methods.
CommandLineArgument classes for dealing with command line arguments. Made SJIO method-chainable.
1.8.2 Fixed errors with get*() from
SJIO causing the input to wait for an extra line...
Web class now stores last HTTP error it got. This allows the error to be retrieved by any application using the library
PairedList (docs) class
This class stores a pair of
ArrayLists, allowing you to compare two lists.
Changed capitalization of
Web class. This will break old code.
getPreference to Preferences.java.
Annotation changes to Preferences.java.
SJIO to use system line separator when printing out.
Name class to data
1.7.3 Minor bugfix for missing else in Preference
Fix bug with
getInt in SJIO not behaving properly.
Fix bug with
Preference not writing as it should.
Preference JavaDocs and Annotations
1.7 Added Preferences class to store and deal with user preferences
1.6.4: Added TextMenu.findOption() to find an option
NoClassDefError when initializing SJIO on Android devices (or contexts without the VM Manager class)
Added auto-log ability to
SJIO. Also added ability to set debug mode (for uses where debug mode may not work such as Android)
Added contingency for escape characters in the log
writeToLogFile. Added ability to print output to log file
1.6.1 Allowed ability to set SJFIO charset. Default is UTF-8.
Assorted cleanup for Credential.java
Assorted cleanup for SJFIO.java
Assorted cleanup for SJIO.java
Assorted cleanup for TextMenu.java
Assorted cleanup for web.java
Added ability to get logfile location from
SJIO (SJ Input/Output) is a library which wraps
It also implements error checking and input validation
SJIO io=new SJIO();
io.writeLine("This writes a String");
int input=io.getInt();//This will get an int without any kind of prompt.
int input2=io.promptInt("Please input an int","Please input a valid int");//This will ask for an int, displaying the second string if a valid int is not found
int input3=io.promptInt("Please input an int between 2 and 3","Please input a valid int between 2 and 3",2,3)//This will ask for an int and verify it's between 2 and 3
int input4=io.promptInt("Please input an intbetween 1 and 5, or input -1 to exit","Please input a valid response",">0&<6|=-1")//This will ask for an int and verify it using a format string
Format Strings are number verifications. There are 4 possible operators:
!:Not equal to
Formats can be chained using
A complex format string can be built using these directives, for example:
TextMenu is a text-based menu builder designed to build "main menus" and other text-based menus. Input validation is done automatically, allowing for very simple code.
TextMenu menu=new TextMenu("Main Menu",new String "Hello world","Exit");
1. Hello World
The Web library is a library designed to allow for easy reading of webpages into text files.
The web library will handle exceptions and return only an error message or valid data to the user. It can also use http authentication to log in prior to downloading.
returns the contents of textfile.txt as an