Package java.util

Examples of java.util.ArrayList.indexOf()


        assertNotNull("No aliases found", aliases);
       
        Alias UTF8Alias = new Alias();
        UTF8Alias.setName("UTF8");
       
        int utf8AliasIndex = aliases.indexOf(UTF8Alias);
       
        Alias a = (Alias) aliases.get(utf8AliasIndex);
        assertNotNull("No aliases found", a);
       
        assertEquals("Incorrect alias in list", a.getName(), "utf8");
View Full Code Here


                ArrayList selectableRoles = new ArrayList(roles);
                Iterator rolesIter = userRoles.iterator();
                while ( rolesIter.hasNext() )
                {
                    Role role = (Role)rolesIter.next();
                    int index = selectableRoles.indexOf(role.getPrincipal().getName());
                    if (index != -1)
                    {
                        selectableRoles.remove(index);
                    }
                }
View Full Code Here

                ArrayList selectableGroups = new ArrayList(groups);
                Iterator groupsIter = userGroups.iterator();
                while ( groupsIter.hasNext() )
                {
                    Group group = (Group)groupsIter.next();
                    int index = selectableGroups.indexOf(group.getPrincipal().getName());
                    if (index != -1)
                    {
                        selectableGroups.remove(index);
                    }
                }
View Full Code Here

         // remove old listeners
         ArrayList copy = new ArrayList(listeners);
         for (int i = 0; i < alertListeners.size(); i++)
         {
            ObjectName oname = (ObjectName)alertListeners.get(i);
            int idx = copy.indexOf(oname);
            if (idx == -1)
            {
               try
               {
                  getServer().removeNotificationListener(getServiceName(), oname);
View Full Code Here

    // Now retrieves the roles of current relation where the MBean
    // was referenced
    roleNames = (ArrayList)(mbeanRefMap.get(relationId));

    // Removes obsolete reference to role
    int obsRefIdx = roleNames.indexOf(roleName);
    if (obsRefIdx != -1) {
        roleNames.remove(obsRefIdx);
    }
      }
View Full Code Here

        s.addAll((Collection) it.next());
      }         
      List all = new ArrayList(s);
      for (int i = 0; i <all.size() ; i++) {
          Object t1 = all.get(i);
          int t1Idx = all.indexOf(t1);
          Collection dependencies = (Collection) m.get(t1);
          if (dependencies != null) {
          for (Iterator it = dependencies.iterator(); it.hasNext();) {
              sb.append("\nws");
              sb.append(t1Idx);
View Full Code Here

          for (Iterator it = dependencies.iterator(); it.hasNext();) {
              sb.append("\nws");
              sb.append(t1Idx);
              sb.append(" = > ");
              sb.append("ws");
              sb.append(all.indexOf(it.next()));
          }         
          }
      }
    return sb.toString();
  }
View Full Code Here

        int i;
        for (i = 0; i < capacity / 2; i++) {
            al.add(i, new Object());
        }
        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);
View Full Code Here

        }
        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

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.