當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。