Package java.util

Examples of java.util.ArrayList.indexOf()


    al.add(i, testObject);
    int location = al.indexOf(testObject);
    try {
      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));
    } catch (Exception e) {
      fail("Exception during test : " + e.getMessage());
View Full Code Here

      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));
    } catch (Exception e) {
      fail("Exception during test : " + e.getMessage());
    }
  }
View Full Code Here

            cuidCnt = new int[copyCuids.size()];
   
            Iterator itr = copyDelivered.values().iterator();
            while (itr.hasNext()) {
                ackEntry e = (ackEntry)itr.next();
                int indx = copyCuids.indexOf(e.getConsumerUID());
                if (indx == -1)
                    continue;
                 else
                     cuidCnt[indx] ++;
            }
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

        TreeSet sortedSet = new TreeSet(mapValues);
        Object[] sortedArray = sortedSet.toArray();
        int size = sortedArray.length;

        for (int j=0; j<size; j++) {
           mapAux.put(mapKeys.get(mapValues.indexOf(sortedArray[j])), sortedArray[j]);
        }

        Set ref = mapAux.keySet();
        Iterator it = ref.iterator();
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

        {
            Plugin currentPlugin = (Plugin) it.next();

            if ( normalized.contains( currentPlugin ) )
            {
                int idx = normalized.indexOf( currentPlugin );
                Plugin firstPlugin = (Plugin) normalized.get( idx );

                // MNG-3719: merge currentPlugin with firstPlugin as parent,
                // then use updated currentPlugin as new parent
                mergePluginDefinitions( currentPlugin, firstPlugin, false );
View Full Code Here

              stringsToInsert.add(str);
            } else if (doStarImport && !currDecl.isOnDemand()) {
              String simpleName = currDecl.getTypeQualifiedName();
              if (simpleName.indexOf('.') != -1) {
                String str= getNewImportString(currDecl.getElementName(), isStatic, lineDelim);
                if (stringsToInsert.indexOf(str) == -1) {
                  stringsToInsert.add(str);
                }
              }
            }
          } else if (!doStarImport || currDecl.isOnDemand() || onDemandConflicts == null || onDemandConflicts.contains(currDecl.getSimpleName())) {
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.