Package org.apache.commons.collections

Examples of org.apache.commons.collections.FastHashMap$CollectionView


    protected static FastHashMap create(Locale locale) {



        FastHashMap converter = new FastHashMap();

        converter.setFast(false);



        converter.put(BigDecimal.class, new BigDecimalLocaleConverter(locale, applyLocalized));

        converter.put(BigInteger.class, new BigIntegerLocaleConverter(locale, applyLocalized));



        converter.put(Byte.class, new ByteLocaleConverter(locale, applyLocalized));

        converter.put(Byte.TYPE, new ByteLocaleConverter(locale, applyLocalized));



        converter.put(Double.class, new DoubleLocaleConverter(locale, applyLocalized));

        converter.put(Double.TYPE, new DoubleLocaleConverter(locale, applyLocalized));



        converter.put(Float.class, new FloatLocaleConverter(locale, applyLocalized));

        converter.put(Float.TYPE, new FloatLocaleConverter(locale, applyLocalized));



        converter.put(Integer.class, new IntegerLocaleConverter(locale, applyLocalized));

        converter.put(Integer.TYPE, new IntegerLocaleConverter(locale, applyLocalized));



        converter.put(Long.class, new LongLocaleConverter(locale, applyLocalized));

        converter.put(Long.TYPE, new LongLocaleConverter(locale, applyLocalized));



        converter.put(Short.class, new ShortLocaleConverter(locale, applyLocalized));

        converter.put(Short.TYPE, new ShortLocaleConverter(locale, applyLocalized));



        converter.put(String.class, new StringLocaleConverter(locale, applyLocalized));



        converter.put(Date.class, new SqlDateLocaleConverter(locale, applyLocalized));

        converter.put(Time.class, new SqlTimeLocaleConverter(locale, applyLocalized));

        converter.put(Timestamp.class, new SqlTimestampLocaleConverter(locale, applyLocalized));



        converter.setFast(true);



        return converter;
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

    protected ServiceManager manager;
    protected Configuration configuration;
    protected Map cache;

    public DefaultCacheManager() {
        this.cache = new FastHashMap();
    }
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

     *  the specified locale.
     * @deprecated This method will be modified to return a Map in the next release.
     */
    @Deprecated
    protected FastHashMap lookup(Locale locale) {
        FastHashMap localeConverters;

        if (locale == null) {
            localeConverters = (FastHashMap) mapConverters.get(defaultLocale);
        }
        else {
View Full Code Here

     * @deprecated This method will be modified to return a Map in the next release.
     */
    @Deprecated
    protected FastHashMap create(Locale locale) {

        FastHashMap converter = new DelegateFastHashMap(BeanUtils.createCache());
        converter.setFast(false);

        converter.put(BigDecimal.class, new BigDecimalLocaleConverter(locale, applyLocalized));
        converter.put(BigInteger.class, new BigIntegerLocaleConverter(locale, applyLocalized));

        converter.put(Byte.class, new ByteLocaleConverter(locale, applyLocalized));
        converter.put(Byte.TYPE, new ByteLocaleConverter(locale, applyLocalized));

        converter.put(Double.class, new DoubleLocaleConverter(locale, applyLocalized));
        converter.put(Double.TYPE, new DoubleLocaleConverter(locale, applyLocalized));

        converter.put(Float.class, new FloatLocaleConverter(locale, applyLocalized));
        converter.put(Float.TYPE, new FloatLocaleConverter(locale, applyLocalized));

        converter.put(Integer.class, new IntegerLocaleConverter(locale, applyLocalized));
        converter.put(Integer.TYPE, new IntegerLocaleConverter(locale, applyLocalized));

        converter.put(Long.class, new LongLocaleConverter(locale, applyLocalized));
        converter.put(Long.TYPE, new LongLocaleConverter(locale, applyLocalized));

        converter.put(Short.class, new ShortLocaleConverter(locale, applyLocalized));
        converter.put(Short.TYPE, new ShortLocaleConverter(locale, applyLocalized));

        converter.put(String.class, new StringLocaleConverter(locale, applyLocalized));

        // conversion format patterns of java.sql.* types should correspond to default
        // behaviour of toString and valueOf methods of these classes
        converter.put(java.sql.Date.class, new SqlDateLocaleConverter(locale, "yyyy-MM-dd"));
        converter.put(java.sql.Time.class, new SqlTimeLocaleConverter(locale, "HH:mm:ss"));
        converter.put( java.sql.Timestamp.class,
                       new SqlTimestampLocaleConverter(locale, "yyyy-MM-dd HH:mm:ss.S")
                     );

        converter.setFast(true);

        return converter;
    }
View Full Code Here

        PropertyDescriptor result = data.getDescriptor(name);
        if (result != null) {
            return result;
        }

        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

    * @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

   */
   public synchronized void process(Map globalConstants) {
      // Create FastHashMap for isDependency method
      if (getDepends() != null) {
          if (hDependencies == null) {
             hDependencies = new FastHashMap();
          }
            
         StringTokenizer st = new StringTokenizer(getDepends(), ",");
         String value = "";
         while (st.hasMoreTokens()) {
View Full Code Here

TOP

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

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.