Package java.util

Examples of java.util.ArrayList.indexOf()


        }
        al.add(i, testObject);
        int location = al.indexOf(testObject);
        al.ensureCapacity(capacity);
        assertTrue("EnsureCapacity moved objects around in array1.",
                location == al.indexOf(testObject));
        al.remove(0);
        al.ensureCapacity(capacity);
        assertTrue("EnsureCapacity moved objects around in array2.",
                --location == al.indexOf(testObject));
        al.ensureCapacity(capacity + 2);
View Full Code Here


        assertTrue("EnsureCapacity moved objects around in array1.",
                location == al.indexOf(testObject));
        al.remove(0);
        al.ensureCapacity(capacity);
        assertTrue("EnsureCapacity moved objects around in array2.",
                --location == al.indexOf(testObject));
        al.ensureCapacity(capacity + 2);
        assertTrue("EnsureCapacity did not change location.", location == al
                .indexOf(testObject));
    }
View Full Code Here

        al.remove(0);
        al.ensureCapacity(capacity);
        assertTrue("EnsureCapacity moved objects around in array2.",
                --location == al.indexOf(testObject));
        al.ensureCapacity(capacity + 2);
        assertTrue("EnsureCapacity did not change location.", location == al
                .indexOf(testObject));
    }

    /**
     * @tests java.util.ArrayList#get(int)
View Full Code Here

        property = null;
        int index = 0;
        while (propertyEnum.hasMoreElements()) {
            property = (NodeProperty)propertyEnum.nextElement();
            if (DeltavConstants.DELTAV_PROPERTY_LIST.contains(property.getName())) {
                index = initialDeltavProperties.indexOf(property);
                if (index >= 0) {
                    revisionDescriptor.setProperty((NodeProperty)initialDeltavProperties.get(index));
                }
                else {
                    revisionDescriptor.removeProperty(property);
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

            node2 = findParent(seen, node2, path2);

            if (seen.contains(node1)) {
                root = node1;
                ancestors.add(path1.get(path1.size() - 1));
                int idx = path2.indexOf(node1);
                ancestors.add(path2.get(idx > 0 ? idx - 1 : 0));

                break;
            } else if (seen.contains(node2)) {
                root = node2;
View Full Code Here

        // unless we return immediately
        ArrayList list1 = (ArrayList) list.clone();
        while (itr.hasNext()) {
            ListenerInfo info = (ListenerInfo) itr.next();
            if (!listenerOnly && info.id.equals(info1.id)) {
                list1.remove(list1.indexOf(info));
                idlist.add(info.id);
            } else if (listenerOnly && info.listener == listener) {
                list1.remove(list1.indexOf(info));
                idlist.add(info.id);
            }
View Full Code Here

            ListenerInfo info = (ListenerInfo) itr.next();
            if (!listenerOnly && info.id.equals(info1.id)) {
                list1.remove(list1.indexOf(info));
                idlist.add(info.id);
            } else if (listenerOnly && info.listener == listener) {
                list1.remove(list1.indexOf(info));
                idlist.add(info.id);
            }
        }

        listenerMap.put(mbean, list1);
View Full Code Here

            return null;
        itr = list.iterator();
        while (itr.hasNext()) {
            ListenerInfo info = (ListenerInfo) itr.next();
            if (info.id.equals(id)) {
                list.remove(list.indexOf(info));
                Object retObj = null;
                if (getProxy)
                    retObj = info.proxy;
                else
                    retObj = info;
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.