Package java.util

Examples of java.util.TreeMap.containsKey()


                            // throw new IllegalArgumentException("key '" + key + "' missing a value.");
                            continue;
                        }
                        if (m == null) {
                            m = new TreeMap(getKeyComparator());
                        } else if (m.containsKey(key)) {
                            // throw new IllegalArgumentException("key '" + key + "' already has a value.");
                            continue;
                        }
                        m.put(key, value);
                    } while (next() == ITEM_SEPARATOR);
View Full Code Here


            if (equalsPos >= 0) {
                if (variable != null) {
                    throw new IllegalArgumentException("Missing ';' before " + count + ") " + line);
                }
                variable = linePart.substring(0,equalsPos).trim();
                if (variables.containsKey(variable)) {
                    throw new IllegalArgumentException("Duplicate variable definition in " + line);
                }
                definition.append(linePart.substring(equalsPos+1).trim());
            } else { // no equals, so
                if (variable == null) {
View Full Code Here

            // of this package is installed, then skip it.
            if (each.installed || installed.contains(fmri.getName())) {
                continue;
            }

            if (addOnMap.containsKey(fmri.getName())) {
               // We have seen this package name already. See if this
               // version should replace the saved version.
               Fmri saved = addOnMap.get(fmri.getName());
               if (supersedes(fmri, saved, pAuth)) {
                   addOnMap.put(fmri.getName(), fmri);
View Full Code Here

      firstMap.put(s[0], new Integer(c.intValue()+1));
    } else {
      firstMap.put(s[0], new Integer(1));
    }

    if (secondMap.containsKey(s[1])) {
      Integer c = (Integer) secondMap.get(s[1]);
      secondMap.put(s[1], new Integer(c.intValue()+1));
    } else {
      secondMap.put(s[1], new Integer(1));
    }
View Full Code Here

      composeLookupMax = Math.max(composeLookupMax, Integer.parseInt(s[0], 16));
    } else if (second.intValue() == 1) {
      singleSecondComposition.put(s[1], new String[] { s[0], k });
      composeLookupMax = Math.max(composeLookupMax, Integer.parseInt(s[1], 16));
    } else {
      if (complexComposition.containsKey(s[0])) {
        TreeMap m = (TreeMap) complexComposition.get(s[0]);
        if (m.containsKey(s[1])) {
    System.err.println("? ambiguous canonical mapping for "+s[0]);
    System.exit(1);
        }
View Full Code Here

      singleSecondComposition.put(s[1], new String[] { s[0], k });
      composeLookupMax = Math.max(composeLookupMax, Integer.parseInt(s[1], 16));
    } else {
      if (complexComposition.containsKey(s[0])) {
        TreeMap m = (TreeMap) complexComposition.get(s[0]);
        if (m.containsKey(s[1])) {
    System.err.println("? ambiguous canonical mapping for "+s[0]);
    System.exit(1);
        }
        m.put(s[1], k);
      } else {
View Full Code Here

    maxIndex = Math.max(maxIndex, ((Integer) indices.get(s1i)).intValue());
  }

  w.print("    { ");
  for (int j = multiSecondStart; j <= maxIndex; j++) {
    if (line.containsKey(new Integer(j))) {
      String s = (String) line.get(new Integer(j));
      w.print("'"+toJavaString(s)+"', ");
    } else {
      w.print("       0, ");
    }
View Full Code Here

            }
            String attValue = tag.getAttributeValue(attName);
            assertNotNull(attName + " attribute of " + tagName, attValue);
            assertNotSame(attName + " attribute of " + tagName, 0, attValue.length());
            assertFalse("More than one " + tagName + " contains " + attName
                    + "=" + attValue, elems.containsKey(attValue));
            elems.put(attValue, tag);
        }
        return elems;
    }
View Full Code Here

                String text = tag.asText();
                assertNotSame(
                        "expect validation message to start with component id",
                        -1, text.indexOf(": "));
                String id = text.substring(0, text.indexOf(": ")).trim();
                assertFalse("Duplicate message for input " + id, elems
                        .containsKey(id));
                elems.put(id, tag);
            }
        }
        return elems;
View Full Code Here

            for ( Iterator it = childPlugins.values().iterator(); it.hasNext(); )
            {
                ReportPlugin childPlugin = (ReportPlugin) it.next();

                if ( !assembledPlugins.containsKey( childPlugin.getKey() ) )
                {
                    assembledPlugins.put( childPlugin.getKey(), childPlugin );
                }
            }
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.