本文整理汇总了Java中com.esotericsoftware.kryo.util.ObjectMap.containsKey方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectMap.containsKey方法的具体用法?Java ObjectMap.containsKey怎么用?Java ObjectMap.containsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esotericsoftware.kryo.util.ObjectMap
的用法示例。
在下文中一共展示了ObjectMap.containsKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import com.esotericsoftware.kryo.util.ObjectMap; //导入方法依赖的package包/类
public void write (Kryo kryo, Output output, T object) {
CachedField[] fields = getFields();
ObjectMap context = kryo.getGraphContext();
if (!context.containsKey(this)) {
context.put(this, null);
if (TRACE) trace("kryo", "Write " + fields.length + " field names.");
output.writeVarInt(fields.length, true);
for (int i = 0, n = fields.length; i < n; i++)
output.writeString(fields[i].field.getName());
}
OutputChunked outputChunked = new OutputChunked(output, 1024);
for (int i = 0, n = fields.length; i < n; i++) {
fields[i].write(outputChunked, object);
outputChunked.endChunks();
}
}
示例2: buildValidFields
import com.esotericsoftware.kryo.util.ObjectMap; //导入方法依赖的package包/类
private List<Field> buildValidFields (boolean transientFields, List<Field> allFields, ObjectMap context, IntArray useAsm) {
List<Field> result = new ArrayList(allFields.size());
for (int i = 0, n = allFields.size(); i < n; i++) {
Field field = allFields.get(i);
int modifiers = field.getModifiers();
if (Modifier.isTransient(modifiers) != transientFields) continue;
if (Modifier.isStatic(modifiers)) continue;
if (field.isSynthetic() && ignoreSyntheticFields) continue;
if (!field.isAccessible()) {
if (!setFieldsAsAccessible) continue;
try {
field.setAccessible(true);
} catch (AccessControlException ex) {
continue;
}
}
Optional optional = field.getAnnotation(Optional.class);
if (optional != null && !context.containsKey(optional.value())) continue;
result.add(field);
// BOZO - Must be public?
useAsm.add(!Modifier.isFinal(modifiers) && Modifier.isPublic(modifiers)
&& Modifier.isPublic(field.getType().getModifiers()) ? 1 : 0);
}
return result;
}
示例3: buildValidFields
import com.esotericsoftware.kryo.util.ObjectMap; //导入方法依赖的package包/类
private List<Field> buildValidFields (boolean transientFields, List<Field> allFields, ObjectMap context, IntArray useAsm) {
List<Field> result = new ArrayList(allFields.size());
for (int i = 0, n = allFields.size(); i < n; i++) {
Field field = allFields.get(i);
int modifiers = field.getModifiers();
if (Modifier.isTransient(modifiers) && !transientFields) continue;
if (Modifier.isStatic(modifiers)) continue;
if (field.isSynthetic() && ignoreSyntheticFields) continue;
if (!field.isAccessible()) {
if (!setFieldsAsAccessible) continue;
try {
field.setAccessible(true);
} catch (AccessControlException ex) {
continue;
}
}
Optional optional = field.getAnnotation(Optional.class);
if (optional != null && !context.containsKey(optional.value())) continue;
result.add(field);
// BOZO - Must be public?
useAsm.add(!Modifier.isFinal(modifiers) && Modifier.isPublic(modifiers)
&& Modifier.isPublic(field.getType().getModifiers()) ? 1 : 0);
}
return result;
}