Package java.util.Map

Examples of java.util.Map.Entry


        final Map/*<String, Set<ExportedPackage>>*/exports) throws JSONException
    {
        final JSONArray ret = new JSONArray();
        for (Iterator entryIter = exports.entrySet().iterator(); entryIter.hasNext();)
        {
            Entry/*<String, Set<ExportedPackage>>*/exportEntry = (Entry) entryIter.next();
            Set/*<ExportedPackage>*/exportSet = (Set) exportEntry.getValue();
            if (exportSet.size() > 1)
            {
                final JSONObject container = new JSONObject();
                ret.put(container);
                for (Iterator packageIter = exportSet.iterator(); packageIter.hasNext();)
View Full Code Here


            }
        }

        for ( Iterator ei = ocdCollection.entrySet().iterator(); ei.hasNext(); )
        {
            Entry ociEntry = ( Entry ) ei.next();
            final String pid = ( String ) ociEntry.getKey();
            final ObjectClassDefinition ocd = ( ObjectClassDefinition ) ociEntry.getValue();
            if ( filter == null )
            {
                pidMap.put( pid, ocd.getName() );
            }
            else
View Full Code Here

    private Dictionary toStringConfig( Map config )
    {
        Dictionary stringConfig = new Hashtable();
        for ( Iterator ei = config.entrySet().iterator(); ei.hasNext(); )
        {
            Entry entry = ( Entry ) ei.next();
            stringConfig.put( entry.getKey(), String.valueOf( entry.getValue() ) );
        }
        return stringConfig;
    }
View Full Code Here

        Map old = new OrderedHashMap();
        // Now try to restore the cache.
        m_propertiesCache.read(ConditionalPermissionInfoImpl.class, old);
        for (Iterator iter = old.entrySet().iterator(); iter.hasNext();)
        {
            Entry entry = (Entry) iter.next();
            String name = (String) entry.getKey();
            ConditionalPermissionInfoImpl cpi = ((ConditionalPermissionInfoImpl) entry
                .getValue());
            m_condPermInfos.put(name, new ConditionalPermissionInfoImpl(name,
                cpi._getConditionInfos(), cpi._getPermissionInfos(), this, cpi
                    .isAllow()));
        }
View Full Code Here

        public void putAll(Map map)
        {
            for (Iterator iter = map.entrySet().iterator(); iter.hasNext();)
            {
                Entry entry = (Entry) iter.next();
                put(entry.getKey(), entry.getValue());
            }
        };
View Full Code Here

                        }

                        public Object next()
                        {
                            final Object key = m_iter.next();
                            return new Entry()
                            {

                                public Object getKey()
                                {
                                    return key;
View Full Code Here

      else if (value instanceof Map)
      {
         // Do a lazy man's generic check by scanning the collection until an entity is found (nested objects not considered).
         for (Iterator iter = ((Map) value).entrySet().iterator(); iter.hasNext();)
         {
            Entry e = (Entry) iter.next();
            if ((e.getKey() != null && Seam.getEntityClass(e.getKey().getClass()) != null) ||
                  (e.getValue() != null && Seam.getEntityClass(e.getValue().getClass()) != null))
            {
               return true;
            }
         }
         return false;
View Full Code Here

     * @param errors The {@link Errors} instance where all validation errors will be registered.
     * @param validatedObjects A registry of all objects that were already validated.
     */
    protected void validateMapProperty(Object root, Map map, String propertyName, Errors errors, Set validatedObjects) {
        for (Iterator entries = map.entrySet().iterator(); entries.hasNext();) {
            Entry entry = (Entry)entries.next();
            Object key = entry.getKey();
            if (!(key instanceof String)) {
                // skipping validation of elements that are mapped to non-string keys for there is no proper
                // representation of such elements as property path.
                continue;
            }
            Object value = entry.getValue();
            String nestedPath = propertyName + PROPERTY_KEY_PREFIX + String.valueOf(key) + PROPERTY_KEY_SUFFIX;
            errors.pushNestedPath(nestedPath);
            validateObjectGraphConstraints(root, value, errors, validatedObjects);
            errors.popNestedPath();
        }
View Full Code Here

    if (cidSpec == null) {
      return cnt;
    }
    Set<?> entrySet = cidSpec.entrySet();
    for (Iterator<?> it = entrySet.iterator(); it.hasNext();) {
      Entry entry = (Entry) it.next();
      Object obj = entry.getValue();
      ComponentCommon common = null;
      if (obj instanceof Bolt) {
        common = ((Bolt) obj).get_common();

      } else if (obj instanceof SpoutSpec) {
        common = ((SpoutSpec) obj).get_common();

      } else if (obj instanceof SpoutSpec) {
        common = ((StateSpoutSpec) obj).get_common();

      }
      int declared = Thrift.parallelismHint(common);
      // Map tmp = (Map) Utils_clj.from_json(common.get_json_conf());

      Map newStormConf = new HashMap(stormConf);
      // newStormConf.putAll(tmp);
      Integer maxParallelism = (Integer) newStormConf
          .get(Config.TOPOLOGY_MAX_TASK_PARALLELISM);
      Integer parallelism = declared;
      if (maxParallelism != null) {
        parallelism = Math.min(maxParallelism, declared);
      }
      for (int i = 0; i < parallelism; i++) {
        cnt++;
        rtn.put(cnt, (String) entry.getKey());
      }
    }
    return cnt;
  }
View Full Code Here

     * @param rulesByProperty The extra property validation rules for this validator. The map should hold the property
     *        names as keys and {@link ValidationRule} instances as values.
     */
    public void setExtraPropertyValidationRules(Map rulesByProperty) {
        for (Iterator entries = rulesByProperty.entrySet().iterator(); entries.hasNext();) {
            Entry entry = (Entry)entries.next();
            addPropertyRule((String)entry.getKey(), (ValidationRule)entry.getValue());
        }
    }
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.