Home » openjdk-7 » java » net » [javadoc | source]
java.net
public class: LinearInterpolator [javadoc | source]
java.lang.Object
   java.net.LinearInterpolator

All Implemented Interfaces:
    Interpolator

This class is an implementation of the Interpolator interface and it uses a statistical approach called fixed point interpolation that I created during my master degree thesis. The transmission line model and the level model are described by a linear curve like the following:
y=A*x+b
The model is composed of two interpolation curve: The model is completed by the preceding sample point. So every model keeps five coefficients: A and B for compression time, A and B for compression ratio, and X for the last sample point. This interpolator keeps a model for the transmission line and a model for every compression level. For a complete description of the approach see my thesis.
Field Summary
protected  double[] line    Data needed to model the transmission line. It's an array composed of five elements. 
protected  double[][] levels    Data needed to model levels. It's an array with the same number of elements as the supported levels and every entry is an array of five elements like the line field. 
protected  int num_levels    The number of supported levels as reported by the compression engine. 
protected static  int At     
protected static  int Bt     
protected static  int Ac     
protected static  int Bc     
protected static  int Xprec     
Constructor:
 public LinearInterpolator() 
 public LinearInterpolator(Integer num) 
    Real constructor.
    Parameters:
    num - the number of supported compression level
Method from java.net.LinearInterpolator Summary:
computeLevel,   create,   destroy,   finalize,   update,   updateLine
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.net.LinearInterpolator Detail:
 public int computeLevel(int dim) 
    This method choose the best level to use to compress data based on an iterative algorithm I did in my thesis. Basically it's a loop starting from the most compressing level downward and during every step it calculates a threshold for the level and compares it with the dimension of the object to compress. If the dimension is over the threshold, the level is selected.
    If you are interested in the mathematical background behind the choice, see my mythesis .
 public boolean create(Integer num) 
    This method is the real constructor and it's responsible for data allocation and initialization.
 public boolean destroy() 
    Entry point for some explicit and synchronous clean up.
 public  void finalize() throws Throwable 
 public boolean update(int level,
    int dim,
    double compress_time,
    double compress_dim,
    double trans_time) 
    This method is responsible for updating the selected level model. If you are interested in the mathematical aspect, see my thesis.
 public boolean updateLine(int dim,
    double trans_time,
    double Xprec) 
    This method is responsible for updating the transmission line model. If you are interested in the mathematical aspect, see my thesis.