Package java.util.Map

Examples of java.util.Map.Entry


        if (!validateElementType(element))
        {
            return false;
        }

        Entry entry = (Entry)element;
        Object removed = mapStore.remove(sm, entry.getKey());

        // NOTE: this may not return an accurate result if a null value is being removed
        return removed == null ? entry.getValue() == null : removed.equals(entry.getValue());
    }
View Full Code Here


        Iterator iter=elements.iterator();
        boolean modified=false;
        while (iter.hasNext())
        {
            Object element=iter.next();
            Entry entry = (Entry)element;

            Object removed = mapStore.remove(sm, entry.getKey());

            // NOTE: this may not return an accurate result if a null value is being removed.
            modified = removed == null ? entry.getValue() == null : removed.equals(entry.getValue());
        }

        return modified;
    }
View Full Code Here

 
  public static Map convertToHierachyMap(Map plainMap) {
    Map result = new HashMap();
    Iterator i = plainMap.entrySet().iterator();
    while (i.hasNext()) {
      Entry entry = (Entry) i.next();
      putByFullKey(result, (String) entry.getKey(), entry.getValue());             
    }
    return result;
  }
View Full Code Here

 
  private static Map convertToPlainMap(Map hierarchyMap, String keyPrefix) {
    Map result = new HashMap();
    Iterator i = hierarchyMap.entrySet().iterator();
    while (i.hasNext()) {
      Entry entry = (Entry) i.next();
      String key = (String) entry.getKey();
      Object value = entry.getValue();
     
      if (value instanceof Map) {
        result.putAll(convertToPlainMap((Map) value, key + MAP_KEY_SEPARATOR));
      } else {
        result.put(keyPrefix + key, value);
View Full Code Here

    private void saveVariables(Map map) throws IOException {
      saveInt(map.size());

      for (Iterator i = map.entrySet().iterator(); i.hasNext();) {
        Entry entry = (Entry) i.next();
        String varName = (String) entry.getKey();
        IPath varPath = (IPath) entry.getValue();

        saveString(varName);
        savePath(varPath);
      }
    }
View Full Code Here

        server.addSystemProperty("java.endorsed.dirs");
        JavaProcess[] processes = new JavaProcess[] {server, client};
        for(int i = 0; i < processes.length; i++) {
            JavaProcess process = processes[i];
            for(Iterator it = System.getProperties().entrySet().iterator(); it.hasNext();) {
                Entry entry = (Entry) it.next();
                String key = entry.getKey().toString();
                if(key.startsWith(process.getName() + ":")){
                    int pos = key.indexOf(':') + 1;
                    String property = key.substring(pos);
                    String value = entry.getValue().toString();
                    System.out.println("Adding (" + property + ", " + value + ")");
                    process.addSystemProperty(property, value);
                }
            }
        }
View Full Code Here

                int count = 0;

                for (Iterator iter = data.entrySet().iterator(); iter.hasNext();)
                {
                    Entry entry = (Entry) iter.next();
                    store.setProperty(count++ + "-" + (String) entry.getKey(),
                        getEncoded(entry.getValue()));
                }

                store.store(out, null);
            }
            catch (IOException ex)
View Full Code Here

            Properties store = new Properties();
            store.load(in);

            for (Iterator iter = store.entrySet().iterator(); iter.hasNext();)
            {
                Entry entry = (Entry) iter.next();
                result.put(entry.getKey(), getUnencoded((String) entry
                    .getValue(), target));
            }
        }
        catch (IOException ex)
        {
            other = ex;
            throw ex;
        }
        finally
        {
            if (in != null)
            {
                try
                {
                    in.close();
                }
                catch (IOException ex)
                {
                    if (other == null)
                    {
                        throw ex;
                    }
                }
            }
        }
        for (Iterator iter = result.entrySet().iterator(); iter.hasNext();)
        {
            Entry entry = (Entry) iter.next();
            String key = (String) entry.getKey();
            map.put(key.substring(key.indexOf("-")), entry.getValue());
        }
    }
View Full Code Here

                    props.size());

                for (Iterator iter = props.entrySet().iterator(); iter
                    .hasNext();)
                {
                    Entry entry = (Entry) iter.next();
                    params[0] = entry.getValue();
                    result[Integer.parseInt((String) entry.getKey())] = constructor
                        .newInstance(params);
                }

                return result;
            }
View Full Code Here

        final List/*<String[]>*/lines = new ArrayList/*<String[]>*/();
        lines.add(new String[] { "Package", "Exports", "Imports" });

        for (Iterator/*<Entry<String, Set<ExportedPackage>>>*/entriesIter = exports.entrySet().iterator(); entriesIter.hasNext();)
        {
            Entry/*<String, Set<ExportedPackage>>*/exportEntry = (Entry) entriesIter.next();

            final Set/*<ExportedPackage>*/exportSet = (Set) exportEntry.getValue();
            if (exportSet.size() > 1)
            {
                String firstCol = (String) exportEntry.getKey();
                for (Iterator packageIter = exportSet.iterator(); packageIter.hasNext();)
                {
                    ExportedPackage exportedPackage = (ExportedPackage) packageIter.next();
                    final Bundle[] importers = exportedPackage.getImportingBundles();
                    final String secondCol = "version=" + exportedPackage.getVersion()
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.