How to determine which components are sticks and which are not?

I’m trying to make buttons map, asking a user to press a button. And it works correctly with gamepads without sticks. But the ones with sticks are the issue. First of all, here is the code I use to ask user to press a button:



enum PAD {
    UP("up"),
    DOWN("down"),
    LEFT("left"),
    RIGHT("right"),
    START("start"),
    SELECT("select"),
    A("a"),
    B("b");

    //...
}

for(PAD element : PAD.values()) {
    System.out.println("Enter " + element.getValue() + " button: ");

    boolean isComponentInited = false;

     while (!isComponentInited) {
         device.poll();
         for (Component component : device.getComponents()) {
             float componentValue = component.getPollData();
             if((componentValue > 0 && componentValue <= 1.0f) || (componentValue == -1.0f)) {
                 System.out.println(element.getValue() + " entered: " + component.getName() + " : " + component.getIdentifier().getName() + " : " + component.getPollData());

                 isComponentInited = true;
                 break;
            }
        }
        Thread.sleep(250);
    }
}

When I use gamepad without sticks this code works good. When I use gamepad with sticks, this code fills all values with Y component that is analog stick. It doesn’t have 0.0 value in still state. So I want to exclude sticks (until I learn how to work with skicks) from polling. How to do it? How to determine which components are sticks and which ones are D-pad (on gamepad without sticks, D-pad consists of two components - x and y which also don’t have 0.0 value in still state)?

I tried to check components with “isAnalog()”, but simple gamepad without sticks marks x and y components as analog, but they are related to D-pad.

And one more question: what is better timeout (Thread.sleep()) between polls? 250ms work almost good for me, but from time to time it doesn’t determine buttons press at once and user has to press button twice. Without this timeout, one button press inits all the button’s map.