net.jinx.db
Class Configuration

java.lang.Object
  extended by net.jinx.db.Configuration

public class Configuration
extends java.lang.Object

Configuration contains several utility methods for storing configuration-style data in a textual form and for converting various primitive array types into each other. In short, aside from a few utility methods, this class contains helper methods for Hierarchy.

API Stability: Stable.


Method Summary
static java.lang.String decodeElement(java.lang.String property)
          Decodes a String from quoted String form.
static java.lang.String encodeElement(java.lang.String property)
          Encodes a String into a quoted String.
static void load(java.util.Map map, java.io.InputStream inStream)
          Loads data from the inputStream, taking the data in the stream to be in the format this class uses.
static void store(java.util.Map map, java.io.OutputStream outStream)
          Stores a java.util.Map's key-value pairs into an OutputStream in this class's standard format.
static java.math.BigDecimal[] toBigDecimalArray(byte[] a)
           
static java.math.BigDecimal[] toBigDecimalArray(double[] a)
           
static java.math.BigDecimal[] toBigDecimalArray(float[] a)
           
static java.math.BigDecimal[] toBigDecimalArray(int[] a)
           
static java.math.BigDecimal[] toBigDecimalArray(long[] a)
           
static java.math.BigDecimal[] toBigDecimalArray(short[] a)
           
static java.math.BigInteger[] toBigIntegerArray(byte[] a)
           
static java.math.BigInteger[] toBigIntegerArray(double[] a)
           
static java.math.BigInteger[] toBigIntegerArray(float[] a)
           
static java.math.BigInteger[] toBigIntegerArray(int[] a)
           
static java.math.BigInteger[] toBigIntegerArray(long[] a)
           
static java.math.BigInteger[] toBigIntegerArray(short[] a)
           
static byte[] toByteArray(byte[] a)
           
static byte[] toByteArray(double[] a)
           
static byte[] toByteArray(float[] a)
           
static byte[] toByteArray(int[] a)
           
static byte[] toByteArray(long[] a)
           
static byte[] toByteArray(short[] a)
           
static double[] toDoubleArray(byte[] a)
           
static double[] toDoubleArray(double[] a)
           
static double[] toDoubleArray(float[] a)
           
static double[] toDoubleArray(int[] a)
           
static double[] toDoubleArray(long[] a)
           
static double[] toDoubleArray(short[] a)
           
static float[] toFloatArray(byte[] a)
           
static float[] toFloatArray(double[] a)
           
static float[] toFloatArray(float[] a)
           
static float[] toFloatArray(int[] a)
           
static float[] toFloatArray(long[] a)
           
static float[] toFloatArray(short[] a)
           
static int[] toIntArray(byte[] a)
           
static int[] toIntArray(double[] a)
           
static int[] toIntArray(float[] a)
           
static int[] toIntArray(int[] a)
           
static int[] toIntArray(long[] a)
           
static int[] toIntArray(short[] a)
           
static long[] toLongArray(byte[] a)
           
static long[] toLongArray(double[] a)
           
static long[] toLongArray(float[] a)
           
static long[] toLongArray(int[] a)
           
static long[] toLongArray(long[] a)
           
static long[] toLongArray(short[] a)
           
static short[] toShortArray(byte[] a)
           
static short[] toShortArray(double[] a)
           
static short[] toShortArray(float[] a)
           
static short[] toShortArray(int[] a)
           
static short[] toShortArray(long[] a)
           
