} else if (type == SHORT_DATA_TYPE) { longDataArray.set(longIndex+1, new short [shortAxisSize]); } else if (type == LONG_DATA_TYPE) { longDataArray.set(longIndex+1, new long [shortAxisSize]);
   private void checkDataArrayBounds (int longIndex, int shortIndex, int type)   throws SetDataException   {      if (shortIndex < 0 || longIndex < 0)       {         throw new SetDataException("Cant set data: passed locator/axes dont belong to this array?");      }      // Does the location exist yet? If not, create the primative arrays       // that lie along the short axis      // int shortAxisSize = getShortAxis().getLength();      int shortAxisSize = parentArray.getShortAxisSize();      if (shortAxisSize < 1) { shortAxisSize = 1; }      // is the long array too small?      if (longDataArray.size() < (longIndex+1)) {         int maxDeclLongArraySize = getMaxLongArraySize(); // should be held in private var         int expandSize = longIndex > maxDeclLongArraySize ? longIndex : maxDeclLongArraySize;         expandSize *= expandFactor; // add in additional amount to prevent us from doing this too much         expandLongArray(expandSize);      }      // is the short array too small? has it been init'd even yet?       // we perform checks here..      if (longDataArray.get(longIndex) == null) {         // init/create the short array          longDataArray.set(  longIndex, new byte[shortAxisSize]);         if (type == DOUBLE_DATA_TYPE) {            longDataArray.set(longIndex+1, new double [shortAxisSize]);         } else if (type == INT_DATA_TYPE) {            longDataArray.set(longIndex+1, new int [shortAxisSize]);         } else if (type == BYTE_DATA_TYPE) {            longDataArray.set(longIndex+1, new byte [shortAxisSize]);         } else if (type == SHORT_DATA_TYPE) {            longDataArray.set(longIndex+1, new short [shortAxisSize]);         } else if (type == LONG_DATA_TYPE) {            longDataArray.set(longIndex+1, new long [shortAxisSize]);         } else if (type == STRING_DATA_TYPE) {            longDataArray.set(longIndex+1, new String [shortAxisSize]);         }      } else {        int currentShortAxisSize = getLongDataArraySize(longIndex, type);         // requested short axis location not exist?         if (currentShortAxisSize <= shortIndex) {            // should flag the user that need to add AxisValue first            if (shortIndex > shortAxisSize) {               throw new SetDataException("Error: axis lacks an AxisValue at location requested in setData().");            } else {               // add in short axis location to local short array(s)                int newsize = shortIndex+1; // need to add one for case of 1-D                newsize *= expandFactor; // expand short axis by expandFactor // Log.debugln("Expanding short array at longIndex:"+longIndex+" to "+newsize);               longDataArray.set(longIndex, expandArray((byte []) longDataArray.get(longIndex), newsize));               if (type == DOUBLE_DATA_TYPE) {                   longDataArray.set(longIndex+1, expandArray((double[]) longDataArray.get(longIndex+1), newsize));                } else if (type == INT_DATA_TYPE) {                   longDataArray.set(longIndex+1, expandArray((int[]) longDataArray.get(longIndex+1), newsize));                } else if (type == BYTE_DATA_TYPE) {                   longDataArray.set(longIndex+1, expandArray((byte[]) longDataArray.get(longIndex+1), newsize));                } else if (type == SHORT_DATA_TYPE) {                   longDataArray.set(longIndex+1, expandArray((short[]) longDataArray.get(longIndex+1), newsize));                } else if (type == LONG_DATA_TYPE) {                   longDataArray.set(longIndex+1, expandArray((long []) longDataArray.get(longIndex+1), newsize));                } else if (type == STRING_DATA_TYPE) {                   longDataArray.set(longIndex+1, expandArray((String []) longDataArray.get(longIndex+1), newsize));                }            }         }      }   }