Package java.util

Examples of java.util.List.indexOf()


        List fields = collection.getFields();
        assertFalse(fields.isEmpty());
        assertEquals(1, fields.size());
       
        Field f = ClassA.class.getDeclaredField("m");
        assertTrue(fields.indexOf(f) >= 0);
    }
   
   
    public void testResourceAnnotations ()
    throws Exception
View Full Code Here


        List methods = collection.getMethods();
        assertTrue(methods!=null);
        assertFalse(methods.isEmpty());
        assertEquals(methods.size(), 4);
        Method m = ClassB.class.getDeclaredMethod("a", new Class[] {});      
        assertTrue(methods.indexOf(m) >= 0);
        Sample s = (Sample)m.getAnnotation(Sample.class);
        assertEquals(51, s.value());
        m = ClassA.class.getDeclaredMethod("a", new Class[] {});
        assertTrue(methods.indexOf(m) < 0); //check overridden public scope superclass method not in there
       
View Full Code Here

            String widthStr = (String) tableColumnProperties.getAttribute("column-width");
            widthStr = widthStr.substring(0, widthStr.indexOf(getUnitsOfMeasure(widthStr)));
            addColumnWidthToRowBoundaryMarker(Float.parseFloat(widthStr));
            ColumnBoundary currentRowBoundary = new ColumnBoundary(getCurrentRowBoundaryMarker());
            final List columnBoundaryList_ = getColumnBoundaryList();
            final int idx = columnBoundaryList_.indexOf(currentRowBoundary);
            if (idx == -1)
            {
                columnBoundaryList_.add(currentRowBoundary);
            }
            else
View Full Code Here

        }
    }

    public static void assertBefore(Object before, Object after, LinkedHashSet set) {
        List list = new ArrayList(set);
        int beforeIndex = list.indexOf(before);
        assertTrue("Expected " + before + " to be contained in the list " + list,
                beforeIndex >= 0);

        int afterIndex = list.indexOf(after);
        assertTrue("Expected " + after + " to be contained in the list " + list,
View Full Code Here

        List list = new ArrayList(set);
        int beforeIndex = list.indexOf(before);
        assertTrue("Expected " + before + " to be contained in the list " + list,
                beforeIndex >= 0);

        int afterIndex = list.indexOf(after);
        assertTrue("Expected " + after + " to be contained in the list " + list,
                afterIndex >= 0);

        assertTrue("Expected " + before + " to be before " + after + " in the list " + list,
                beforeIndex < afterIndex);
View Full Code Here

        //final int[] indexes = new int[declarations.length];
        final Integer[] indexes = new Integer[declarations.length];

        final Boolean[] notPatterns = new Boolean[declarations.length];
        for ( int i = 0, length = declarations.length; i < length; i++ ) {
            indexes[i] = new Integer( list.indexOf( declarations[i] ) );
            notPatterns[i] = (declarations[i].getExtractor() instanceof PatternExtractor) ? Boolean.FALSE : Boolean.TRUE ;
            if ( (indexes[i]).intValue() == -1 ) {
                context.getErrors().add( new DescrBuildError( context.getParentDescr(),
                                                              ruleDescr,
                                                              null,
View Full Code Here

     */
    public int findValue(String column, Object value)
    {
        List list = (List) data.get(column);
        int ret = -1;
        ret = list.indexOf(value);
        return ret;
    }

    /**
     * Sets the value in the Data set at the current row, using a column name
View Full Code Here

        Iterator iterator = list2.iterator();
        while (iterator.hasNext()) {
            Object element = iterator.next();
            assertEquals("indexOf should return correct result",
                list1.indexOf(element), list2.indexOf(element));
            verify();
        }

        Object[] other = getOtherElements();
        for (int i = 0; i < other.length; i++) {
View Full Code Here

        l.add("2");
        l.add("3");
        l.add("4");
        l.add("5");
        l.add("6");
        assertEquals(0, l.indexOf("0"));
        assertEquals(1, l.indexOf("1"));
        assertEquals(2, l.indexOf("2"));
        assertEquals(3, l.indexOf("3"));
        assertEquals(4, l.indexOf("4"));
        assertEquals(5, l.indexOf("5"));
View Full Code Here

        l.add("3");
        l.add("4");
        l.add("5");
        l.add("6");
        assertEquals(0, l.indexOf("0"));
        assertEquals(1, l.indexOf("1"));
        assertEquals(2, l.indexOf("2"));
        assertEquals(3, l.indexOf("3"));
        assertEquals(4, l.indexOf("4"));
        assertEquals(5, l.indexOf("5"));
        assertEquals(6, l.indexOf("6"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.