We're planning on using the Logitech gamepad to control our arm, and just for the sake of time I've been using the FRC Joystick class. It actually provides all the functionality you need (axes, buttons, etc), but this should make the code more user-friendly, thanks!
Regarding the actual class:
The D-pad is made from a standard x and a y axis (as you know), but each only return either 1 or -1. The if statements (ex: x < -0.5) would more simply be written like if(x = -1).
EDIT: this is not good practice, see below.
I hope you don't mind, attached is a modification of your Gamepad class that adds an enum for button type (top, bottom-left-trigger, etc) and a Get function that uses the new enum. Hopefully that should make the code more user-friendly.
EDIT: Updated attachment to use the original d-pad code (which, as pointed out below, is more portable and better follows convention).
Also, this particular class assumes the
Logitech Dual-Action gamepad with its button enumeration. This should be easy enough to reorder for other gamepads.