KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > webservice > marshalltest > types > DoubleArr


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.test.webservice.marshalltest.types;
8
9 import java.util.Arrays JavaDoc;
10
11 // $Id: DoubleArr.java,v 1.2.2.1 2004/10/24 19:12:34 tdiesler Exp $
12

13 /**
14  * Created by IntelliJ IDEA.
15  *
16  * @author Thomas.Diesler@jboss.org
17  * @since 24-Sep-2004
18  */

19 public class DoubleArr
20 {
21    private double[] doubleArr;
22
23    public DoubleArr()
24    {
25    }
26
27    public DoubleArr(double[] doubleArr)
28    {
29       this.doubleArr = doubleArr;
30    }
31
32    public double[] getDoubleArr()
33    {
34       return doubleArr;
35    }
36
37    public void setDoubleArr(double[] doubleArr)
38    {
39       this.doubleArr = doubleArr;
40    }
41
42    public boolean equals(Object JavaDoc obj)
43    {
44       return toString().equals("" + obj);
45    }
46
47    public String JavaDoc toString()
48    {
49       if (doubleArr != null)
50       {
51          StringBuffer JavaDoc ret = new StringBuffer JavaDoc("[");
52          for (int i = 0; i < doubleArr.length; i++)
53          {
54             double val = doubleArr[i];
55             ret.append(i == 0 ? "" + val : "," + val);
56          }
57          ret.append("]");
58          return ret.toString();
59       }
60       else
61       {
62          return "[]";
63       }
64    }
65 }
66
Popular Tags