Code example for FieldPosition

Methods: getEndIndexsetBeginIndexsetEndIndex

0
                -1, fpos.getBeginIndex());
    } 
 
    public void test_setEndIndexI() { 
        // Test for method void java.text.FieldPosition.setEndIndex(int) 
        FieldPosition fpos = new FieldPosition(1);
        fpos.setEndIndex(3);
        fpos.setBeginIndex(2);
        assertEquals("EndIndex should have been set to 3", 3, fpos
                .getEndIndex());
 
        fpos.setEndIndex(Integer.MAX_VALUE);
        assertEquals("endIndex should have been set to Integer.MAX_VALUE",
                Integer.MAX_VALUE, fpos.getEndIndex());
 
        fpos.setEndIndex(-1);
        assertEquals("endIndex should have been set to -1",
                -1, fpos.getEndIndex());
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java