Package java.util

Examples of java.util.WeakHashMap$EntrySpliterator


    * @return the element obtained by the Id, or null if it is not found.
    */
   private static Element getElementByIdType(Document doc, String id) {
       if (true)
         if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "getElementByIdType() Search for ID " + id);
       WeakHashMap elementMap;
       synchronized (docMap) {
           elementMap = (WeakHashMap) docMap.get(doc);
       }
       if (elementMap != null) {
           WeakReference weakReference = (WeakReference) elementMap.get(id);
           if (weakReference != null)
           {
                return (Element) weakReference.get();  
           }
       }
View Full Code Here


    protected void initParameters() {
        super.initParameters();
        this.getSourceURL();

        SessionListener sessions = new SessionListener();
        WeakHashMap allSessions = sessions.getAllSessions();
        List userList = new ArrayList();

        Iterator userit = allSessions.entrySet().iterator();
        while (userit.hasNext()) {
            Map.Entry entry = (Map.Entry) userit.next();
            HttpSession nextsession = (HttpSession) entry.getValue();

            Identity identity = (Identity) nextsession.getAttribute(IDENTITY);
View Full Code Here

    }

    protected boolean isLoggedIn(String userId) {
        String pubId = getSourceDocument().getPublication().getId();
        SessionListener sessions = new SessionListener();
        WeakHashMap allSessions = sessions.getAllSessions();
       
        boolean loggedIn = false;
        Iterator userit = allSessions.entrySet().iterator();
        while (userit.hasNext()) {
            Map.Entry entry = (Map.Entry) userit.next();
            HttpSession nextsession = (HttpSession) entry.getValue();

            Identity identity = (Identity) nextsession.getAttribute(IDENTITY);
View Full Code Here

    this(16);
  }

  public DynamicCollection(int size) {
    storage = new ArrayList(size);
    iterators = new WeakHashMap(4);
  }
View Full Code Here

   * Create a CachingMapDecorator,
   * using an underlying synchronized Map.
   * @param weakKeys whether to use weak references for keys
   */
  public CachingMapDecorator(boolean weakKeys) {
    Map internalMap = weakKeys ? (Map) new WeakHashMap() : new HashMap();
    this.targetMap = Collections.synchronizedMap(internalMap);
  }
View Full Code Here

   * using an underlying synchronized Map.
   * @param weakKeys whether to use weak references for keys
   * @param size the initial cache size
   */
  public CachingMapDecorator(boolean weakKeys, int size) {
    Map internalMap = weakKeys ? (Map) new WeakHashMap(size) : new HashMap(size);
    this.targetMap = Collections.synchronizedMap(internalMap);
  }
View Full Code Here

    /**
     * Create new TemplateSerlvet.
     */
    public TemplateServlet() {
        this.cache = new WeakHashMap();
        this.engine = null; // assigned later by init()
        this.generateBy = true; // may be changed by init()
        this.fileEncodingParamVal = null; // may be changed by init()
    }
View Full Code Here

   * Create a CachingMapDecorator,
   * using an underlying synchronized Map.
   * @param weak whether to use weak references for keys and values
   */
  public CachingMapDecorator(boolean weak) {
    Map internalMap = weak ? (Map) new WeakHashMap() : new HashMap();
    this.targetMap = Collections.synchronizedMap(internalMap);
    this.synchronize = true;
    this.weak = weak;
  }
View Full Code Here

   * using an underlying synchronized Map.
   * @param weak whether to use weak references for keys and values
   * @param size the initial cache size
   */
  public CachingMapDecorator(boolean weak, int size) {
    Map internalMap = weak ? (Map) new WeakHashMap(size) : new HashMap(size);
    this.targetMap = Collections.synchronizedMap(internalMap);
    this.synchronize = true;
    this.weak = weak;
  }
View Full Code Here

   * Create a CachingMapDecorator,
   * using an underlying synchronized Map.
   * @param weakKeys whether to use weak references for keys
   */
  public CachingMapDecorator(boolean weakKeys) {
    Map internalMap = weakKeys ? (Map) new WeakHashMap() : new HashMap();
    this.targetMap = Collections.synchronizedMap(internalMap);
  }
View Full Code Here

TOP

Related Classes of java.util.WeakHashMap$EntrySpliterator

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.