Package java.util

Examples of java.util.ArrayList.indexOf()


            currPos= offset + region.getLength();
          } 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);
              }
            }
          }
        }
View Full Code Here


  if (listeners.size() == 0) {
    JavaCore.addElementChangedListener(this);
  }

  // add listener only if it is not already present
  if (listeners.indexOf(listener) == -1) {
    listeners.add(listener);
  }
}
private static Integer bytesToFlags(byte[] bytes){
  if(bytes != null && bytes.length > 0) {
View Full Code Here

  Object[] fields = entry.fields;
  if (fields.length == 0) {
      ArrayList regs = (ArrayList)serviceByEmptyAttr.get(eclass);
      if (regs == null || (checkDups && hasEmptyAttr(reg, eclass)))
    return;
      int idx = regs.indexOf(reg);
      if (idx >= 0) {
    regs.remove(idx);
    if (regs.isEmpty())
        serviceByEmptyAttr.remove(eclass);
      }
View Full Code Here

      HashMap map = attrMaps[fldidx];
      Object value = fields[fldidx];
      ArrayList regs = (ArrayList)map.get(value);
      if (regs == null)
    continue;
      int idx = regs.indexOf(reg);
      if (idx < 0)
    continue;
      regs.remove(idx);
      if (!regs.isEmpty())
    continue;
View Full Code Here

    HashMap map = addAttr(reg, eclass, fldidx, nval);
    entry.fields[fldidx] = nval;
    if (hasAttr(reg, eclass, fldidx, oval))
        continue;
    ArrayList regs = (ArrayList)map.get(oval);
    regs.remove(regs.indexOf(reg));
    if (regs.isEmpty())
        map.remove(oval); /* map cannot become empty */
      }
  }
    }
View Full Code Here

         if (registrations == null)
            throw new ListenerNotFoundException("No registristrations for listener not listener=" + listener +
                                                " filter=" + filter + " handback=" + handback);

         registration = new DefaultListenerRegistration(listener, filter, handback);
         int index = registrations.indexOf(registration);
         if (index == -1)
            throw new ListenerNotFoundException("Listener not found listener=" + listener +
                                                " filter=" + filter + " handback=" + handback);

         HashMap newListeners = (HashMap) listeners.clone();
View Full Code Here

            getResolveOptions(new String[] {"default"}));

        List revisions = new ArrayList(report.getConfigurationReport("default").getModuleRevisionIds());
        assertTrue("number of revisions is not correct", revisions.size() >= 3);

        int mod12Index = revisions.indexOf(ModuleRevisionId.newInstance("org1", "mod1.2", "1.1"));
        int mod32Index = revisions.indexOf(ModuleRevisionId.newInstance("org3", "mod3.2", "1.4"));
        int mod51Index = revisions.indexOf(ModuleRevisionId.newInstance("org5", "mod5.1", "4.2"));

        // verify the order of the modules in the ivy file
        assertTrue("[ org1 | mod1.2 | 1.1 ] was not found", mod12Index > -1);
View Full Code Here

        List revisions = new ArrayList(report.getConfigurationReport("default").getModuleRevisionIds());
        assertTrue("number of revisions is not correct", revisions.size() >= 3);

        int mod12Index = revisions.indexOf(ModuleRevisionId.newInstance("org1", "mod1.2", "1.1"));
        int mod32Index = revisions.indexOf(ModuleRevisionId.newInstance("org3", "mod3.2", "1.4"));
        int mod51Index = revisions.indexOf(ModuleRevisionId.newInstance("org5", "mod5.1", "4.2"));

        // verify the order of the modules in the ivy file
        assertTrue("[ org1 | mod1.2 | 1.1 ] was not found", mod12Index > -1);
        assertTrue("[ org1 | mod1.2 | 1.1 ] must come before [ org3 | mod3.2 | 1.4 ]", mod12Index < mod32Index);
View Full Code Here

        List revisions = new ArrayList(report.getConfigurationReport("default").getModuleRevisionIds());
        assertTrue("number of revisions is not correct", revisions.size() >= 3);

        int mod12Index = revisions.indexOf(ModuleRevisionId.newInstance("org1", "mod1.2", "1.1"));
        int mod32Index = revisions.indexOf(ModuleRevisionId.newInstance("org3", "mod3.2", "1.4"));
        int mod51Index = revisions.indexOf(ModuleRevisionId.newInstance("org5", "mod5.1", "4.2"));

        // verify the order of the modules in the ivy file
        assertTrue("[ org1 | mod1.2 | 1.1 ] was not found", mod12Index > -1);
        assertTrue("[ org1 | mod1.2 | 1.1 ] must come before [ org3 | mod3.2 | 1.4 ]", mod12Index < mod32Index);
        assertTrue("[ org3 | mod3.2 | 1.4 ] must come before [ org5 | mod5.1 | 4.2 ]", mod32Index < mod51Index);
View Full Code Here

      for (int i = 0; i < values.length; i++)
      {
         List list = Collections.unmodifiableList(Arrays.asList(calculateIndex(values[i])));

         /** check no duplicate keys if there is we have an invalid key */
         if (storeList.contains(list)) throw new KeyAlreadyExistsException("value at [" + i + "] has the same index values as: " + storeList.indexOf(list));

         /** store it to check the next values are not duplicated */
         storeList.add(list);
      }
      return storeList;
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.