} catch (ArrayIndexOutOfBoundsException) { System.out.println("Tried to get data for axis: " + this.getName() + ", device.data[" + offset + "] does not exists as device.data is only " + device.data.length + " long.")
} catch (ArrayIndexOutOfBoundsException e) { System.out.println("Tried to get data for axis: " + this.getName() + ", device.data[" + offset + "] does not exists as device.data is only " + device.data.length + " long.");
    public float getPollData() {        int data = 0;        try {            data = ((device.data[offset] >> bitshift)&bitmask);        } catch (ArrayIndexOutOfBoundsException) {            System.out.println("Tried to get data for axis: " + this.getName() + ", device.data[" + offset + "] does not exists as device.data is only " + device.data.length + " long.")        }        if ((type&DIDFT_BUTTON) != 0 ) {            return (float)((data&0x80)>>7);        }  else if ((type&DIDFT_AXIS)!=0){ // all axes are set for -32768 to 32738            return ((float)data)/32768;        } else if ((type&DIDFT_POV)!=0) {            if (data == -1) {                return Component.POV.OFF;            } else if (data == 0.0) {                return Component.POV.UP;            } else if (data == 4500) {                return Component.POV.UP_RIGHT;            } else if (data == 9000) {                return Component.POV.RIGHT;            } else if (data == 13500) {                return Component.POV.DOWN_RIGHT;            } else if (data == 18000) {                return Component.POV.DOWN;            } else if (data == 22500) {                return Component.POV.DOWN_LEFT;            } else if (data == 27000) {                return Component.POV.LEFT;            } else if (data == 31500) {                return Component.POV.UP_LEFT;            } else {                System.err.print("Unexpected value for DX8 HAT: "+data);                return Component.POV.OFF;            }        } else { // return raw value            return (float)data;        }              }