/*
 * 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: ShortArr.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 ShortArr
{
   private short[] shortArr;

   public ShortArr()
   {
   }

   public ShortArr(short[] shortArr)
   {
      this.shortArr = shortArr;
   }

   public short[] getShortArr()
   {
      return shortArr;
   }

   public void setShortArr(short[] shortArr)
   {
      this.shortArr = shortArr;
   }

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

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