Package org.zkoss.util

Examples of org.zkoss.util.FastReadArray


      flag == 0 || (flag & FILTER_REQUEST) != 0 ? _reqfilters: _incfilters;
    if (filters.isEmpty()) //no need to sync
      return null; //optimize

    for (;;) {
      FastReadArray ary;
      synchronized (filters) {
        ary = (FastReadArray)filters.get(ext);
      }
      if (ary != null)
        return (Filter[])ary.toArray();

      int j = ext.indexOf('.');
      if (j < 0)   return null;
      ext = ext.substring(j + 1);
    }
View Full Code Here


      addFilter(_reqfilters, ext, filter);
    if ((flags & FILTER_INCLUDE) != 0)
      addFilter(_incfilters, ext, filter);
  }
  private static void addFilter(Map filters, String ext, Filter filter) {
    FastReadArray ary;
    synchronized (filters) {
      ary = (FastReadArray)filters.get(ext);
      if (ary == null)
        filters.put(ext, ary = new FastReadArray(Filter.class));
    }
    ary.add(filter);
  }
View Full Code Here

    if ((flags & FILTER_INCLUDE) != 0)
      removed = rmFilter(_incfilters, ext, filter) || removed;
    return removed;
  }
  private static boolean rmFilter(Map filters, String ext, Filter filter) {
    FastReadArray ary;
    synchronized (filters) {
      ary = (FastReadArray)filters.get(ext);
    }
    if (ary != null && ary.remove(filter)) {
      if (ary.isEmpty())
        synchronized (filters) {
          ary = (FastReadArray)filters.remove(ext);
          if (ary != null && !ary.isEmpty())
            filters.put(ext, ary); //modify by other, so restore
        }
      return true;
    }
    return false;
View Full Code Here

TOP

Related Classes of org.zkoss.util.FastReadArray

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.