@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface Intrinsic
@Intrisic
annotation defines a declared object field to be
intrinsic to the class it is declared in. Intrinsic objects may have their layout within the
containing object instance optimized by JDK implementations, such that access to their content is
faster, and avoids certain de-referencing steps. @Intrisic
fields
must be declared private and final.
Fields annotated with @Intrisic
SHOULD be initialized using
one of the IntrinsicObjects.constructWithin()
variants.
An @Intrisic
field that is NOT initialized using one of
the IntrinsicObjects.constructWithin()
variants may not be treated as intrinsic, may result in slower
access behaviors, and may generate compile-time warnings.
An example of declaring an intrinsic object is:
public class Line { // // Simple intrinsic object declaration and initialization: // @Intrinsic private final Point endPoint1 = IntrinsicObjects.constructWithin("endPoint1", this); @Intrinsic private final Point endPoint2 = IntrinsicObjects.constructWithin("endPoint2", this); ... }
Modifier and Type | Fields and Description |
---|---|
static long |
NO_LENGTH |
Modifier and Type | Optional Element and Description |
---|---|
java.lang.Class |
elementClass
The class of the elements of the Intrinsic
StructuredArray object annotated with this
annotation (optional, and applicable only when annotating StructuredArray fields, required
only when it cannot be automatically derived from generic fields declarations. |
long |
length
The length applied to the Intrinsic array object annotated with this annotation (optional, and
applicable only when annotating fields that are declared as
StructuredArray ,
ReferenceArray } or one of the primitive array variants. |
public abstract long length
StructuredArray
,
ReferenceArray
} or one of the primitive array variants. E.g. PrimitiveLongArray
,
PrimitiveDoubleArray
, etc.public abstract java.lang.Class elementClass
StructuredArray
object annotated with this
annotation (optional, and applicable only when annotating StructuredArray
fields, required
only when it cannot be automatically derived from generic fields declarations.