本文整理汇总了Java中som.vmobjects.SObject.NUM_PRIMITIVE_FIELDS属性的典型用法代码示例。如果您正苦于以下问题:Java SObject.NUM_PRIMITIVE_FIELDS属性的具体用法?Java SObject.NUM_PRIMITIVE_FIELDS怎么用?Java SObject.NUM_PRIMITIVE_FIELDS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类som.vmobjects.SObject
的用法示例。
在下文中一共展示了SObject.NUM_PRIMITIVE_FIELDS属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPrimitiveAccessors
private static AbstractPrimitiveAccessor[] initPrimitiveAccessors() {
AbstractPrimitiveAccessor[] accessors = new AbstractPrimitiveAccessor[MAX_PRIM_FIELDS];
try {
for (int i = 0; i < SObject.NUM_PRIMITIVE_FIELDS; i += 1) {
Field field = SMutableObject.class.getDeclaredField("primField" + (i + 1));
long offset = unsafe.objectFieldOffset(field);
accessors[i] = new DirectPrimitiveAccessor(offset, i);
}
} catch (NoSuchFieldException | SecurityException e) {
throw new RuntimeException(e);
}
for (int i = SObject.NUM_PRIMITIVE_FIELDS; i < MAX_PRIM_FIELDS; i += 1) {
accessors[i] = new ExtensionPrimitiveAccessor(i);
}
return accessors;
}
示例2: getNumberOfUsedExtendedPrimStorageLocations
public int getNumberOfUsedExtendedPrimStorageLocations() {
int requiredExtensionFields = primitiveStorageLocationsUsed - SObject.NUM_PRIMITIVE_FIELDS;
if (requiredExtensionFields < 0) {
return 0;
}
return requiredExtensionFields;
}
示例3: createForLong
public static StorageLocation createForLong(final ObjectLayout layout,
final long fieldIndex, final int primFieldIndex) {
CompilerAsserts.neverPartOfCompilation("StorageLocation");
if (primFieldIndex < SObject.NUM_PRIMITIVE_FIELDS) {
return new LongDirectStoreLocation(layout, fieldIndex, primFieldIndex);
} else {
return new LongArrayStoreLocation(layout, fieldIndex, primFieldIndex);
}
}
示例4: createForDouble
public static StorageLocation createForDouble(final ObjectLayout layout,
final long fieldIndex, final int primFieldIndex) {
CompilerAsserts.neverPartOfCompilation("StorageLocation");
if (primFieldIndex < SObject.NUM_PRIMITIVE_FIELDS) {
return new DoubleDirectStoreLocation(layout, fieldIndex, primFieldIndex);
} else {
return new DoubleArrayStoreLocation(layout, fieldIndex, primFieldIndex);
}
}
示例5: createForObject
public static StorageLocation createForObject(final ObjectLayout layout,
final int objFieldIndex) {
CompilerAsserts.neverPartOfCompilation("StorageLocation");
if (objFieldIndex < SObject.NUM_PRIMITIVE_FIELDS) {
return new ObjectDirectStorageLocation(layout, objFieldIndex);
} else {
return new ObjectArrayStorageLocation(layout, objFieldIndex);
}
}
示例6: ExtensionPrimitiveAccessor
private ExtensionPrimitiveAccessor(final int fieldIdx) {
super(fieldIdx);
this.extensionIndex = fieldIdx - SObject.NUM_PRIMITIVE_FIELDS;
}