/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.test.webservice.marshalltest.types;

import java.util.Arrays;

// $Id: DoubleArr.java,v 1.2.2.1 2004/10/24 19:12:34 tdiesler Exp $

/**
 * Created by IntelliJ IDEA.
 *
 * @author Thomas.Diesler@jboss.org
 * @since 24-Sep-2004
 */
public class DoubleArr
{
   private double[] doubleArr;

   public DoubleArr()
   {
   }

   public DoubleArr(double[] doubleArr)
   {
      this.doubleArr = doubleArr;
   }

   public double[] getDoubleArr()
   {
      return doubleArr;
   }

   public void setDoubleArr(double[] doubleArr)
   {
      this.doubleArr = doubleArr;
   }

   public boolean equals(Object obj)
   {
      return toString().equals("" + obj);
   }

   public String toString()
   {
      if (doubleArr != null)
      {
         StringBuffer ret = new StringBuffer("[");
         for (int i = 0; i < doubleArr.length; i++)
         {
            double val = doubleArr[i];
            ret.append(i == 0 ? "" + val : "," + val);
         }
         ret.append("]");
         return ret.toString();
      }
      else
      {
         return "[]";
      }
   }
}
