Package org.apache.commons.collections

Examples of org.apache.commons.collections.FastHashMap


    } catch (ConfigurationException ce) {
      throw new StartupException("Error loading institution portlet configuration file!", ce);
    }
    if (instConfigSection == null) { throw new StartupException("Error loading institution portlet configuration file!"); }

    institutions = new FastHashMap();
    for (Iterator iter = instConfigSection.getChildren("institution").iterator(); iter.hasNext();) {
      Configuration instConfigEntry = (Configuration) iter.next(); // the institutions config entry
      String shortName = instConfigEntry.getAttribute("shortname"); // short name of inst

      if (shortName == null) { throw new StartupException("Institution portlet startup: No shortname given for one entry!"); }
View Full Code Here


     * @since          Validator 1.2.0
     */
    protected void merge(Form depends) {

        List templFields = new ArrayList();
        Map temphFields = new FastHashMap();
        Iterator dependsIt = depends.getFields().iterator();
        while (dependsIt.hasNext()) {
            Field defaultField = (Field) dependsIt.next();
            if (defaultField != null) {
                String fieldKey = defaultField.getKey();
                if (!this.containsField(fieldKey)) {
                    templFields.add(defaultField);
                    temphFields.put(fieldKey, defaultField);
                }
                else {
                    Field old = getField(fieldKey);
                    hFields.remove(fieldKey);
                    lFields.remove(old);
                    templFields.add(old);
                    temphFields.put(fieldKey, old);
                }
            }
        }
        lFields.addAll(0, templFields);
        hFields.putAll(temphFields);
View Full Code Here

     * @deprecated This method is not part of Validator's public API.  Validator
     * will use it internally until FastHashMap references are removed.  Use
     * copyMap() instead.
     */
    public static FastHashMap copyFastHashMap(FastHashMap map) {
        FastHashMap results = new FastHashMap();

        Iterator i = map.keySet().iterator();
        while (i.hasNext()) {
            String key = (String) i.next();
            Object value = map.get(key);

            if (value instanceof Msg) {
                results.put(key, ((Msg) value).clone());
            } else if (value instanceof Arg) {
                results.put(key, ((Arg) value).clone());
            } else if (value instanceof Var) {
                results.put(key, ((Var) value).clone());
            } else {
                results.put(key, value);
            }
        }

        results.setFast(true);
        return results;
    }
View Full Code Here

                    return (descriptors[i]);
            }
        }

        PropertyDescriptor result = null;
        FastHashMap mappedDescriptors =
            getMappedPropertyDescriptors(bean);
        if (mappedDescriptors != null) {
            result = (PropertyDescriptor) mappedDescriptors.get(name);
        }
        if (result==null) {
            // not found, try to create it
            try {
                result =
                    new MappedPropertyDescriptor(name, bean.getClass());
            } catch (IntrospectionException ie) {
            }
        }
        if (result!=null) {
            if (mappedDescriptors==null) {
                mappedDescriptors = new FastHashMap();
                mappedDescriptors.setFast(true);
                mappedDescriptorsCache.put
                    (bean.getClass(), mappedDescriptors);
            }
            mappedDescriptors.put(name, result);
        }
        return result;

    }
View Full Code Here

                    return (descriptors[i]);
            }
        }

        PropertyDescriptor result = null;
        FastHashMap mappedDescriptors =
            getMappedPropertyDescriptors(bean);
        if (mappedDescriptors != null) {
            result = (PropertyDescriptor) mappedDescriptors.get(name);
        }
        if (result==null) {
            // not found, try to create it
            try {
                result =
                    new MappedPropertyDescriptor(name, bean.getClass());
            } catch (IntrospectionException ie) {
            }
        }
        if (result!=null) {
            if (mappedDescriptors==null) {
                mappedDescriptors = new FastHashMap();
                mappedDescriptors.setFast(true);
                mappedDescriptorsCache.put
                    (bean.getClass(), mappedDescriptors);
            }
            mappedDescriptors.put(name, result);
        }
        return result;

    }
View Full Code Here

    * @param  map    <code>FastHashMap</code> to copy.
    * @return   FastHashMap  A copy of the <code>FastHashMap</code>
    *        that was passed in.
   */
   public static FastHashMap copyFastHashMap(FastHashMap map) {
      FastHashMap hResults = new FastHashMap();
     
      for (Iterator i = map.keySet().iterator(); i.hasNext(); ) {
         String key = (String)i.next();
         Object value = map.get(key);

          if (value instanceof String) {
             hResults.put(key, new String((String)value));
          } else if (value instanceof Msg) {
             hResults.put(key, ((Msg)value).clone());
          } else if (value instanceof Arg) {
             hResults.put(key, ((Arg)value).clone());
          } else if (value instanceof Var) {
             hResults.put(key, ((Var)value).clone());
         } else {
            hResults.put(key, value)
         }
      }
     
      hResults.setFast(true);
     
      return hResults;
   }
View Full Code Here

                    return (descriptors[i]);
            }
        }

        PropertyDescriptor result = null;
        FastHashMap mappedDescriptors =
                getMappedPropertyDescriptors(bean);
        if (mappedDescriptors != null) {
            result = (PropertyDescriptor) mappedDescriptors.get(name);
        }
        if (result == null) {
            // not found, try to create it
            try {
                result =
View Full Code Here

    * @param  map    <code>FastHashMap</code> to copy.
    * @return   FastHashMap  A copy of the <code>FastHashMap</code>
    *        that was passed in.
   */
   public static FastHashMap copyFastHashMap(FastHashMap map) {
      FastHashMap hResults = new FastHashMap();
     
      for (Iterator i = map.keySet().iterator(); i.hasNext(); ) {
         String key = (String)i.next();
         Object value = map.get(key);

          if (value instanceof String) {
             hResults.put(key, new String((String)value));
          } else if (value instanceof Msg) {
             hResults.put(key, ((Msg)value).clone());
          } else if (value instanceof Arg) {
             hResults.put(key, ((Arg)value).clone());
          } else if (value instanceof Var) {
             hResults.put(key, ((Var)value).clone());
         } else {
            hResults.put(key, value)
         }
      }
     
      hResults.setFast(true);
     
      return hResults;
   }
View Full Code Here

                }
            }
        }

        PropertyDescriptor result = null;
        FastHashMap mappedDescriptors =
                getMappedPropertyDescriptors(bean);
        if (mappedDescriptors == null) {
            mappedDescriptors = new FastHashMap();
            mappedDescriptors.setFast(true);
            mappedDescriptorsCache.put(bean.getClass(), mappedDescriptors);
        }
        result = (PropertyDescriptor) mappedDescriptors.get(name);
        if (result == null) {
            // not found, try to create it
            try {
                result = new MappedPropertyDescriptor(name, bean.getClass());
            } catch (IntrospectionException ie) {
                /* Swallow IntrospectionException
                 * TODO: Why?
                 */
            }
            if (result != null) {
                mappedDescriptors.put(name, result);
            }
        }
       
        return result;

View Full Code Here

    /**
     * Remove any registered {@link LocaleConverter}.
     */
    public void deregister() {

        FastHashMap defaultConverter = lookup(defaultLocale);

        mapConverters.setFast(false);

        mapConverters.clear();
        mapConverters.put(defaultLocale, defaultConverter);
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.FastHashMap

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.