Package java.util.Map

Examples of java.util.Map.Entry


        }
    }

    public boolean matches(Map/* <String,String> */m) {
        for (Iterator iter = matchers.entrySet().iterator(); iter.hasNext();) {
            Entry entry = (Entry) iter.next();

            Matcher matcher = (Matcher) entry.getValue();
            String value = (String) m.get(entry.getKey());
            if ((value == null) || !matcher.matches(value)) {
                return false;
            }
        }

View Full Code Here


                    + ": '" + md.getStatus() + "'");
            errors.append("bad status: '" + md.getStatus() + "'; ");
            ok = false;
        }
        for (Iterator it = mrid.getExtraAttributes().entrySet().iterator(); it.hasNext();) {
            Entry extra = (Entry) it.next();
            if (extra.getValue() != null
                    && !extra.getValue().equals(md.getExtraAttribute((String) extra.getKey()))) {
                String errorMsg = "bad " + extra.getKey() + " found in " + ivyRef.getResource()
                        + ": expected='" + extra.getValue() + "' found='"
                        + md.getExtraAttribute((String) extra.getKey()) + "'";
                Message.error("\t" + getName() + ": " + errorMsg);
                errors.append(errorMsg + ";");
                ok = false;
            }
        }
View Full Code Here

  protected String getReport() {
    StringBuffer sb = new StringBuffer();

    Iterator iter = this.longCounters.entrySet().iterator();
    while (iter.hasNext()) {
      Entry e = (Entry) iter.next();
      sb.append(e.getKey().toString()).append("\t").append(e.getValue())
        .append("\n");
    }
    iter = this.doubleCounters.entrySet().iterator();
    while (iter.hasNext()) {
      Entry e = (Entry) iter.next();
      sb.append(e.getKey().toString()).append("\t").append(e.getValue())
        .append("\n");
    }
    return sb.toString();
  }
View Full Code Here

   */
  public String getReportDetails() {
    StringBuffer sb = new StringBuffer();
    Iterator iter = items.entrySet().iterator();
    while (iter.hasNext()) {
      Entry en = (Entry) iter.next();
      Object val = en.getKey();
      Long count = (Long) en.getValue();
      sb.append("\t").append(val.toString()).append("\t").append(
                                                                 count.longValue()).append("\n");
    }
    return sb.toString();
  }
View Full Code Here

  public ArrayList getCombinerOutput() {
    ArrayList retv = new ArrayList();
    Iterator iter = items.entrySet().iterator();

    while (iter.hasNext()) {
      Entry en = (Entry) iter.next();
      Object val = en.getKey();
      Long count = (Long) en.getValue();
      retv.add(new Text(val.toString() + "\t" + count.longValue()));
    }
    return retv;
  }
View Full Code Here

   */
  public ArrayList<Entry> generateKeyValPairs(Object key, Object val) {
    ArrayList<Entry> retv = new ArrayList<Entry>();
    String countType = LONG_VALUE_SUM;
    String id = "record_count";
    Entry e = generateEntry(countType, id, ONE);
    if (e != null) {
      retv.add(e);
    }
    if (this.inputFile != null) {
      e = generateEntry(countType, this.inputFile, ONE);
View Full Code Here

    Iterator iter = this.aggregatorDescriptorList.iterator();
    while (iter.hasNext()) {
      ValueAggregatorDescriptor ad = (ValueAggregatorDescriptor) iter.next();
      Iterator<Entry> ens = ad.generateKeyValPairs(key, value).iterator();
      while (ens.hasNext()) {
        Entry en = ens.next();
        output.collect((WritableComparable) en.getKey(), (Writable) en
                       .getValue());
        addLongValue("collectedCount", 1);
      }
    }
View Full Code Here

        // add retrieve
        if (!retrieveSetups.isEmpty()) {
            boolean oneProject = retrieveSetups.size() == 1 && totalSelected == 1;
            Iterator itProject = retrieveSetups.entrySet().iterator();
            while (itProject.hasNext()) {
                Entry entry = (Entry) itProject.next();
                IProject project = (IProject) entry.getKey();
                Iterator itSetup = ((Set) entry.getValue()).iterator();
                while (itSetup.hasNext()) {
                    StandaloneRetrieveSetup retrieveSetup = (StandaloneRetrieveSetup) itSetup
                            .next();
                    RetrieveAction action = new RetrieveAction(retrieveSetup);
                    action.setText("Retrieve '" + retrieveSetup.getName()
View Full Code Here

    }

    protected void handleProjects(Map projects) {
        Iterator it = projects.entrySet().iterator();
        while (it.hasNext()) {
            Entry entry = (Entry) it.next();
            Iterator itContainers = ((Set) entry.getValue()).iterator();
            while (itContainers.hasNext()) {
                handleContainer((IProject) entry.getKey(),
                    (IvyClasspathContainerImpl) itContainers.next());
            }
        }
    }
View Full Code Here

            toFlush.putAll(projectPrefs);
            projectPrefs.clear();
        }
        Iterator itPrefs = toFlush.entrySet().iterator();
        while (itPrefs.hasNext()) {
            Entry entry = (Entry) itPrefs.next();
            try {
                ((IEclipsePreferences) entry.getValue()).flush();
            } catch (BackingStoreException e) {
                IvyPlugin.logError("Failed to save the state of the Ivy preferences of "
                        + ((IProject) entry.getKey()).getName(), e);
            }
        }
    }
View Full Code Here

TOP

Related Classes of java.util.Map.Entry

Copyright © 2018 www.massapicom. 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.