當前位置: 首頁>>代碼示例>>Java>>正文


Java IdentityHashMap.get方法代碼示例

本文整理匯總了Java中java.util.IdentityHashMap.get方法的典型用法代碼示例。如果您正苦於以下問題:Java IdentityHashMap.get方法的具體用法?Java IdentityHashMap.get怎麽用?Java IdentityHashMap.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.IdentityHashMap的用法示例。


在下文中一共展示了IdentityHashMap.get方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getRedisService

import java.util.IdentityHashMap; //導入方法依賴的package包/類
/**
 * 獲取單例
 *
 * @param redisPropertiesFilename
 * @param tClass
 * @param <T>
 * @return
 */
public static <T extends AbstractRedisService> T getRedisService(String redisPropertiesFilename, Class<T> tClass) {
    IdentityHashMap<Class, ? extends AbstractRedisService> redisServices = INSTANCES.get(redisPropertiesFilename);
    if (redisServices != null) {
        return (T) redisServices.get(tClass);
    }
    IdentityHashMap<Class, AbstractRedisService> newRedisServices = new IdentityHashMap<>();
    RedisConfig redisConfig = getRedisConfig(redisPropertiesFilename);
    newRedisServices.put(AppInfoCacheServiceAbstract.class, new AppInfoCacheServiceAbstract(redisConfig));
    newRedisServices.put(InterfaceInfoCacheServiceAbstract.class, new InterfaceInfoCacheServiceAbstract(redisConfig));
    newRedisServices.put(TokenInfoCacheServiceAbstract.class, new TokenInfoCacheServiceAbstract(redisConfig));
    newRedisServices.put(FrequencyCacheServiceAbstract.class, new FrequencyCacheServiceAbstract(redisConfig));
    newRedisServices.put(StatisticsCacheServiceAbstract.class, new StatisticsCacheServiceAbstract(redisConfig));
    newRedisServices.put(VerificationCodeServiceAbstract.class, new VerificationCodeServiceAbstract(redisConfig));
    newRedisServices.put(AuthCodeCacheServiceAbstract.class, new AuthCodeCacheServiceAbstract(redisConfig));
    redisServices = INSTANCES.putIfAbsent(redisPropertiesFilename, newRedisServices);
    if (redisServices == null) {
        redisServices = newRedisServices;
    }
    return (T) redisServices.get(tClass);
}
 
開發者ID:wxz1211,項目名稱:dooo,代碼行數:29,代碼來源:AbstractRedisService.java

示例2: actionPerformed

import java.util.IdentityHashMap; //導入方法依賴的package包/類
@Override
public void actionPerformed (ActionEvent e) {
    //System.err.println("Models.ActionSupport.actionPerformed("+e+")");
    Node[] ns = getActiveNodes(e);
    int i, k = ns.length;
    IdentityHashMap<Action, ArrayList<Object>> h = new IdentityHashMap<Action, ArrayList<Object>>();
    for (i = 0; i < k; i++) {
        Object node = ns[i].getLookup().lookup(Object.class);
        Action[] as = ns [i].getActions (false);
        int j, jj = as.length;
        for (j = 0; j < jj; j++) {
            if (equals (as [j])) {
                ArrayList<Object> l = h.get (as [j]);
                if (l == null) {
                    l = new ArrayList<Object>();
                    h.put (as [j], l);
                }
                l.add (node);
            }
        }
    }
    //System.err.println("  k = "+k);
    if (k == 0) {
        if (multiselectionType != MULTISELECTION_TYPE_EXACTLY_ONE) {
            performer.perform(new Object[]{});
        }
    } else {
        //System.err.println("  h = "+h);
        Iterator<Action> it = h.keySet ().iterator ();
        while (it.hasNext ()) {
            ActionSupport a = (ActionSupport) it.next ();
            //System.err.println("  "+a.performer+".perform("+((ArrayList) h.get (a)));
            a.performer.perform (
                ((ArrayList) h.get (a)).toArray ()
            );
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:39,代碼來源:Models.java

示例3: createDescriptorIfAbsent

import java.util.IdentityHashMap; //導入方法依賴的package包/類
private static JavaBeanDescriptor createDescriptorIfAbsent(Object obj, JavaBeanAccessor accessor, IdentityHashMap<Object, JavaBeanDescriptor> cache) {
    if (cache.containsKey(obj)) {
        return cache.get(obj);
    } else if (obj instanceof JavaBeanDescriptor) {
        return (JavaBeanDescriptor)obj;
    } else {
        JavaBeanDescriptor result = createDescriptorForSerialize(obj.getClass());
        cache.put(obj, result);
        serializeInternal(result, obj, accessor, cache);
        return result;
    }
}
 
開發者ID:dachengxi,項目名稱:EatDubbo,代碼行數:13,代碼來源:JavaBeanSerializeUtil.java

示例4: processObject

import java.util.IdentityHashMap; //導入方法依賴的package包/類
private Object processObject(Object parent, Property property, Object object, Class<?> declaredType,
	IdentityHashMap<Object, Object> map, Map<Object, Object> evictees, InitialiserCallback callback,
	List<PropertySet> propsToSet)
{
	if( object == null )
	{
		return null;
	}

	Object newObject = object;

	if( map.containsKey(object) )
	{
		return map.get(object);
	}

	if( declaredType == null )
	{
		declaredType = object.getClass();
	}

	if( Map.class.isAssignableFrom(declaredType) )
	{
		return processMap(parent, property, (Map<?, ?>) object, map, evictees, callback, propsToSet);
	}

	if( Collection.class.isAssignableFrom(declaredType) )
	{
		return processCollection(parent, property, (Collection<?>) object, map, evictees, callback, propsToSet);
	}

	if( needsSimplify(parent, property, newObject) )
	{
		newObject = doSimplify(newObject, callback);
		return newObject;
	}

	if( newObject instanceof HibernateProxy )
	{
		newObject = unwrapHibernate(newObject);
	}

	map.put(object, newObject);
	List<Property> properties = getCacheObject(newObject.getClass()).getProperties();
	for( Property prop : properties )
	{
		Object value = processObject(newObject, prop, prop.get(newObject), prop.getReturnType(), map, evictees,
			callback, propsToSet);
		propsToSet.add(new PropertySet(object, prop, value));
	}
	evictees.put(object, object);
	return newObject;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:54,代碼來源:InitialiserServiceImpl.java


注:本文中的java.util.IdentityHashMap.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。