This class provides utilities for parsing ints to parameter values, vice versa, and more. It is a way of isolating the "mixed radix" (Knuth's term, not mine) math that's done on parameters, points and so forth.
This is not necessarily threadsafe as 2 threads could access a single method at the same time and "warp" eachothers short[] values. To make it threadsafe, just add a synchronized clause to each method. I haven't done that here because it will slow things down (even with only 1 thread, not because of bottle necking but because of the synchronization process in java). Also, if methods are introduced that deal with local variables, you might need to add a synchronized(this) in those methdods.
One general pattern in this class is that methods take an order, bases, and parameterValues or int argument. The bases argument is a short[] of the bases of parameters, IN DEFAULT ORDER. These are typically retrieved from the DataInfo class which keep the bases in default order, thus the methods in here always assume the bases argument has the bases in default order. The parameterValues however are considered to be in the order of the short[] order parameter. This is very important. That said, given a particular order, in order to create an in from parameter values, or vice versa, one must consider the bases in that particular order, and the parameter values in that particular order. Thus, the methods in here (since they consider bases to always be in default order) will typically reorder bases, perform computation, and then return the result. Sometimes, if the result is parameter values, the methods in here will reorder them to be in default order, like the bases when passed in.
@author John T. Langton - jlangton at visitrend dot com
|
|
|
|