当前位置: 首页>>代码示例>>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;未经允许,请勿转载。