com.partnersoft.v3x.data
Class DataLib

java.lang.Object
  extended by com.partnersoft.v3x.data.DataLib

public class DataLib
extends java.lang.Object

Some handy data-mangling routines.


Constructor Summary
DataLib()
           
 
Method Summary
static void addToMapFromLists(java.util.List keys, java.util.List values, java.util.Map victim)
          Same as makeMapFromLists except you get to supply your own Map.
static void addToMapFromListsNoQuestions(java.util.List keys, java.util.List values, java.util.Map victim)
          Same as makeMapFromLists except you get to supply your own Map and it does it's best to cram the damn things together.
static boolean coerceToBoolean(java.lang.Object victim)
           
static java.util.HashMap makeMapFromLists(java.util.List keys, java.util.List values)
          Takes two lists of identical length.
static java.util.ArrayList makeValueListFromMap(java.util.Map source, java.util.Collection keyOrder)
          Turns a Map into an ArrayList containing just values, using the given ordered list of keys to determine the order of the values.
static double setPrecision(double victim, int places)
          Reduces the precision of a doubleing-point number by rounding it to a specified number of decimal places.
static float setPrecision(float victim, int places)
          Reduces the precision of a floating-point number by rounding it to a specified number of decimal places.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataLib

public DataLib()
Method Detail

makeMapFromLists

public static java.util.HashMap makeMapFromLists(java.util.List keys,
                                                 java.util.List values)
Takes two lists of identical length. One has keys, one has values. Makes HashMap from them.


addToMapFromLists

public static void addToMapFromLists(java.util.List keys,
                                     java.util.List values,
                                     java.util.Map victim)
Same as makeMapFromLists except you get to supply your own Map. Joy!


addToMapFromListsNoQuestions

public static void addToMapFromListsNoQuestions(java.util.List keys,
                                                java.util.List values,
                                                java.util.Map victim)
Same as makeMapFromLists except you get to supply your own Map and it does it's best to cram the damn things together. Joy!


makeValueListFromMap

public static java.util.ArrayList makeValueListFromMap(java.util.Map source,
                                                       java.util.Collection keyOrder)
Turns a Map into an ArrayList containing just values, using the given ordered list of keys to determine the order of the values. Keys not in the keyOrder list are ignored and thus do not appear in the result.


setPrecision

public static double setPrecision(double victim,
                                  int places)
Reduces the precision of a doubleing-point number by rounding it to a specified number of decimal places.


setPrecision

public static float setPrecision(float victim,
                                 int places)
Reduces the precision of a floating-point number by rounding it to a specified number of decimal places.


coerceToBoolean

public static boolean coerceToBoolean(java.lang.Object victim)