Examples of HashMap


Examples of java.util.HashMap

    // Modification Operations - check for readonly

    public synchronized Object put(Object key, Object value) {
        if (!modified) {
            wrapped = new HashMap(wrapped);
            modified = true;
        }
        return wrapped.put(key, value);
    }
View Full Code Here

Examples of java.util.HashMap

        return wrapped.put(key, value);
    }

    public synchronized Object remove(Object key) {
        if (!modified) {
            wrapped = new HashMap(wrapped);
            modified = true;
        }
        return wrapped.remove(key);
    }
View Full Code Here

Examples of java.util.HashMap

        return wrapped.remove(key);
    }

    public synchronized void putAll(Map t) {
        if (!modified) {
            wrapped = new HashMap(wrapped);
            modified = true;
        }
        wrapped.putAll(t);
    }
View Full Code Here

Examples of java.util.HashMap

        wrapped.putAll(t);
    }

    public synchronized void clear() {
        if (!modified) {
            wrapped = new HashMap(wrapped);
            modified = true;
        }
        wrapped.clear();
    }
View Full Code Here

Examples of java.util.HashMap

     * @param start ...
     * @param value ...
     */
    public void put(String name, Scriptable start, Object value) {
        if (map == null) {
            map = new HashMap();
        }

        if (value == null || value == Undefined.instance) {
            map.remove(name);
        } else if (value instanceof Wrapper) {
View Full Code Here

Examples of java.util.HashMap

     * @param start ...
     * @param value ...
     */
    public void put(int idx, Scriptable start, Object value) {
        if (map == null) {
            map = new HashMap();
        }

        if (value == null || value == Undefined.instance) {
            map.remove(Integer.toString(idx));
        } else if (value instanceof Wrapper) {
View Full Code Here

Examples of java.util.HashMap

    /**
     * Return the wrapped Map object.
     */
    public Object unwrap() {
        if (map == null) {
            map = new HashMap();
        }
        return map;
    }
View Full Code Here

Examples of java.util.HashMap

  getBrowserHeaders(
    String          referer )
  {
    String  headers_to_use = getBrowserHeadersToUse( null );
   
    Map  result = new HashMap();
   
    try{
   
      String header_string = new String( Base64.decode( headers_to_use ), "UTF-8" );
   
      String[]  headers = header_string.split( "\n" );
     
      for (int i=0;i<headers.length;i++ ){
     
        String  header = headers[i];
       
        int  pos = header.indexOf( ':' );
       
        if ( pos != -1 ){
         
          String  lhs = header.substring(0,pos).trim();
          String  rhs  = header.substring(pos+1).trim();
         
          if ( !( lhs.equalsIgnoreCase( "Host") ||
              lhs.equalsIgnoreCase( "Referer" ))){
           
            result.put( lhs, rhs );
          }
        }
      }
     
      if ( referer != null && referer.length() > 0){
       
        result.put( "Referer", referer );
      }
    }catch( Throwable e ){   
    }
   
    return( result );
View Full Code Here

Examples of java.util.HashMap

        // in other words, make sure our threshold for table rotation is lower
        // than that of the underlying HashMap for table rehashing.
        eachCapacity = (int) (threshold / loadFactor) + 2;
        // create tables - we'll never insert into the initial oldTable,
        // it's a dummy that will be lost on the first cache rotation.
        oldTable = new HashMap();
        newTable = createTable(eachCapacity, loadFactor);
    }
View Full Code Here

Examples of java.util.HashMap

     * @param capacity the initial capacity
     * @param loadFactor the load factor
     * @return a new Map used for internal caching
     */
    protected Map createTable(int capacity, float loadFactor) {
        return new HashMap(capacity, loadFactor);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.