ArrayList axisList = (ArrayList) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1);
Axis lastAxisObject = (Axis) CurrentArray.getAxisList().get(CurrentArray.getAxisList().size()-1);
       public void action (AttributeList attrs) {           //  grab parent node name          String gParentNodeName = getGrandParentNodeName();          // create new object appropriately           Unit newunit = new Unit();          newunit.setXMLAttributes(attrs);          // determine where this goes and then insert it           if( gParentNodeName.equals(XDFNodeName.PARAMETER) )          {              newunit = LastParameterObject.addUnit(newunit);          } else if ( gParentNodeName.equals(XDFNodeName.FIELD) )          {              newunit = LastFieldObject.addUnit(newunit);          } else if ( gParentNodeName.equals(XDFNodeName.AXIS) )          {              ArrayList axisList = (ArrayList) CurrentArray.getAxisList();              Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1);              newunit = lastAxisObject.addUnit(newunit);          } else if ( gParentNodeName.equals(XDFNodeName.ARRAY) )          {              newunit = CurrentArray.addUnit(newunit);          } else {              Log.warnln("Unknown grandparent object, cant add unit, ignoring.");          }          LastUnitObject = newunit;       }