Thread: Number Cloning
View Single Post
  #1 (permalink)  
Old 11-29-2006, 08:25 PM
Ronin Ronin is online now
Programming Professional
 
Join Date: Apr 2006
Posts: 299
Rep Power: 11
Ronin is on a distinguished road
Default Number Cloning

I get a "Type mismatch: cannot convert from Object to Number" error when using this code below:


Code:
public class ConvolutionMatrixSetting {
   private Number [][] coefficients;
   private Number scale;
   private Number offset;
   private int height;
   private int width;
   private String name;

   public ConvolutionMatrixSetting(String name, Number[][] coefficients,
Number scale, Number offset){
     this.name = name;

     height = coefficients.length;
     width  = coefficients[0].length;

     coefficients = new Number[height][width];
     System.arraycopy(coefficients, 0, this.coefficients, 0, height);

     this.scale = scale.clone(); // DOES NOT WORK
     this.offset = offset.clone(); // DOES NOT WORK
   }
Reply With Quote

Sponsored Links