当前位置: 首页>>代码示例>>Java>>正文


Java CachedField类代码示例

本文整理汇总了Java中com.esotericsoftware.kryo.serializers.FieldSerializer.CachedField的典型用法代码示例。如果您正苦于以下问题:Java CachedField类的具体用法?Java CachedField怎么用?Java CachedField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CachedField类属于com.esotericsoftware.kryo.serializers.FieldSerializer包,在下文中一共展示了CachedField类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createCachedField

import com.esotericsoftware.kryo.serializers.FieldSerializer.CachedField; //导入依赖的package包/类
public CachedField createCachedField (Class fieldClass, Field field, FieldSerializer ser) {
	CachedField cachedField;
	if (fieldClass.isPrimitive()) {
		if (fieldClass == boolean.class)
			cachedField = new ObjectBooleanField(ser);
		else if (fieldClass == byte.class)
			cachedField = new ObjectByteField(ser);
		else if (fieldClass == char.class)
			cachedField = new ObjectCharField(ser);
		else if (fieldClass == short.class)
			cachedField = new ObjectShortField(ser);
		else if (fieldClass == int.class)
			cachedField = new ObjectIntField(ser);
		else if (fieldClass == long.class)
			cachedField = new ObjectLongField(ser);
		else if (fieldClass == float.class)
			cachedField = new ObjectFloatField(ser);
		else if (fieldClass == double.class)
			cachedField = new ObjectDoubleField(ser);
		else {
			cachedField = new ObjectField(ser);
		}
	}	else		
		cachedField = new ObjectField(ser);
	return cachedField;
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:27,代码来源:ObjectCachedFieldFactory.java

示例2: createCachedField

import com.esotericsoftware.kryo.serializers.FieldSerializer.CachedField; //导入依赖的package包/类
public CachedField createCachedField (Class fieldClass, Field field, FieldSerializer ser) {
	CachedField cachedField;
	// Use ASM-based serializers
	if (fieldClass.isPrimitive()) {
		if (fieldClass == boolean.class)
			cachedField = new AsmBooleanField();
		else if (fieldClass == byte.class)
			cachedField = new AsmByteField();
		else if (fieldClass == char.class)
			cachedField = new AsmCharField();
		else if (fieldClass == short.class)
			cachedField = new AsmShortField();
		else if (fieldClass == int.class)
			cachedField = new AsmIntField();
		else if (fieldClass == long.class)
			cachedField = new AsmLongField();
		else if (fieldClass == float.class)
			cachedField = new AsmFloatField();
		else if (fieldClass == double.class)
			cachedField = new AsmDoubleField();
		else {
			cachedField = new AsmObjectField(ser);
		}
	} else if (fieldClass == String.class
		&& (!ser.kryo.getReferences() || !ser.kryo.getReferenceResolver().useReferences(String.class))) {
		cachedField = new AsmStringField();
	} else {
		cachedField = new AsmObjectField(ser);
	}
	return cachedField;
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:32,代码来源:AsmCachedFieldFactory.java

示例3: createCachedField

import com.esotericsoftware.kryo.serializers.FieldSerializer.CachedField; //导入依赖的package包/类
public CachedField createCachedField (Class fieldClass, Field field, FieldSerializer ser) {
	CachedField cachedField;
	// Use Unsafe-based serializers
	if (fieldClass.isPrimitive()) {
		if (fieldClass == boolean.class)
			cachedField = new UnsafeBooleanField(field);
		else if (fieldClass == byte.class)
			cachedField = new UnsafeByteField(field);
		else if (fieldClass == char.class)
			cachedField = new UnsafeCharField(field);
		else if (fieldClass == short.class)
			cachedField = new UnsafeShortField(field);
		else if (fieldClass == int.class)
			cachedField = new UnsafeIntField(field);
		else if (fieldClass == long.class)
			cachedField = new UnsafeLongField(field);
		else if (fieldClass == float.class)
			cachedField = new UnsafeFloatField(field);
		else if (fieldClass == double.class)
			cachedField = new UnsafeDoubleField(field);
		else {
			cachedField = new UnsafeObjectField(ser);
		}
	} else if (fieldClass == String.class
		&& (!ser.kryo.getReferences() || !ser.kryo.getReferenceResolver().useReferences(String.class))) {
		cachedField = new UnsafeStringField(field);
	} else {
		cachedField = new UnsafeObjectField(ser);
	}
	return cachedField;
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:32,代码来源:UnsafeCachedFieldFactory.java

示例4: createUnsafeCacheFieldsAndRegions

import com.esotericsoftware.kryo.serializers.FieldSerializer.CachedField; //导入依赖的package包/类
/** Use Unsafe-based information about fields layout in memory to build a list of cached fields and memory regions representing
 * consecutive fields in memory */
public abstract void createUnsafeCacheFieldsAndRegions (List<Field> validFields, List<CachedField> cachedFields,
	int baseIndex, IntArray useAsm);
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:5,代码来源:FieldSerializerUnsafeUtil.java


注:本文中的com.esotericsoftware.kryo.serializers.FieldSerializer.CachedField类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。