static short[] toShortArray(short[] a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toBigIntegerArray

public static java.math.BigInteger[] toBigIntegerArray(byte[] a)

toBigIntegerArray

public static java.math.BigInteger[] toBigIntegerArray(short[] a)

toBigIntegerArray

public static java.math.BigInteger[] toBigIntegerArray(int[] a)

toBigIntegerArray

public static java.math.BigInteger[] toBigIntegerArray(long[] a)

toBigIntegerArray

public static java.math.BigInteger[] toBigIntegerArray(float[] a)

toBigIntegerArray

public static java.math.BigInteger[] toBigIntegerArray(double[] a)

toBigDecimalArray

public static java.math.BigDecimal[] toBigDecimalArray(byte[] a)

toBigDecimalArray

public static java.math.BigDecimal[] toBigDecimalArray(short[] a)

toBigDecimalArray

public static java.math.BigDecimal[] toBigDecimalArray(int[] a)

toBigDecimalArray

public static java.math.BigDecimal[] toBigDecimalArray(long[] a)

toBigDecimalArray

public static java.math.BigDecimal[] toBigDecimalArray(float[] a)

toBigDecimalArray

public static java.math.BigDecimal[] toBigDecimalArray(double[] a)

toByteArray

public static byte[] toByteArray(byte[] a)

toByteArray

public static byte[] toByteArray(short[] a)

toByteArray

public static byte[] toByteArray(int[] a)

toByteArray

public static byte[] toByteArray(long[] a)

toByteArray

public static byte[] toByteArray(float[] a)

toByteArray

public static byte[] toByteArray(double[] a)

toShortArray

public static short[] toShortArray(byte[] a)

toShortArray

public static short[] toShortArray(short[] a)

toShortArray

public static short[] toShortArray(int[] a)

toShortArray

public static short[] toShortArray(long[] a)

toShortArray

public static short[] toShortArray(float[] a)

toShortArray

public static short[] toShortArray(double[] a)

toIntArray

public static int[] toIntArray(byte[] a)

toIntArray

public static int[] toIntArray(short[] a)

toIntArray

public static int[] toIntArray(int[] a)

toIntArray

public static int[] toIntArray(long[] a)

toIntArray

public static int[] toIntArray(float[] a)

toIntArray

public static int[] toIntArray(double[] a)

toLongArray

public static long[] toLongArray(byte[] a)

toLongArray

public static long[] toLongArray(short[] a)

toLongArray

public static long[] toLongArray(int[] a)

toLongArray

public static long[] toLongArray(long[] a)

toLongArray

public static long[] toLongArray(float[] a)

toLongArray

public static long[] toLongArray(double[] a)

toFloatArray

public static float[] toFloatArray(byte[] a)

toFloatArray

public static float[] toFloatArray(short[] a)

toFloatArray

public static float[] toFloatArray(int[] a)

toFloatArray

public static float[] toFloatArray(long[] a)

toFloatArray

public static float[] toFloatArray(float[] a)

toFloatArray

public static float[] toFloatArray(double[] a)

toDoubleArray

public static double[] toDoubleArray(byte[] a)

toDoubleArray

public static double[] toDoubleArray(short[] a)

toDoubleArray

public static double[] toDoubleArray(int[] a)

toDoubleArray

public static double[] toDoubleArray(long[] a)

toDoubleArray

public static double[] toDoubleArray(float[] a)

toDoubleArray

public static double[] toDoubleArray(double[] a)

store

public static void store(java.util.Map map,
                         java.io.OutputStream outStream)
                  throws java.io.IOException
Stores a java.util.Map's key-value pairs into an OutputStream in this class's standard format. If a key or a value is null, that pair is ignored. Pairs are also ignored when either is not a String.

Parameters:
map - the java.util.Map to iterate over for key-value pairs.
outStream - the java.io.OutputStream to write lines of text to. The stream is not closed.
Throws:
java.io.IOException - if an I/O error occurs while writing to the stream.
java.lang.NullPointerException - if map or outStream are null.

load

public static void load(java.util.Map map,
                        java.io.InputStream inStream)
                 throws java.io.IOException
Loads data from the inputStream, taking the data in the stream to be in the format this class uses. The key-value pairs are then placed into the given Map as Strings.

Parameters:
map - the java.util.Map to store the data in once it's been parsed.
inStream - the java.io.InputStream to read lines of text from. This stream is read from until the end of file is reached. The stream is not closed.
Throws:
java.io.IOException - if an I/O error occurs reading from the stream.
java.lang.IllegalArgumentException - if the data from the stream is not arranged appropriately.
java.lang.NullPointerException - if map or inStream are null.

encodeElement

public static java.lang.String encodeElement(java.lang.String property)
Encodes a String into a quoted String. Basically, this means that all of the special characters are escaped and the String has double quote characters added to the beginning and end.

Parameters:
property - the String to encode.
Returns:
the quoted version of the String.

decodeElement

public static java.lang.String decodeElement(java.lang.String property)
Decodes a String from quoted String form.

Parameters:
property - the String to decode.
Returns:
the decoded version of the String.