diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f838cb3..0000000 --- a/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -target -.idea -out -classes -gh-pages -*.iml -.classpath -.project -.settings diff --git a/JavaDoc/allclasses-frame.html b/JavaDoc/allclasses-frame.html new file mode 100644 index 0000000..cda163b --- /dev/null +++ b/JavaDoc/allclasses-frame.html @@ -0,0 +1,39 @@ + + + +
+ +public static class ObjectLayoutBench.BasicArray
+extends java.lang.Object
+| Constructor and Description | +
|---|
BasicArray(int length,
+ int[] nextIndexes) |
+
BasicArray(StructuredArray<ObjectLayoutBench.Element> sa) |
+
| Modifier and Type | +Method and Description | +
|---|---|
ObjectLayoutBench.Element |
+get(int index) |
+
int |
+getLength() |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic BasicArray(int length, + int[] nextIndexes)+
public BasicArray(StructuredArray<ObjectLayoutBench.Element> sa)+
public int getLength()+
public ObjectLayoutBench.Element get(int index)+
public static class ObjectLayoutBench.Element +extends ObjectLayoutBench.ElementBase+
| Constructor and Description | +
|---|
Element(long index,
+ int[] nextIndexes) |
+
Element(ObjectLayoutBench.Element src) |
+
getIndex, getNextIndex, setIndex, setNextIndexequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic Element(long index, + int[] nextIndexes)+
public Element(ObjectLayoutBench.Element src)+
public static class ObjectLayoutBench.ElementBase
+extends java.lang.Object
+| Constructor and Description | +
|---|
ElementBase(long index,
+ int[] nextIndexes) |
+
ElementBase(ObjectLayoutBench.ElementBase src) |
+
| Modifier and Type | +Method and Description | +
|---|---|
long |
+getIndex() |
+
int |
+getNextIndex() |
+
void |
+setIndex(long index) |
+
void |
+setNextIndex(int nextIndex) |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic ElementBase(long index, + int[] nextIndexes)+
public ElementBase(ObjectLayoutBench.ElementBase src)+
public static class ObjectLayoutBench.GenericArray<E>
+extends java.lang.Object
+| Constructor and Description | +
|---|
GenericArray(java.lang.reflect.Constructor<E> constructor,
+ int length,
+ int[] nextIndexes) |
+
GenericArray(StructuredArray<E> sa) |
+
| Modifier and Type | +Method and Description | +
|---|---|
E |
+get(int index) |
+
int |
+getLength() |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static class ObjectLayoutBench.RandomizedBasicArray
+extends java.lang.Object
+| Constructor and Description | +
|---|
RandomizedBasicArray(int length,
+ int[] nextIndexes) |
+
| Modifier and Type | +Method and Description | +
|---|---|
ObjectLayoutBench.Element |
+get(int index) |
+
int |
+getLength() |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic class ObjectLayoutBench
+extends java.lang.Object
+| Modifier and Type | +Class and Description | +
|---|---|
static class |
+ObjectLayoutBench.BasicArray |
+
static class |
+ObjectLayoutBench.Element |
+
static class |
+ObjectLayoutBench.ElementBase |
+
static class |
+ObjectLayoutBench.GenericArray<E> |
+
static class |
+ObjectLayoutBench.RandomizedBasicArray |
+
| Modifier and Type | +Field and Description | +
|---|---|
int |
+LengthPow2 |
+
boolean |
+RandomArrayWalk |
+
| Constructor and Description | +
|---|
ObjectLayoutBench() |
+
| Modifier and Type | +Method and Description | +
|---|---|
void |
+basicArrayDifferentLayoutDataDependentLoop() |
+
void |
+basicArrayDifferentLayoutLoop() |
+
void |
+basicArraySameLayoutDataDependentLoop() |
+
void |
+basicArraySameLayoutLoop() |
+
void |
+genericArrayDifferentLayoutDataDependentLoop() |
+
void |
+genericArrayDifferentLayoutLoop() |
+
void |
+genericArraySameLayoutDataDependentLoop() |
+
void |
+genericArraySameLayoutLoop() |
+
void |
+randomizedBasicArrayDataDependentLoop() |
+
void |
+randomizedBasicArrayLoop() |
+
void |
+setup() |
+
void |
+structuredArrayDataDependentLoop() |
+
void |
+structuredArrayLoop() |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic int LengthPow2+
public boolean RandomArrayWalk+
public void setup() + throws java.lang.NoSuchMethodException+
java.lang.NoSuchMethodExceptionpublic void basicArrayDifferentLayoutDataDependentLoop()+
public void basicArrayDifferentLayoutLoop()+
public void basicArraySameLayoutDataDependentLoop()+
public void basicArraySameLayoutLoop()+
public void genericArrayDifferentLayoutDataDependentLoop()+
public void genericArrayDifferentLayoutLoop()+
public void genericArraySameLayoutDataDependentLoop()+
public void genericArraySameLayoutLoop()+
public void randomizedBasicArrayDataDependentLoop()+
public void randomizedBasicArrayLoop()+
public void structuredArrayDataDependentLoop()+
public void structuredArrayLoop()+
public static class SAHashMapBench.Element +extends SAHashMapBench.ElementBase+
| Constructor and Description | +
|---|
Element() |
+
Element(long index,
+ int[] nextIndexes) |
+
Element(SAHashMapBench.Element src) |
+
equals, getIndex, getNextIndex, hashCode, setIndex, setNextIndex, simple_math, toStringgetClass, notify, notifyAll, wait, wait, waitpublic Element()+
public Element(long index, + int[] nextIndexes)+
public Element(SAHashMapBench.Element src)+
public static class SAHashMapBench.ElementBase
+extends java.lang.Object
+| Constructor and Description | +
|---|
ElementBase() |
+
ElementBase(long index,
+ int[] nextIndexes) |
+
ElementBase(SAHashMapBench.ElementBase src) |
+
| Modifier and Type | +Method and Description | +
|---|---|
boolean |
+equals(java.lang.Object o) |
+
long |
+getIndex() |
+
int |
+getNextIndex() |
+
int |
+hashCode() |
+
void |
+setIndex(long index) |
+
void |
+setNextIndex(int nextIndex) |
+
static long |
+simple_math(long param1,
+ int param2) |
+
java.lang.String |
+toString() |
+
getClass, notify, notifyAll, wait, wait, waitpublic ElementBase()+
public ElementBase(long index, + int[] nextIndexes)+
public ElementBase(SAHashMapBench.ElementBase src)+
public long getIndex()+
public void setIndex(long index)+
public int getNextIndex()+
public void setNextIndex(int nextIndex)+
public boolean equals(java.lang.Object o)+
equals in class java.lang.Objectpublic int hashCode()+
hashCode in class java.lang.Objectpublic java.lang.String toString()+
toString in class java.lang.Objectpublic static long simple_math(long param1, + int param2)+
public class SAHashMapBench
+extends java.lang.Object
+| Modifier and Type | +Class and Description | +
|---|---|
static class |
+SAHashMapBench.Element |
+
static class |
+SAHashMapBench.ElementBase |
+
| Modifier and Type | +Field and Description | +
|---|---|
java.lang.Integer[] |
+integers |
+
int |
+length |
+
int |
+lengthMask |
+
int |
+lengthPow2 |
+
int[] |
+linearNextIndexes |
+
java.util.HashMap<java.lang.Integer,SAHashMapBench.Element> |
+map |
+
boolean |
+RandomArrayWalk |
+
SAHashMap<java.lang.Integer,SAHashMapBench.Element> |
+saMap |
+
int[] |
+shuffledNextIndexes |
+
| Constructor and Description | +
|---|
SAHashMapBench() |
+
| Modifier and Type | +Method and Description | +
|---|---|
void |
+mapDataDependentLoop() |
+
void |
+mapLoop() |
+
void |
+saMapDataDependentLoop() |
+
void |
+saMapLoop() |
+
void |
+setup() |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic int lengthPow2+
public int length+
public int lengthMask+
public boolean RandomArrayWalk+
public int[] linearNextIndexes+
public int[] shuffledNextIndexes+
public java.lang.Integer[] integers+
public SAHashMap<java.lang.Integer,SAHashMapBench.Element> saMap+
public java.util.HashMap<java.lang.Integer,SAHashMapBench.Element> map+
public void setup() + throws java.lang.NoSuchMethodException+
java.lang.NoSuchMethodExceptionpublic void mapLoop()+
public void mapDataDependentLoop()+
public void saMapLoop()+
public void saMapDataDependentLoop()+
| Class | +Description | +
|---|---|
| ObjectLayoutBench | ++ |
| ObjectLayoutBench.BasicArray | ++ |
| ObjectLayoutBench.Element | ++ |
| ObjectLayoutBench.ElementBase | ++ |
| ObjectLayoutBench.GenericArray<E> | ++ |
| ObjectLayoutBench.RandomizedBasicArray | ++ |
| SAHashMapBench | ++ |
| SAHashMapBench.Element | ++ |
| SAHashMapBench.ElementBase | ++ |
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+Each annotation type has its own separate page with the following sections:
+Each enum has its own separate page with the following sections:
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+These links take you to the next or previous class, interface, package, or related page.
+These links show and hide the HTML frames. All pages are available with or without frames.
+The All Classes link shows all classes and interfaces except non-static nested types.
+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
+The Constant Field Values page lists the static final fields and their values.
+CtorAndArgs to be used in constructing arrays.Constructor and construction arguments to be used in constructing arrays.CtorAndArgs to be used in constructing arrays.Constructor and construction arguments to be used in constructing arrays.AbstractPrimitiveArray<T>PrimitiveArrayBuilder object for creating arrays of
+ type S with the given length.StructuredArrays.CtorAndArgs.Iterator with the ability to be StructuredArray.ElementIterator.reset() enabling reuse.StructuredArray<T>StructuredArrayBuilder object for creating arrays of type S with
+ elements of type T, and the given length.StructuredArrayBuilder object for creating arrays of type S with
+ elements of type T, and the given length.StructuredArrayBuilder object for creating arrays of the given array model.StructuredArrayBuilder object for creating arrays of the given array model.StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length.StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length.StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length.StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length.AbstractPrimitiveArray<T>PrimitiveArrayBuilder object for creating arrays of
+ type S with the given length.StructuredArrays.CtorAndArgs.Iterator with the ability to be StructuredArray.ElementIterator.reset() enabling reuse.StructuredArray<T>StructuredArrayBuilder object for creating arrays of type S with
+ elements of type T, and the given length.StructuredArrayBuilder object for creating arrays of type S with
+ elements of type T, and the given length.StructuredArrayBuilder object for creating arrays of the given array model.StructuredArrayBuilder object for creating arrays of the given array model.StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length.StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length.StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length.StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length.Collection view of the values contained in this map.AbstractPrimitiveArray according to the information captured in this builderStructuredArray according to the information captured in this builderStructuredArrayBuilder.PrimitiveArrayBuilder.PrimitiveByteArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveByteArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveCharArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveCharArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveDoubleArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveDoubleArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveFloatArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveFloatArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveIntArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveIntArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveLongArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveLongArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveShortArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayPrimitiveShortArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayReferenceArray<T>> instance, using a copy constructor to
+ replicate the contents of the given source arrayReferenceArray<T>> instance, using a copy constructor to
+ replicate the contents of the given source arrayCtorAndArgs instance.CtorAndArgs instance for the given instanceClass, with a constructor
+ identified by the constructorArgTypes, and using the args provides.CtorAndArgs instance for the given instanceClass, with a constructor
+ identified by the constructorArgTypes, and using the args provides.CtorAndArgs instance for the given instanceClass, using the default constructor (and no args)CtorAndArgs instance for the given instanceClass, using the default constructor (and no args)CtorAndArgs to be used for all elements in the array.Constructor and construction arguments to be used for all elements in the array.CtorAndArgsProvider used for determining the constructor and construction
+ arguments used for each element in the array.long index.int index.CtorAndArgs describing the constructor and arguments used to instantiate arrays with
+ this builder.CtorAndArgs describing the constructor and arguments used to instantiate arrays with
+ this builder.PrimitiveArrayModel that describes the arrays built by this builderStructuredArrayModel that describes the arrays built by this builderStructuredArrayBuilder.getContextCookie()).Class of elements stored in the array.CtorAndArgsProvider which provides the constructor and arguments used to construct
+ individual elements of arrays instantiated with this builder.CtorAndArgs instance to be used in constructing a given element index in
+ a StructuredArrayStructuredArrayBuilder for the elements of the arrays built by
+ this builder.StructuredArrayBuilder for the elements of the arrays built by
+ this builder.@Intrisic annotation defines a declared object field to be
+ intrinsic to the class it is declared in.Intrinsic.elementClass() element.@Intrisic annotation) 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.PrimitiveByteArray with a given length.PrimitiveByteArray> with a given length.PrimitiveByteArray> with a given length.PrimitiveByteArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveByteArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveCharArray with a given length.PrimitiveCharArray> with a given length.PrimitiveCharArray> with a given length.PrimitiveCharArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveCharArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveDoubleArray with a given length.PrimitiveDoubleArray> with a given length.PrimitiveDoubleArray> with a given length.PrimitiveDoubleArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveDoubleArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveFloatArray with a given length.PrimitiveFloatArray> with a given length.PrimitiveFloatArray> with a given length.PrimitiveFloatArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveFloatArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveIntArray with a given length.PrimitiveIntArray> with a given length.PrimitiveIntArray> with a given length.PrimitiveIntArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveIntArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveLongArray with a given length.PrimitiveLongArray> with a given length.PrimitiveLongArray> with a given length.PrimitiveLongArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveLongArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveShortArray with a given length.PrimitiveShortArray> with a given length.PrimitiveShortArray> with a given length.PrimitiveShortArray> with a given length,
+ array constructor, and array constructor arguments.PrimitiveShortArray> with a given length,
+ array constructor, and array constructor arguments.ReferenceArray<T>> with a given length.ReferenceArray<T>> with a given length.ReferenceArray> with a given length,
+ array constructor, and array constructor arguments.ReferenceArray<T>> with a given length,
+ array constructor, and array constructor arguments.length elements, each containing an element object of
+ type elementClass.length elements, each containing an element object of
+ type elementClass.arrayClass array of length elements of
+ type elementClass.arrayClass array of length elements of
+ type elementClass.arrayCtorAndArgs.getConstructor().getDeclaringClass() array of length
+ elements of type elementClass.arrayCtorAndArgs.getConstructor().getDeclaringClass() array of length
+ elements of type elementClass.arrayCtorAndArgs.getConstructor().getDeclaringClass() array of length
+ elements of type elementClass.length elements of type elementClass.arrayClass array of length elements, each containing an element object of
+ type elementClass.arrayClass array of length elements, each containing an element object of
+ type elementClass.arrayCtorAndArgs.getConstructor().getDeclaringClass() array of length
+ elements of type elementClass.public abstract class AbstractPrimitiveArray
+extends java.lang.Object
+public class ConstructionContext<T>
+extends java.lang.Object
+| Constructor and Description | +
|---|
ConstructionContext(java.lang.Object cookie) |
+
| Modifier and Type | +Method and Description | +
|---|---|
StructuredArray<T> |
+getArray()
+Get the immediately containing StructuredArray.
+ |
+
ConstructionContext<StructuredArray<T>> |
+getContainingContext()
+Get the containing context.
+ |
+
java.lang.Object |
+getContextCookie()
+Get the construction context cookie object.The construction context cookie of the outermost
+ array is taken from the (optionally supplied) StructuredArrayBuilder used in instantiating
+ the array (via
+StructuredArrayBuilder.getContextCookie()). |
+
long |
+getIndex()
+Get the index (of the element being constructed) in the immediately containing StructuredArray.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic ConstructionContext(java.lang.Object cookie)+
public long getIndex()+
public StructuredArray<T> getArray()+
public ConstructionContext<StructuredArray<T>> getContainingContext()+
public java.lang.Object getContextCookie()+
StructuredArrayBuilder.getContextCookie()). The
+ construction context cookie for nested arrays (if those exist) is taken from the CtorAndArgs
+ used to construct the nested array, such that a CtorAndArgsProvider can receive
+ and propagate an appropriate contextCookie. A good example of context cookie in use can be found in the
+ implementation of CopyCtorAndArgsProvider.T - type of the element occupying each array slot.public class CtorAndArgs<T>
+extends java.lang.Object
+StructuredArray)| Constructor and Description | +
|---|
CtorAndArgs(java.lang.Class<T> instanceClass)
+Create a
+CtorAndArgs instance for the given instanceClass, using the default constructor (and no args) |
+
CtorAndArgs(java.lang.Class<T> instanceClass,
+ java.lang.Class[] constructorArgTypes,
+ java.lang.Object... args)
+Create a
+CtorAndArgs instance for the given instanceClass, with a constructor
+ identified by the constructorArgTypes, and using the args provides. |
+
CtorAndArgs(java.lang.reflect.Constructor<T> constructor,
+ java.lang.Object... args)
+Create a
+CtorAndArgs instance. |
+
CtorAndArgs(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<T> instanceClass)
+Create a
+CtorAndArgs instance for the given instanceClass, using the default constructor (and no args) |
+
CtorAndArgs(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<T> instanceClass,
+ java.lang.Class[] constructorArgTypes,
+ java.lang.Object... args)
+Create a
+CtorAndArgs instance for the given instanceClass, with a constructor
+ identified by the constructorArgTypes, and using the args provides. |
+
| Modifier and Type | +Method and Description | +
|---|---|
java.lang.Object[] |
+getArgs() |
+
java.lang.reflect.Constructor<T> |
+getConstructor() |
+
java.lang.Object |
+getContextCookie()
+Get the value of the opaque contextCookie object
+ |
+
CtorAndArgs<T> |
+setArgs(java.lang.Object... args)
+Set the constructor arguments to be indicated in this CtorAndArgs.
+ |
+
CtorAndArgs<T> |
+setConstructor(java.lang.reflect.Constructor<T> constructor)
+Set the constructor to be indicated in this
+CtorAndArgs. |
+
void |
+setContextCookie(java.lang.Object contextCookie)
+Set the value of the opaque contextCookie object
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic CtorAndArgs(java.lang.reflect.Constructor<T> constructor, + java.lang.Object... args)+
CtorAndArgs instance. The presumption is that types in args
+ match those expected by constructor. Obviously exceptions may be generated at construction time if
+ this is not the case.constructor - Constructor to be indicated in this CtorAndArgsargs - constructor arguments to be indicated in this CtorAndArgspublic CtorAndArgs(java.lang.Class<T> instanceClass, + java.lang.Class[] constructorArgTypes, + java.lang.Object... args)+
CtorAndArgs instance for the given instanceClass, with a constructor
+ identified by the constructorArgTypes, and using the args provides. The presumption is
+ that types in args match those expected by constructor. Obviously exceptions may be
+ generated at construction time if this is not the case.instanceClass - The class which the constructor in this CtorAndArgs will instantiateconstructorArgTypes - The argument types expected by the constructorargs - constructor arguments to be indicated in this CtorAndArgspublic CtorAndArgs(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<T> instanceClass, + java.lang.Class[] constructorArgTypes, + java.lang.Object... args)+
CtorAndArgs instance for the given instanceClass, with a constructor
+ identified by the constructorArgTypes, and using the args provides. The presumption is
+ that types in args match those expected by constructor. Obviously exceptions may be
+ generated at construction time if this is not the case.lookup - The lookup object to use when resolving constructorsinstanceClass - The class which the constructor in this CtorAndArgs will instantiateconstructorArgTypes - The argument types expected by the constructorargs - constructor arguments to be indicated in this CtorAndArgspublic CtorAndArgs(java.lang.Class<T> instanceClass)+
CtorAndArgs instance for the given instanceClass, using the default constructor (and no args)instanceClass - The class which the constructor in this CtorAndArgs will instantiatepublic CtorAndArgs(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<T> instanceClass)+
CtorAndArgs instance for the given instanceClass, using the default constructor (and no args)lookup - The lookup object to use when resolving constructorsinstanceClass - The class which the constructor in this CtorAndArgs will instantiatepublic final java.lang.reflect.Constructor<T> getConstructor()+
public final CtorAndArgs<T> setConstructor(java.lang.reflect.Constructor<T> constructor)+
CtorAndArgs. Enables recycling of
+ CtorAndArgs objects to avoid re-allocation. E.g. in copy construction loops.constructor - Constructor to be indicated in this CtorAndArgsCtorAndArgs instance operated onpublic final java.lang.Object[] getArgs()+
public final CtorAndArgs<T> setArgs(java.lang.Object... args)+
CtorAndArgs objects to avoid re-allocation. E.g. in copy construction loops.args - constructor arguments to be indicated in this CtorAndArgsCtorAndArgs instance operated onpublic java.lang.Object getContextCookie()+
public void setContextCookie(java.lang.Object contextCookie)+
contextCookie - carries an opaque objectT - type of the element occupying each array slot.public interface CtorAndArgsProvider<T>
+| Modifier and Type | +Method and Description | +
|---|---|
CtorAndArgs<T> |
+getForContext(ConstructionContext<T> context)
+Get a
+CtorAndArgs instance to be used in constructing a given element index in
+ a StructuredArray |
+
CtorAndArgs<T> getForContext(ConstructionContext<T> context) + throws java.lang.NoSuchMethodException+
CtorAndArgs instance to be used in constructing a given element index in
+ a StructuredArraycontext - The construction context (index, containing array, etc.) of the element to be constructedCtorAndArgs instance to used in element constructionjava.lang.NoSuchMethodException - if expected constructor is not found in element classpublic static final class Intrinsic.NO_DECLARED_CLASS
+extends java.lang.Object
+Intrinsic.elementClass() element.| Constructor and Description | +
|---|
NO_DECLARED_CLASS() |
+
@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.public final class IntrinsicObjects
+extends java.lang.Object
+@Intrisic annotation) 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.
+
+ The IntrinsicObjects class provides static methods for constructing objects
+ that are @Intrisic to their containing class. Calls to
+ constructWithin(String fieldName, Object containingObject) (and variants) are used to construct and
+ initialize intrinsic objects associated with specific instance fields that are declared as
+ @Intrisic in their containing class.
+
+ Some example of declaring an intrinsic object include: +
+ public class Line {
+ private static final MethodHandles.Lookup lookup = MethodHandles.lookup();
+ //
+ // Simple intrinsic object declaration and initialization:
+ //
+ @Intrinsic
+ private final Point endPoint1 = IntrinsicObjects.constructWithin(lookup, "endPoint1", this);
+ @Intrinsic
+ private final Point endPoint2 = IntrinsicObjects.constructWithin(lookup, "endPoint2", this);
+ ...
+ }
+
+ public class Octagon {
+ private static final MethodHandles.Lookup lookup = MethodHandles.lookup();
+ //
+ // Intrinsic object declaration and initialization for a StructuredArray member:
+ //
+ @Intrinsic(length = 8)
+ private final StructuredArray<Point> points = IntrinsicObjects.constructWithin(lookup, "points", this);
+ ...
+ }
+ | Modifier and Type | +Method and Description | +
|---|---|
static <T> T |
+constructWithin(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.String fieldName,
+ java.lang.Object containingObject)
+Construct an intrinsic object at the given field within the containing object, using a default constructor.
+ |
+
static <T> T |
+constructWithin(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.String fieldName,
+ java.lang.Object containingObject,
+ java.lang.reflect.Constructor<T> objectConstructor,
+ java.lang.Object... args)
+Construct an intrinsic object at the given field within the containing object, using the given
+ constructor and arguments.
+ |
+
static <T> T |
+constructWithin(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.String fieldName,
+ java.lang.Object containingObject,
+ CtorAndArgs<T> objectCtorAndArgs)
+Construct an intrinsic object at the given field within the containing object, using the
+ constructor and arguments supplied in the given objectCtorAndArgs argument.
+ |
+
static <T> T |
+constructWithin(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.String fieldName,
+ java.lang.Object containingObject,
+ PrimitiveArrayBuilder arrayBuilder)
+Construct an intrinsic object at the given field within the containing object, using the
+ supplied
+PrimitiveArrayBuilder. |
+
static <T> T |
+constructWithin(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.String fieldName,
+ java.lang.Object containingObject,
+ StructuredArrayBuilder arrayBuilder)
+Construct an intrinsic object at the given field within the containing object, using the
+ supplied
+StructuredArrayBuilder. |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static <T> T constructWithin(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.String fieldName, + java.lang.Object containingObject)+
+ The field specified in fieldName must be annotated with @Intrisic,
+ and must be declared private and final.
T - The type of the intrinsic object being constructedlookup - The lookup object to use for accessing the fieldfieldName - The name of the field within the containing objectcontainingObject - The object instance that will contain this intrinsic objectpublic static <T> T constructWithin(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.String fieldName, + java.lang.Object containingObject, + java.lang.reflect.Constructor<T> objectConstructor, + java.lang.Object... args)+
+ The field specified in fieldName must be annotated with @Intrisic,
+ and must be declared private and final.
T - The type of the intrinsic object being constructedlookup - The lookup object to use for accessing the fieldfieldName - The name of the field within the containing objectcontainingObject - The object instance that will contain this intrinsic objectobjectConstructor - The constructor to be used in constructing the intrinsic object instanceargs - the arguments to be used with the objectConstructorpublic static <T> T constructWithin(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.String fieldName, + java.lang.Object containingObject, + CtorAndArgs<T> objectCtorAndArgs)+
+ The field specified in fieldName must be annotated with @Intrisic,
+ and must be declared private and final.
T - The type of the intrinsic object being constructedlookup - The lookup object to use for accessing the fieldfieldName - The name of the field within the containing objectcontainingObject - The object instance that will contain this intrinsic objectobjectCtorAndArgs - The constructor and arguments to be used in constructing the
+ intrinsic object instancepublic static <T> T constructWithin(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.String fieldName, + java.lang.Object containingObject, + StructuredArrayBuilder arrayBuilder)+
StructuredArrayBuilder. This form of constructWithin() can only be used
+ to construct intrinsic objects that derive from StructuredArray.
+
+ The field specified in fieldName must be annotated with @Intrisic,
+ and must be declared private and final.
T - The type of the intrinsic object being constructedlookup - The lookup object to use for accessing the fieldfieldName - The name of the field within the containing objectcontainingObject - The object instance that will contain this intrinsic objectarrayBuilder - The StructuredArrayBuilder instance to be used in constructing the arraypublic static <T> T constructWithin(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.String fieldName, + java.lang.Object containingObject, + PrimitiveArrayBuilder arrayBuilder)+
PrimitiveArrayBuilder. This form of constructWithin() can only be used
+ to construct intrinsic objects that derive from AbstractPrimitiveArray.
+
+ The field specified in fieldName must be annotated with @Intrisic,
+ and must be declared private and final.
T - The type of the intrinsic object being constructedlookup - The lookup object to use for accessing the fieldfieldName - The name of the field within the containing objectcontainingObject - The object instance that will contain this intrinsic objectarrayBuilder - The PrimitiveArrayBuilder instance to be used in constructing the array@SupportedAnnotationTypes(value="org.ObjectLayout.Intrinsic")
+ @SupportedSourceVersion(value=RELEASE_6)
+public class IntrinsicProcessor
+extends javax.annotation.processing.AbstractProcessor
+| Constructor and Description | +
|---|
IntrinsicProcessor() |
+
| Modifier and Type | +Method and Description | +
|---|---|
javax.lang.model.SourceVersion |
+getSupportedSourceVersion() |
+
boolean |
+process(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations,
+ javax.annotation.processing.RoundEnvironment roundEnv) |
+
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, initequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic boolean process(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, + javax.annotation.processing.RoundEnvironment roundEnv)+
process in interface javax.annotation.processing.Processorprocess in class javax.annotation.processing.AbstractProcessorpublic javax.lang.model.SourceVersion getSupportedSourceVersion()+
getSupportedSourceVersion in interface javax.annotation.processing.ProcessorgetSupportedSourceVersion in class javax.annotation.processing.AbstractProcessorS - The class of the PrimitiveArray that is to be instantiated by the builderpublic class PrimitiveArrayBuilder<S extends AbstractPrimitiveArray>
+extends java.lang.Object
+AbstractPrimitiveArray<T>
+
+ PrimitiveArrayBuilder follows the commonly used builder pattern, and is useful for
+ capturing the instantiation parameters of StructuredArrays.
+
+ PrimitiveArrayBuilders can be created for "flat" and "nested" StructuredArray
+ constructs, and can range from the simplest forms used when default constructors are employed, to forms that
+ supply customized per-element construction arguments that can take construction context (such as index,
+ containing array, and arbitrary data passed in a contextCookie) into account.
+
PrimitiveArrayBuilder to instantiate a PrimitiveLongArray is:
+ ++ StructuredArray<MyElementClass> array = + new PrimitiveArrayBuilder(PrimitiveLongArray.class, length). + build(); +
+ An example of passing specific construction arguments to the array constructor is: +
+ Constructor<MyArrayClass> constructor = MyArrayClass.class.getConstructor(int.Class, int.Class); + + StructuredArray<MyElementClass> array = + new PrimitiveArrayBuilder( + MyArrayClass.class, + length). + arrayCtorAndArgs(constructor, initArg1, initArg2). + build(); +
| Constructor and Description | +
|---|
PrimitiveArrayBuilder(java.lang.Class<S> arrayClass,
+ long length)
+Constructs a new
+PrimitiveArrayBuilder object for creating arrays of
+ type S with the given length. |
+
| Modifier and Type | +Method and Description | +
|---|---|
PrimitiveArrayBuilder<S> |
+arrayCtorAndArgs(java.lang.reflect.Constructor<S> constructor,
+ java.lang.Object... args)
+Set the
+Constructor and construction arguments to be used in constructing arrays. |
+
PrimitiveArrayBuilder<S> |
+arrayCtorAndArgs(CtorAndArgs<S> arrayCtorAndArgs)
+Set the
+CtorAndArgs to be used in constructing arrays. |
+
S |
+build()
+Build a
+AbstractPrimitiveArray according to the information captured in this builder |
+
CtorAndArgs<S> |
+getArrayCtorAndArgs()
+Get the
+CtorAndArgs describing the constructor and arguments used to instantiate arrays with
+ this builder. |
+
PrimitiveArrayModel<S> |
+getArrayModel()
+Get the
+PrimitiveArrayModel that describes the arrays built by this builder |
+
PrimitiveArrayBuilder<S> |
+resolve()
+Resolve any not-yet-resolved constructor information needed by this builder.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic PrimitiveArrayBuilder(java.lang.Class<S> arrayClass, + long length)+
PrimitiveArrayBuilder object for creating arrays of
+ type S with the given length.arrayClass - The class of the array to be built by this builderlength - The length of the array to be build by this builderpublic PrimitiveArrayBuilder<S> arrayCtorAndArgs(CtorAndArgs<S> arrayCtorAndArgs)+
CtorAndArgs to be used in constructing arrays.
+ Setting the means for array construction is Required if the array class (S) does not support a
+ default constructor, or if a non-default construction of the array instance is needed.arrayCtorAndArgs - The constructor and arguments used for constructing arrayspublic PrimitiveArrayBuilder<S> arrayCtorAndArgs(java.lang.reflect.Constructor<S> constructor, + java.lang.Object... args)+
Constructor and construction arguments to be used in constructing arrays.
+ Setting the means for array construction is Required if the array class (S) does not support a
+ default constructor, or if a non-default construction of the array instance is needed.constructor - The constructor used for constructing arraysargs - The construction arguments supplied for the constructorpublic PrimitiveArrayBuilder<S> resolve() + throws java.lang.NoSuchMethodException+
java.lang.NoSuchMethodException - if the array constructor or element constructor fail to resolve given
+ the current information in the builderpublic S build() + throws java.lang.NoSuchMethodException+
AbstractPrimitiveArray according to the information captured in this builderAbstractPrimitiveArrayjava.lang.NoSuchMethodException - if the array constructor or element constructor fail to resolve given
+ the current information in the builderpublic PrimitiveArrayModel<S> getArrayModel()+
PrimitiveArrayModel that describes the arrays built by this builderPrimitiveArrayModel that describes the arrays built by this builderpublic CtorAndArgs<S> getArrayCtorAndArgs()+
CtorAndArgs describing the constructor and arguments used to instantiate arrays with
+ this builder. May be null if non of arrayCtorAndArgs,
+ resolve() or
+ build() have been called yet.CtorAndArgs describing the constructor and arguments used to instantiate arrays with
+ this builder.S - The class of the PrimitiveArray modeled by the modelpublic class PrimitiveArrayModel<S extends AbstractPrimitiveArray>
+extends java.lang.Object
+| Constructor and Description | +
|---|
PrimitiveArrayModel(java.lang.Class<S> arrayClass,
+ long length)
+Create a model of a PrimitiveArray instance
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
boolean |
+equals(java.lang.Object other)
+Determine if this model is equal to another object.
+ |
+
java.lang.Class<S> |
+getArrayClass()
+Get the class of the PrimitiveArray modeled by this model
+ |
+
long |
+getLength()
+Get the length of the PrimitiveArray modeled by the model
+ |
+
getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic PrimitiveArrayModel(java.lang.Class<S> arrayClass, + long length)+
arrayClass - The class of the PrimitiveArray modeled by the modellength - The length of the PrimitiveArray modeled by the modelpublic boolean equals(java.lang.Object other)+
equals in class java.lang.Objectother - the other objectpublic final java.lang.Class<S> getArrayClass()+
public final long getLength()+
public class PrimitiveByteArray +extends AbstractPrimitiveArray+
| Constructor and Description | +
|---|
PrimitiveByteArray()
+Default constructor
+ |
+
PrimitiveByteArray(PrimitiveByteArray sourceArray)
+Copying constructor
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
byte[] |
+asArray()
+Get a reference to a byte[] that represents the contents of this array.
+ |
+
static <A extends PrimitiveByteArray> |
+copyInstance(A source)
+Create a new <A extends
+PrimitiveByteArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
static <A extends PrimitiveByteArray> |
+copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ A source)
+Create a new <A extends
+PrimitiveByteArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
byte |
+get(int index)
+Get the value of an element in the array.
+ |
+
byte |
+get(long index)
+Get the value of an element in the array.
+ |
+
long |
+getLength()
+Get the length of the array
+ |
+
static <A extends PrimitiveByteArray> |
+newInstance(java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveByteArray> with a given length. |
+
static <A extends PrimitiveByteArray> |
+newInstance(CtorAndArgs<A> arrayCtorAndArgs,
+ long length)
+Create a new instance of <A extends
+PrimitiveByteArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static PrimitiveByteArray |
+newInstance(long length)
+Create a new instance of
+PrimitiveByteArray with a given length. |
+
static <A extends PrimitiveByteArray> |
+newInstance(long length,
+ java.lang.reflect.Constructor<A> arrayConstructor,
+ java.lang.Object... arrayConstructorArgs)
+Create a new instance of <A extends
+PrimitiveByteArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static <A extends PrimitiveByteArray> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveByteArray> with a given length. |
+
void |
+set(int index,
+ byte value)
+set the value of an element in the array.
+ |
+
void |
+set(long index,
+ byte value)
+set the value of an element in the array.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic PrimitiveByteArray()+
public PrimitiveByteArray(PrimitiveByteArray sourceArray)+
sourceArray - the array to copypublic byte[] asArray() + throws java.lang.IllegalStateException+
java.lang.IllegalStateException - if array is too long to represent as a byte[]public long getLength()+
public byte get(int index)+
index - the index of the elementpublic byte get(long index)+
index - the index of the elementpublic void set(int index, + byte value)+
index - the index of the element to setvalue - the value to assign to the elementpublic void set(long index, + byte value)+
index - the index of the element to setvalue - the value to assign to the elementpublic static PrimitiveByteArray newInstance(long length)+
PrimitiveByteArray with a given length.length - the length of the array.PrimitiveByteArray with the given lengthpublic static <A extends PrimitiveByteArray> A newInstance(java.lang.Class<A> arrayClass, + long length)+
PrimitiveByteArray> with a given length.A - The class of the array to be created (extends PrimitiveByteArray)arrayClass - The class of the array to be created (extends PrimitiveByteArray)length - the length of the array.PrimitiveByteArray> with a given lengthpublic static <A extends PrimitiveByteArray> A newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<A> arrayClass, + long length)+
PrimitiveByteArray> with a given length.A - The class of the array to be created (extends PrimitiveByteArray)lookup - The lookup object to use for accessing the array's constructorarrayClass - The class of the array to be created (extends PrimitiveByteArray)length - the length of the array.PrimitiveByteArray> with a given lengthpublic static <A extends PrimitiveByteArray> A newInstance(CtorAndArgs<A> arrayCtorAndArgs, + long length)+
PrimitiveByteArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveByteArray)length - The length of the array.arrayCtorAndArgs - for creating the arrayPrimitiveByteArray>public static <A extends PrimitiveByteArray> A newInstance(long length, + java.lang.reflect.Constructor<A> arrayConstructor, + java.lang.Object... arrayConstructorArgs)+
PrimitiveByteArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveByteArray)length - The length of the array.arrayConstructor - The array constructor to usearrayConstructorArgs - The arguments to pass to the array constructorPrimitiveByteArray>public static <A extends PrimitiveByteArray> A copyInstance(A source) + throws java.lang.NoSuchMethodException+
PrimitiveByteArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveByteArray)source - The array to replicatePrimitiveByteArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic static <A extends PrimitiveByteArray> A copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, + A source) + throws java.lang.NoSuchMethodException+
PrimitiveByteArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveByteArray)lookup - The lookup object to use for accessing the array's constructorsource - The array to replicatePrimitiveByteArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic class PrimitiveCharArray +extends AbstractPrimitiveArray+
| Constructor and Description | +
|---|
PrimitiveCharArray()
+Default constructor
+ |
+
PrimitiveCharArray(PrimitiveCharArray sourceArray)
+Copying constructor
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
char[] |
+asArray()
+Get a reference to a char[] that represents the contents of this array.
+ |
+
static <A extends PrimitiveCharArray> |
+copyInstance(A source)
+Create a new <A extends
+PrimitiveCharArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
static <A extends PrimitiveCharArray> |
+copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ A source)
+Create a new <A extends
+PrimitiveCharArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
char |
+get(int index)
+Get the value of an element in the array.
+ |
+
char |
+get(long index)
+Get the value of an element in the array.
+ |
+
long |
+getLength()
+Get the length of the array
+ |
+
static <A extends PrimitiveCharArray> |
+newInstance(java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveCharArray> with a given length. |
+
static <A extends PrimitiveCharArray> |
+newInstance(CtorAndArgs<A> arrayCtorAndArgs,
+ long length)
+Create a new instance of <A extends
+PrimitiveCharArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static PrimitiveCharArray |
+newInstance(long length)
+Create a new instance of
+PrimitiveCharArray with a given length. |
+
static <A extends PrimitiveCharArray> |
+newInstance(long length,
+ java.lang.reflect.Constructor<A> arrayConstructor,
+ java.lang.Object... arrayConstructorArgs)
+Create a new instance of <A extends
+PrimitiveCharArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static <A extends PrimitiveCharArray> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveCharArray> with a given length. |
+
void |
+set(int index,
+ char value)
+set the value of an element in the array.
+ |
+
void |
+set(long index,
+ char value)
+set the value of an element in the array.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic PrimitiveCharArray()+
public PrimitiveCharArray(PrimitiveCharArray sourceArray)+
sourceArray - the array to copypublic char[] asArray() + throws java.lang.IllegalStateException+
java.lang.IllegalStateException - if array is too long to represent as a char[]public long getLength()+
public char get(int index)+
index - the index of the elementpublic char get(long index)+
index - the index of the elementpublic void set(int index, + char value)+
index - the index of the element to setvalue - the value to assign to the elementpublic void set(long index, + char value)+
index - the index of the element to setvalue - the value to assign to the elementpublic static PrimitiveCharArray newInstance(long length)+
PrimitiveCharArray with a given length.length - the length of the array.PrimitiveCharArray with the given lengthpublic static <A extends PrimitiveCharArray> A newInstance(java.lang.Class<A> arrayClass, + long length)+
PrimitiveCharArray> with a given length.A - The class of the array to be created (extends PrimitiveCharArray)arrayClass - The class of the array to be created (extends PrimitiveCharArray)length - the length of the array.PrimitiveCharArray> with a given lengthpublic static <A extends PrimitiveCharArray> A newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<A> arrayClass, + long length)+
PrimitiveCharArray> with a given length.A - The class of the array to be created (extends PrimitiveCharArray)lookup - The lookup object to use for accessing the arrayClass constructorarrayClass - The class of the array to be created (extends PrimitiveCharArray)length - the length of the array.PrimitiveCharArray> with a given lengthpublic static <A extends PrimitiveCharArray> A newInstance(CtorAndArgs<A> arrayCtorAndArgs, + long length)+
PrimitiveCharArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveCharArray)length - The length of the array.arrayCtorAndArgs - for creating the arrayPrimitiveCharArray>public static <A extends PrimitiveCharArray> A newInstance(long length, + java.lang.reflect.Constructor<A> arrayConstructor, + java.lang.Object... arrayConstructorArgs)+
PrimitiveCharArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveCharArray)length - The length of the array.arrayConstructor - The array constructor to usearrayConstructorArgs - The arguments to pass to the array constructorPrimitiveCharArray>public static <A extends PrimitiveCharArray> A copyInstance(A source) + throws java.lang.NoSuchMethodException+
PrimitiveCharArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveCharArray)source - The array to replicatePrimitiveCharArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic static <A extends PrimitiveCharArray> A copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, + A source) + throws java.lang.NoSuchMethodException+
PrimitiveCharArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveCharArray)lookup - The lookup object to use for accessing the array's constructorsource - The array to replicatePrimitiveCharArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic class PrimitiveDoubleArray +extends AbstractPrimitiveArray+
| Constructor and Description | +
|---|
PrimitiveDoubleArray()
+Default constructor
+ |
+
PrimitiveDoubleArray(PrimitiveDoubleArray sourceArray)
+Copying constructor
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
double[] |
+asArray()
+Get a reference to a double[] that represents the contents of this array.
+ |
+
static <A extends PrimitiveDoubleArray> |
+copyInstance(A source)
+Create a new <A extends
+PrimitiveDoubleArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
static <A extends PrimitiveDoubleArray> |
+copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ A source)
+Create a new <A extends
+PrimitiveDoubleArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
double |
+get(int index)
+Get the value of an element in the array.
+ |
+
double |
+get(long index)
+Get the value of an element in the array.
+ |
+
long |
+getLength()
+Get the length of the array
+ |
+
static <A extends PrimitiveDoubleArray> |
+newInstance(java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveDoubleArray> with a given length. |
+
static <A extends PrimitiveDoubleArray> |
+newInstance(CtorAndArgs<A> arrayCtorAndArgs,
+ long length)
+Create a new instance of <A extends
+PrimitiveDoubleArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static PrimitiveDoubleArray |
+newInstance(long length)
+Create a new instance of
+PrimitiveDoubleArray with a given length. |
+
static <A extends PrimitiveDoubleArray> |
+newInstance(long length,
+ java.lang.reflect.Constructor<A> arrayConstructor,
+ java.lang.Object... arrayConstructorArgs)
+Create a new instance of <A extends
+PrimitiveDoubleArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static <A extends PrimitiveDoubleArray> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveDoubleArray> with a given length. |
+
void |
+set(int index,
+ double value)
+set the value of an element in the array.
+ |
+
void |
+set(long index,
+ double value)
+set the value of an element in the array.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic PrimitiveDoubleArray()+
public PrimitiveDoubleArray(PrimitiveDoubleArray sourceArray)+
sourceArray - the array to copypublic double[] asArray() + throws java.lang.IllegalStateException+
java.lang.IllegalStateException - if array is too long to represent as a double[]public long getLength()+
public double get(int index)+
index - the index of the elementpublic double get(long index)+
index - the index of the elementpublic void set(int index, + double value)+
index - the index of the element to setvalue - the value to assign to the elementpublic void set(long index, + double value)+
index - the index of the element to setvalue - the value to assign to the elementpublic static PrimitiveDoubleArray newInstance(long length)+
PrimitiveDoubleArray with a given length.length - the length of the array.PrimitiveDoubleArray with the given lengthpublic static <A extends PrimitiveDoubleArray> A newInstance(java.lang.Class<A> arrayClass, + long length)+
PrimitiveDoubleArray> with a given length.A - The class of the array to be created (extends PrimitiveDoubleArray)arrayClass - The class of the array to be created (extends PrimitiveDoubleArray)length - the length of the array.PrimitiveDoubleArray> with a given lengthpublic static <A extends PrimitiveDoubleArray> A newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<A> arrayClass, + long length)+
PrimitiveDoubleArray> with a given length.A - The class of the array to be created (extends PrimitiveDoubleArray)lookup - The lookup object to use for accessing the array's constructorarrayClass - The class of the array to be created (extends PrimitiveDoubleArray)length - the length of the array.PrimitiveDoubleArray> with a given lengthpublic static <A extends PrimitiveDoubleArray> A newInstance(CtorAndArgs<A> arrayCtorAndArgs, + long length)+
PrimitiveDoubleArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveDoubleArray)length - The length of the array.arrayCtorAndArgs - for creating the arrayPrimitiveDoubleArray>public static <A extends PrimitiveDoubleArray> A newInstance(long length, + java.lang.reflect.Constructor<A> arrayConstructor, + java.lang.Object... arrayConstructorArgs)+
PrimitiveDoubleArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveDoubleArray)length - The length of the array.arrayConstructor - The array constructor to usearrayConstructorArgs - The arguments to pass to the array constructorPrimitiveDoubleArray>public static <A extends PrimitiveDoubleArray> A copyInstance(A source) + throws java.lang.NoSuchMethodException+
PrimitiveDoubleArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveDoubleArray)source - The array to replicatePrimitiveDoubleArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic static <A extends PrimitiveDoubleArray> A copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, + A source) + throws java.lang.NoSuchMethodException+
PrimitiveDoubleArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveDoubleArray)lookup - The lookup object to use for accessing the array's constructorsource - The array to replicatePrimitiveDoubleArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic class PrimitiveFloatArray +extends AbstractPrimitiveArray+
| Constructor and Description | +
|---|
PrimitiveFloatArray()
+Default constructor
+ |
+
PrimitiveFloatArray(PrimitiveFloatArray sourceArray)
+Copying constructor
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
float[] |
+asArray()
+Get a reference to a float[] that represents the contents of this array.
+ |
+
static <A extends PrimitiveFloatArray> |
+copyInstance(A source)
+Create a new <A extends
+PrimitiveFloatArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
static <A extends PrimitiveFloatArray> |
+copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ A source)
+Create a new <A extends
+PrimitiveFloatArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
float |
+get(int index)
+Get the value of an element in the array.
+ |
+
float |
+get(long index)
+Get the value of an element in the array.
+ |
+
long |
+getLength()
+Get the length of the array
+ |
+
static <A extends PrimitiveFloatArray> |
+newInstance(java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveFloatArray> with a given length. |
+
static <A extends PrimitiveFloatArray> |
+newInstance(CtorAndArgs<A> arrayCtorAndArgs,
+ long length)
+Create a new instance of <A extends
+PrimitiveFloatArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static PrimitiveFloatArray |
+newInstance(long length)
+Create a new instance of
+PrimitiveFloatArray with a given length. |
+
static <A extends PrimitiveFloatArray> |
+newInstance(long length,
+ java.lang.reflect.Constructor<A> arrayConstructor,
+ java.lang.Object... arrayConstructorArgs)
+Create a new instance of <A extends
+PrimitiveFloatArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static <A extends PrimitiveFloatArray> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveFloatArray> with a given length. |
+
void |
+set(int index,
+ float value)
+set the value of an element in the array.
+ |
+
void |
+set(long index,
+ float value)
+set the value of an element in the array.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic PrimitiveFloatArray()+
public PrimitiveFloatArray(PrimitiveFloatArray sourceArray)+
sourceArray - the array to copypublic float[] asArray() + throws java.lang.IllegalStateException+
java.lang.IllegalStateException - if array is too long to represent as a float[]public long getLength()+
public float get(int index)+
index - the index of the elementpublic float get(long index)+
index - the index of the elementpublic void set(int index, + float value)+
index - the index of the element to setvalue - the value to assign to the elementpublic void set(long index, + float value)+
index - the index of the element to setvalue - the value to assign to the elementpublic static PrimitiveFloatArray newInstance(long length)+
PrimitiveFloatArray with a given length.length - the length of the array.PrimitiveFloatArray with the given lengthpublic static <A extends PrimitiveFloatArray> A newInstance(java.lang.Class<A> arrayClass, + long length)+
PrimitiveFloatArray> with a given length.A - The class of the array to be created (extends PrimitiveFloatArray)arrayClass - The class of the array to be created (extends PrimitiveFloatArray)length - the length of the array.PrimitiveFloatArray> with a given lengthpublic static <A extends PrimitiveFloatArray> A newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<A> arrayClass, + long length)+
PrimitiveFloatArray> with a given length.A - The class of the array to be created (extends PrimitiveFloatArray)lookup - The lookup object to use for accessing the array's constructorarrayClass - The class of the array to be created (extends PrimitiveFloatArray)length - the length of the array.PrimitiveFloatArray> with a given lengthpublic static <A extends PrimitiveFloatArray> A newInstance(CtorAndArgs<A> arrayCtorAndArgs, + long length)+
PrimitiveFloatArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveFloatArray)length - The length of the array.arrayCtorAndArgs - for creating the arrayPrimitiveFloatArray>public static <A extends PrimitiveFloatArray> A newInstance(long length, + java.lang.reflect.Constructor<A> arrayConstructor, + java.lang.Object... arrayConstructorArgs)+
PrimitiveFloatArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveFloatArray)length - The length of the array.arrayConstructor - The array constructor to usearrayConstructorArgs - The arguments to pass to the array constructorPrimitiveFloatArray>public static <A extends PrimitiveFloatArray> A copyInstance(A source) + throws java.lang.NoSuchMethodException+
PrimitiveFloatArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveFloatArray)source - The array to replicatePrimitiveFloatArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic static <A extends PrimitiveFloatArray> A copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, + A source) + throws java.lang.NoSuchMethodException+
PrimitiveFloatArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveFloatArray)lookup - The lookup object to use for accessing the array's constructorsource - The array to replicatePrimitiveFloatArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic class PrimitiveIntArray +extends AbstractPrimitiveArray+
| Constructor and Description | +
|---|
PrimitiveIntArray()
+Default constructor
+ |
+
PrimitiveIntArray(PrimitiveIntArray sourceArray)
+Copying constructor
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
int[] |
+asArray()
+Get a reference to a int[] that represents the contents of this array.
+ |
+
static <A extends PrimitiveIntArray> |
+copyInstance(A source)
+Create a new <A extends
+PrimitiveIntArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
static <A extends PrimitiveIntArray> |
+copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ A source)
+Create a new <A extends
+PrimitiveIntArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
int |
+get(int index)
+Get the value of an element in the array.
+ |
+
int |
+get(long index)
+Get the value of an element in the array.
+ |
+
long |
+getLength()
+Get the length of the array
+ |
+
static <A extends PrimitiveIntArray> |
+newInstance(java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveIntArray> with a given length. |
+
static <A extends PrimitiveIntArray> |
+newInstance(CtorAndArgs<A> arrayCtorAndArgs,
+ long length)
+Create a new instance of <A extends
+PrimitiveIntArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static PrimitiveIntArray |
+newInstance(long length)
+Create a new instance of
+PrimitiveIntArray with a given length. |
+
static <A extends PrimitiveIntArray> |
+newInstance(long length,
+ java.lang.reflect.Constructor<A> arrayConstructor,
+ java.lang.Object... arrayConstructorArgs)
+Create a new instance of <A extends
+PrimitiveIntArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static <A extends PrimitiveIntArray> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveIntArray> with a given length. |
+
void |
+set(int index,
+ int value)
+set the value of an element in the array.
+ |
+
void |
+set(long index,
+ int value)
+set the value of an element in the array.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic PrimitiveIntArray()+
public PrimitiveIntArray(PrimitiveIntArray sourceArray)+
sourceArray - the array to copypublic int[] asArray() + throws java.lang.IllegalStateException+
java.lang.IllegalStateException - if array is too long to represent as a int[]public long getLength()+
public int get(int index)+
index - the index of the elementpublic int get(long index)+
index - the index of the elementpublic void set(int index, + int value)+
index - the index of the element to setvalue - the value to assign to the elementpublic void set(long index, + int value)+
index - the index of the element to setvalue - the value to assign to the elementpublic static PrimitiveIntArray newInstance(long length)+
PrimitiveIntArray with a given length.length - the length of the array.PrimitiveIntArray with the given lengthpublic static <A extends PrimitiveIntArray> A newInstance(java.lang.Class<A> arrayClass, + long length)+
PrimitiveIntArray> with a given length.A - The class of the array to be created (extends PrimitiveIntArray)arrayClass - The class of the array to be created (extends PrimitiveIntArray)length - the length of the array.PrimitiveIntArray> with a given lengthpublic static <A extends PrimitiveIntArray> A newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<A> arrayClass, + long length)+
PrimitiveIntArray> with a given length.A - The class of the array to be created (extends PrimitiveIntArray)lookup - The lookup object to use for accessing the array's constructorarrayClass - The class of the array to be created (extends PrimitiveIntArray)length - the length of the array.PrimitiveIntArray> with a given lengthpublic static <A extends PrimitiveIntArray> A newInstance(CtorAndArgs<A> arrayCtorAndArgs, + long length)+
PrimitiveIntArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveIntArray)length - The length of the array.arrayCtorAndArgs - for creating the arrayPrimitiveIntArray>public static <A extends PrimitiveIntArray> A newInstance(long length, + java.lang.reflect.Constructor<A> arrayConstructor, + java.lang.Object... arrayConstructorArgs)+
PrimitiveIntArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveIntArray)length - The length of the array.arrayConstructor - The array constructor to usearrayConstructorArgs - The arguments to pass to the array constructorPrimitiveIntArray>public static <A extends PrimitiveIntArray> A copyInstance(A source) + throws java.lang.NoSuchMethodException+
PrimitiveIntArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveIntArray)source - The array to replicatePrimitiveIntArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic static <A extends PrimitiveIntArray> A copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, + A source) + throws java.lang.NoSuchMethodException+
PrimitiveIntArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveIntArray)lookup - The lookup object to use for accessing the array's constructorsource - The array to replicatePrimitiveIntArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic class PrimitiveLongArray +extends AbstractPrimitiveArray+
| Constructor and Description | +
|---|
PrimitiveLongArray()
+Default constructor
+ |
+
PrimitiveLongArray(PrimitiveLongArray sourceArray)
+Copying constructor
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
long[] |
+asArray()
+Get a reference to a long[] that represents the contents of this array.
+ |
+
static <A extends PrimitiveLongArray> |
+copyInstance(A source)
+Create a new <A extends
+PrimitiveLongArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
static <A extends PrimitiveLongArray> |
+copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ A source)
+Create a new <A extends
+PrimitiveLongArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
long |
+get(int index)
+Get the value of an element in the array.
+ |
+
long |
+get(long index)
+Get the value of an element in the array.
+ |
+
long |
+getLength()
+Get the length of the array
+ |
+
static <A extends PrimitiveLongArray> |
+newInstance(java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveLongArray> with a given length. |
+
static <A extends PrimitiveLongArray> |
+newInstance(CtorAndArgs<A> arrayCtorAndArgs,
+ long length)
+Create a new instance of <A extends
+PrimitiveLongArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static PrimitiveLongArray |
+newInstance(long length)
+Create a new instance of
+PrimitiveLongArray with a given length. |
+
static <A extends PrimitiveLongArray> |
+newInstance(long length,
+ java.lang.reflect.Constructor<A> arrayConstructor,
+ java.lang.Object... arrayConstructorArgs)
+Create a new instance of <A extends
+PrimitiveLongArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static <A extends PrimitiveLongArray> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveLongArray> with a given length. |
+
void |
+set(int index,
+ long value)
+set the value of an element in the array.
+ |
+
void |
+set(long index,
+ long value)
+set the value of an element in the array.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic PrimitiveLongArray()+
public PrimitiveLongArray(PrimitiveLongArray sourceArray)+
sourceArray - the array to copypublic long[] asArray()+
java.lang.IllegalStateException - if array is too long to represent as a long[]public long getLength()+
public long get(int index)+
index - the index of the elementpublic long get(long index)+
index - the index of the elementpublic void set(int index, + long value)+
index - the index of the element to setvalue - the value to assign to the elementpublic void set(long index, + long value)+
index - the index of the element to setvalue - the value to assign to the elementpublic static PrimitiveLongArray newInstance(long length)+
PrimitiveLongArray with a given length.length - the length of the array.PrimitiveLongArray with the given lengthpublic static <A extends PrimitiveLongArray> A newInstance(java.lang.Class<A> arrayClass, + long length)+
PrimitiveLongArray> with a given length.A - The class of the array to be created (extends PrimitiveLongArray)arrayClass - The class of the array to be created (extends PrimitiveLongArray)length - the length of the array.PrimitiveLongArray> with a given lengthpublic static <A extends PrimitiveLongArray> A newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<A> arrayClass, + long length)+
PrimitiveLongArray> with a given length.A - The class of the array to be created (extends PrimitiveLongArray)lookup - The lookup object to use for accessing the array's constructorarrayClass - The class of the array to be created (extends PrimitiveLongArray)length - the length of the array.PrimitiveLongArray> with a given lengthpublic static <A extends PrimitiveLongArray> A newInstance(CtorAndArgs<A> arrayCtorAndArgs, + long length)+
PrimitiveLongArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveLongArray)length - The length of the array.arrayCtorAndArgs - for creating the arrayPrimitiveLongArray>public static <A extends PrimitiveLongArray> A newInstance(long length, + java.lang.reflect.Constructor<A> arrayConstructor, + java.lang.Object... arrayConstructorArgs)+
PrimitiveLongArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveLongArray)length - The length of the array.arrayConstructor - The array constructor to usearrayConstructorArgs - The arguments to pass to the array constructorPrimitiveLongArray>public static <A extends PrimitiveLongArray> A copyInstance(A source) + throws java.lang.NoSuchMethodException+
PrimitiveLongArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveLongArray)source - The array to replicatePrimitiveLongArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic static <A extends PrimitiveLongArray> A copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, + A source) + throws java.lang.NoSuchMethodException+
PrimitiveLongArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveLongArray)lookup - The lookup object to use for accessing the array's constructorsource - The array to replicatePrimitiveLongArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic class PrimitiveShortArray +extends AbstractPrimitiveArray+
| Constructor and Description | +
|---|
PrimitiveShortArray()
+Default constructor
+ |
+
PrimitiveShortArray(PrimitiveShortArray sourceArray)
+Copying constructor
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
short[] |
+asArray()
+Get a reference to a short[] that represents the contents of this array.
+ |
+
static <A extends PrimitiveShortArray> |
+copyInstance(A source)
+Create a new <A extends
+PrimitiveShortArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
static <A extends PrimitiveShortArray> |
+copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ A source)
+Create a new <A extends
+PrimitiveShortArray> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
short |
+get(int index)
+Get the value of an element in the array.
+ |
+
short |
+get(long index)
+Get the value of an element in the array.
+ |
+
long |
+getLength()
+Get the length of the array
+ |
+
static <A extends PrimitiveShortArray> |
+newInstance(java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveShortArray> with a given length. |
+
static <A extends PrimitiveShortArray> |
+newInstance(CtorAndArgs<A> arrayCtorAndArgs,
+ long length)
+Create a new instance of <A extends
+PrimitiveShortArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static PrimitiveShortArray |
+newInstance(long length)
+Create a new instance of
+PrimitiveShortArray with a given length. |
+
static <A extends PrimitiveShortArray> |
+newInstance(long length,
+ java.lang.reflect.Constructor<A> arrayConstructor,
+ java.lang.Object... arrayConstructorArgs)
+Create a new instance of <A extends
+PrimitiveShortArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static <A extends PrimitiveShortArray> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+PrimitiveShortArray> with a given length. |
+
void |
+set(int index,
+ short value)
+set the value of an element in the array.
+ |
+
void |
+set(long index,
+ short value)
+set the value of an element in the array.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic PrimitiveShortArray()+
public PrimitiveShortArray(PrimitiveShortArray sourceArray)+
sourceArray - the array to copypublic short[] asArray() + throws java.lang.IllegalStateException+
java.lang.IllegalStateException - if array is too long to represent as a short[]public long getLength()+
public short get(int index)+
index - the index of the elementpublic short get(long index)+
index - the index of the elementpublic void set(int index, + short value)+
index - the index of the element to setvalue - the value to assign to the elementpublic void set(long index, + short value)+
index - the index of the element to setvalue - the value to assign to the elementpublic static PrimitiveShortArray newInstance(long length)+
PrimitiveShortArray with a given length.length - the length of the array.PrimitiveShortArray with the given lengthpublic static <A extends PrimitiveShortArray> A newInstance(java.lang.Class<A> arrayClass, + long length)+
PrimitiveShortArray> with a given length.A - The class of the array to be created (extends PrimitiveShortArray)arrayClass - The class of the array to be created (extends PrimitiveShortArray)length - the length of the array.PrimitiveShortArray> with a given lengthpublic static <A extends PrimitiveShortArray> A newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<A> arrayClass, + long length)+
PrimitiveShortArray> with a given length.A - The class of the array to be created (extends PrimitiveShortArray)lookup - The lookup object to use for accessing the array's constructorarrayClass - The class of the array to be created (extends PrimitiveShortArray)length - the length of the array.PrimitiveShortArray> with a given lengthpublic static <A extends PrimitiveShortArray> A newInstance(CtorAndArgs<A> arrayCtorAndArgs, + long length)+
PrimitiveShortArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveShortArray)length - The length of the array.arrayCtorAndArgs - for creating the arrayPrimitiveShortArray>public static <A extends PrimitiveShortArray> A newInstance(long length, + java.lang.reflect.Constructor<A> arrayConstructor, + java.lang.Object... arrayConstructorArgs)+
PrimitiveShortArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends PrimitiveShortArray)length - The length of the array.arrayConstructor - The array constructor to usearrayConstructorArgs - The arguments to pass to the array constructorPrimitiveShortArray>public static <A extends PrimitiveShortArray> A copyInstance(A source) + throws java.lang.NoSuchMethodException+
PrimitiveShortArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveShortArray)source - The array to replicatePrimitiveShortArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic static <A extends PrimitiveShortArray> A copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, + A source) + throws java.lang.NoSuchMethodException+
PrimitiveShortArray> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends PrimitiveShortArray)lookup - The lookup object to use for accessing the array's constructorsource - The array to replicatePrimitiveShortArray> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorT - The reference typepublic class ReferenceArray<T> +extends AbstractPrimitiveArray+
| Constructor and Description | +
|---|
ReferenceArray()
+Default constructor
+ |
+
ReferenceArray(ReferenceArray<T> sourceArray)
+Copy constructor
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
T[] |
+asArray()
+Get a reference to a T[] that represents the contents of this array.
+ |
+
static <T,A extends ReferenceArray<T>> |
+copyInstance(A source)
+Create a new <A extends
+ReferenceArray<T>> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
static <T,A extends ReferenceArray<T>> |
+copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ A source)
+Create a new <A extends
+ReferenceArray<T>> instance, using a copy constructor to
+ replicate the contents of the given source array |
+
T |
+get(int index)
+Get the value of an element in the array.
+ |
+
T |
+get(long index)
+Get the value of an element in the array.
+ |
+
long |
+getLength()
+Get the length of the array
+ |
+
static <T,A extends ReferenceArray<T>> |
+newInstance(java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+ReferenceArray<T>> with a given length. |
+
static <A extends ReferenceArray> |
+newInstance(CtorAndArgs<A> arrayCtorAndArgs,
+ long length)
+Create a new instance of <A extends
+ReferenceArray> with a given length,
+ array constructor, and array constructor arguments. |
+
static <T> ReferenceArray<T> |
+newInstance(long length)
+Create a new instance of ReferenceArray<T> with a given length.
+ |
+
static <T,A extends ReferenceArray<T>> |
+newInstance(long length,
+ java.lang.reflect.Constructor<A> arrayConstructor,
+ java.lang.Object... arrayConstructorArgs)
+Create a new instance of <A extends
+ReferenceArray<T>> with a given length,
+ array constructor, and array constructor arguments. |
+
static <T,A extends ReferenceArray<T>> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<A> arrayClass,
+ long length)
+Create a new instance of <A extends
+ReferenceArray<T>> with a given length. |
+
void |
+set(int index,
+ T value)
+set the value of an element in the array.
+ |
+
void |
+set(long index,
+ T value)
+set the value of an element in the array.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic ReferenceArray()+
public ReferenceArray(ReferenceArray<T> sourceArray)+
sourceArray - the array to copypublic T[] asArray() + throws java.lang.IllegalStateException+
java.lang.IllegalStateException - if array is too long to represent as a T[]public long getLength()+
public T get(int index)+
index - the index of the elementpublic T get(long index)+
index - the index of the elementpublic void set(int index, + T value)+
index - the index of the element to setvalue - the value to assign to the elementpublic void set(long index, + T value)+
index - the index of the element to setvalue - the value to assign to the elementpublic static <T> ReferenceArray<T> newInstance(long length)+
T - the reference typelength - the length of the arraypublic static <T,A extends ReferenceArray<T>> A newInstance(java.lang.Class<A> arrayClass, + long length)+
ReferenceArray<T>> with a given length.T - the reference typeA - The class of the array to be created (extends ReferenceArray<T>)arrayClass - The class of the array to be created (extends ReferenceArray<T>)length - the length of the array.ReferenceArray<T>> with a given lengthpublic static <T,A extends ReferenceArray<T>> A newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<A> arrayClass, + long length)+
ReferenceArray<T>> with a given length.T - the reference typeA - The class of the array to be created (extends ReferenceArray<T>)lookup - The lookup object to use for accessing the array's constructorarrayClass - The class of the array to be created (extends ReferenceArray<T>)length - the length of the array.ReferenceArray<T>> with a given lengthpublic static <A extends ReferenceArray> A newInstance(CtorAndArgs<A> arrayCtorAndArgs, + long length)+
ReferenceArray> with a given length,
+ array constructor, and array constructor arguments.A - The class of the array to be created (extends ReferenceArray)length - The length of the array.arrayCtorAndArgs - for creating the arrayReferenceArray>public static <T,A extends ReferenceArray<T>> A newInstance(long length, + java.lang.reflect.Constructor<A> arrayConstructor, + java.lang.Object... arrayConstructorArgs)+
ReferenceArray<T>> with a given length,
+ array constructor, and array constructor arguments.T - the reference typeA - The class of the array to be created (extends ReferenceArray<T>)length - The length of the array.arrayConstructor - The array constructor to usearrayConstructorArgs - The arguments to pass to the array constructorReferenceArray<T>>public static <T,A extends ReferenceArray<T>> A copyInstance(A source) + throws java.lang.NoSuchMethodException+
ReferenceArray<T>> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends ReferenceArray<T>)T - The class of the element in the array to be createdsource - The array to replicateReferenceArray<T>> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic static <T,A extends ReferenceArray<T>> A copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, + A source) + throws java.lang.NoSuchMethodException+
ReferenceArray<T>> instance, using a copy constructor to
+ replicate the contents of the given source arrayA - The class of the array to be created (extends ReferenceArray<T>)T - The class of the element in the array to be createdlookup - The lookup object to use for accessing the array's constructorsource - The array to replicateReferenceArray<T>> copied from the source arrayjava.lang.NoSuchMethodException - if <A> does not have a copy constructorpublic class StructuredArray.ElementIterator
+extends java.lang.Object
+implements java.util.Iterator<T>
+Iterator with the ability to be reset() enabling reuse.| Constructor and Description | +
|---|
ElementIterator() |
+
ElementIterator(long offset,
+ long length) |
+
| Modifier and Type | +Method and Description | +
|---|---|
long |
+getCursor() |
+
boolean |
+hasNext() |
+
T |
+next() |
+
void |
+remove()
+Remove operation is not supported on
+StructuredArrays. |
+
void |
+reset()
+Reset to the beginning of the collection enabling reuse of the iterator.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic ElementIterator()+
public ElementIterator(long offset, + long length)+
public boolean hasNext()+
hasNext in interface java.util.Iterator<T>public void remove()+
StructuredArrays.remove in interface java.util.Iterator<T>java.lang.UnsupportedOperationException - if called.public void reset()+
public long getCursor()+
T - The class of the array elementspublic class StructuredArray<T>
+extends java.lang.Object
+implements java.lang.Iterable<T>
+
+ A structured array contains array element objects of a fixed (at creation time, per array instance) class,
+ and can support elements of any class that provides accessible constructors. The elements in a StructuredArray
+ are all allocated and constructed at array creation time, and individual elements cannot be removed or
+ replaced after array creation. Array elements can be accessed using an index-based accessor methods in
+ the form of get(long)() using either int or long indices. Individual element contents
+ can then be accessed and manipulated using any and all operations supported by the member element's class.
+
+ While simple creation of default-constructed elements and fixed constructor parameters are available through
+ the newInstance factory methods, supporting arbitrary member types requires a wider range of construction
+ options. The CtorAndArgsProvider API provides for array creation with arbitrary, user-supplied
+ constructors and arguments, the selection of which can take the element index and construction context
+ into account.
+
+ StructuredArray is designed with semantics specifically chosen and restricted such that a "flat" memory + layout of the implemented data structure would be possible on optimizing JVMs. Doing so provides for the + possibility of matching access speed benefits that exist in data structures with similar semantics that + are supported in other languages (e.g. an array of structs in C-like languages). While fully functional + on all JVM implementation (of Java SE 6 and above), the semantics are such that a JVM may transparently + optimise the implementation to provide a compact contiguous layout that facilitates consistent stride + based memory access and dead-reckoning (as opposed to de-referenced) access to elements
| Modifier and Type | +Class and Description | +
|---|---|
class |
+StructuredArray.ElementIterator
+Specialised
+Iterator with the ability to be StructuredArray.ElementIterator.reset() enabling reuse. |
+
| Modifier and Type | +Method and Description | +
|---|---|
static <S extends StructuredArray<T>,T> |
+copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ S source)
+Copy a given array of elements to a newly created array.
+ |
+
static <S extends StructuredArray<T>,T> |
+copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ S source,
+ long[] sourceOffsets,
+ long[] counts)
+Copy a range from an array of elements to a newly created array.
+ |
+
static <S extends StructuredArray<T>,T> |
+copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ S source,
+ long sourceOffset,
+ long count)
+Copy a range from an array of elements to a newly created array.
+ |
+
static <S extends StructuredArray<T>,T> |
+copyInstance(S source)
+Copy a given array of elements to a newly created array.
+ |
+
static <S extends StructuredArray<T>,T> |
+copyInstance(S source,
+ long[] sourceOffsets,
+ long[] counts)
+Copy a range from an array of elements to a newly created array.
+ |
+
static <S extends StructuredArray<T>,T> |
+copyInstance(S source,
+ long sourceOffset,
+ long count)
+Copy a range from an array of elements to a newly created array.
+ |
+
T |
+get(int index)
+Get a reference to an element in a single dimensional array, using an
+int index. |
+
T |
+get(long index)
+Get a reference to an element in a single dimensional array, using a
+long index. |
+
StructuredArrayModel<? extends StructuredArray<T>,T> |
+getArrayModel()
+Get the array model
+ |
+
java.lang.Class<T> |
+getElementClass()
+Get the
+Class of elements stored in the array. |
+
long |
+getLength()
+Get the length (number of elements) of the array.
+ |
+
StructuredArray.ElementIterator |
+iterator() |
+
static <S extends StructuredArray<T>,T> |
+newInstance(java.lang.Class<S> arrayClass,
+ java.lang.Class<T> elementClass,
+ java.util.Collection<T> sourceCollection)
+Create a <S extends StructuredArray<T>> array instance with elements copied from a source
+ collection.
+ |
+
static <S extends StructuredArray<T>,T> |
+newInstance(java.lang.Class<S> arrayClass,
+ java.lang.Class<T> elementClass,
+ long length)
+Create an
+arrayClass array of length elements of
+ type elementClass. |
+
static <S extends StructuredArray<T>,T> |
+newInstance(java.lang.Class<S> arrayClass,
+ java.lang.Class<T> elementClass,
+ long length,
+ CtorAndArgsProvider<T> ctorAndArgsProvider)
+Create an
+arrayClass array of length elements, each containing an element object of
+ type elementClass. |
+
static <T> StructuredArray<T> |
+newInstance(java.lang.Class<T> elementClass,
+ CtorAndArgsProvider<T> ctorAndArgsProvider,
+ long length)
+Create an array of
+length elements of type elementClass. |
+
static <T> StructuredArray<T> |
+newInstance(java.lang.Class<T> elementClass,
+ long length)
+Create an array of
+length elements, each containing an element object of
+ type elementClass. |
+
static <S extends StructuredArray<T>,T> |
+newInstance(CtorAndArgs<S> arrayCtorAndArgs,
+ java.lang.Class<T> elementClass,
+ long length)
+Create an
+arrayCtorAndArgs.getConstructor().getDeclaringClass() array of length
+ elements of type elementClass. |
+
static <S extends StructuredArray<T>,T> |
+newInstance(CtorAndArgs<S> arrayCtorAndArgs,
+ java.lang.Class<T> elementClass,
+ long length,
+ CtorAndArgsProvider<T> ctorAndArgsProvider)
+Create an
+arrayCtorAndArgs.getConstructor().getDeclaringClass() array of length
+ elements of type elementClass. |
+
static <S extends StructuredArray<T>,T> |
+newInstance(CtorAndArgs<S> arrayCtorAndArgs,
+ CtorAndArgs<T> elementCtorAndArgs,
+ long length)
+Create an
+arrayCtorAndArgs.getConstructor().getDeclaringClass() array of length
+ elements of type elementClass. |
+
static <S extends StructuredArray<T>,T> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<S> arrayClass,
+ java.lang.Class<T> elementClass,
+ java.util.Collection<T> sourceCollection)
+Create a <S extends StructuredArray<T>> array instance with elements copied from a source
+ collection.
+ |
+
static <S extends StructuredArray<T>,T> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<S> arrayClass,
+ java.lang.Class<T> elementClass,
+ long length)
+Create an
+arrayClass array of length elements of
+ type elementClass. |
+
static <S extends StructuredArray<T>,T> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<S> arrayClass,
+ java.lang.Class<T> elementClass,
+ long length,
+ CtorAndArgsProvider<T> ctorAndArgsProvider)
+Create an
+arrayClass array of length elements, each containing an element object of
+ type elementClass. |
+
static <T> StructuredArray<T> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<T> elementClass,
+ long length)
+Create an array of
+length elements, each containing an element object of
+ type elementClass. |
+
static <S extends StructuredArray<T>,T> |
+newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
+ CtorAndArgs<S> arrayCtorAndArgs,
+ java.lang.Class<T> elementClass,
+ long length)
+Create an
+arrayCtorAndArgs.getConstructor().getDeclaringClass() array of length
+ elements of type elementClass. |
+
static <S extends StructuredArray<T>,T> |
+newInstance(StructuredArrayBuilder<S,T> arrayBuilder)
+Create a <S extends StructuredArray<T>> array instance according to the details provided in the
+ arrayBuilder.
+ |
+
static <S extends StructuredArray<T>,T> |
+shallowCopy(S src,
+ long srcOffset,
+ S dst,
+ long dstOffset,
+ long count)
+Shallow copy a region of element object contents from one array to the other.
+ |
+
static <S extends StructuredArray<T>,T> |
+shallowCopy(S src,
+ long srcOffset,
+ S dst,
+ long dstOffset,
+ long count,
+ boolean allowFinalFieldOverwrite)
+Shallow copy a region of element object contents from one array to the other.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static <T> StructuredArray<T> newInstance(java.lang.Class<T> elementClass, + long length)+
length elements, each containing an element object of
+ type elementClass. Using the elementClass's default constructor.T - The class of the array elementselementClass - of each element in the arraylength - of the array to createpublic static <T> StructuredArray<T> newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<T> elementClass, + long length)+
length elements, each containing an element object of
+ type elementClass. Using the elementClass's default constructor.T - The class of the array elementslookup - The lookup object to use when resolving constructorselementClass - of each element in the arraylength - of the array to createpublic static <S extends StructuredArray<T>,T> S newInstance(java.lang.Class<S> arrayClass, + java.lang.Class<T> elementClass, + long length)+
arrayClass array of length elements of
+ type elementClass. Using the elementClass's default constructor.S - The class of the array to be createdT - The class of the array elementsarrayClass - of the array to createelementClass - of each element in the arraylength - of the array to createpublic static <S extends StructuredArray<T>,T> S newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<S> arrayClass, + java.lang.Class<T> elementClass, + long length)+
arrayClass array of length elements of
+ type elementClass. Using the elementClass's default constructor.S - The class of the array to be createdT - The class of the array elementslookup - The lookup object to use when resolving constructorsarrayClass - of the array to createelementClass - of each element in the arraylength - of the array to createpublic static <S extends StructuredArray<T>,T> S newInstance(CtorAndArgs<S> arrayCtorAndArgs, + java.lang.Class<T> elementClass, + long length)+
arrayCtorAndArgs.getConstructor().getDeclaringClass() array of length
+ elements of type elementClass. Use elementClass's default constructor.S - The class of the array to be createdT - The class of the array elementsarrayCtorAndArgs - for creating the arrayelementClass - of each element in the arraylength - of the array to createpublic static <S extends StructuredArray<T>,T> S newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + CtorAndArgs<S> arrayCtorAndArgs, + java.lang.Class<T> elementClass, + long length)+
arrayCtorAndArgs.getConstructor().getDeclaringClass() array of length
+ elements of type elementClass. Use elementClass's default constructor.S - The class of the array to be createdT - The class of the array elementslookup - The lookup object to use when resolving constructorsarrayCtorAndArgs - for creating the arrayelementClass - of each element in the arraylength - of the array to createpublic static <S extends StructuredArray<T>,T> S newInstance(CtorAndArgs<S> arrayCtorAndArgs, + CtorAndArgs<T> elementCtorAndArgs, + long length)+
arrayCtorAndArgs.getConstructor().getDeclaringClass() array of length
+ elements of type elementClass. Use elementClass's default constructor.S - The class of the array to be createdT - The class of the array elementsarrayCtorAndArgs - for creating the arrayelementCtorAndArgs - of each element in the arraylength - of the array to createpublic static <T> StructuredArray<T> newInstance(java.lang.Class<T> elementClass, + CtorAndArgsProvider<T> ctorAndArgsProvider, + long length)+
length elements of type elementClass. Use constructor and
+ arguments supplied (on a potentially per element index basis) by the specified
+ ctorAndArgsProvider to construct and initialize each element.T - The class of the array elementselementClass - of each element in the arrayctorAndArgsProvider - produces element constructors [potentially] on a per element basislength - of the array to createpublic static <S extends StructuredArray<T>,T> S newInstance(java.lang.Class<S> arrayClass, + java.lang.Class<T> elementClass, + long length, + CtorAndArgsProvider<T> ctorAndArgsProvider)+
arrayClass array of length elements, each containing an element object of
+ type elementClass. Use constructor and arguments supplied (on a potentially
+ per element index basis) by the specified ctorAndArgsProvider to construct and initialize
+ each element.S - The class of the array to be createdT - The class of the array elementsarrayClass - of the array to create.elementClass - of each element in the arraylength - of the array to createctorAndArgsProvider - produces element constructors [potentially] on a per element basispublic static <S extends StructuredArray<T>,T> S newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<S> arrayClass, + java.lang.Class<T> elementClass, + long length, + CtorAndArgsProvider<T> ctorAndArgsProvider)+
arrayClass array of length elements, each containing an element object of
+ type elementClass. Use constructor and arguments supplied (on a potentially
+ per element index basis) by the specified ctorAndArgsProvider to construct and initialize
+ each element.S - The class of the array to be createdT - The class of the array elementslookup - The lookup object to use when resolving constructorsarrayClass - of the array to create.elementClass - of each element in the arraylength - of the array to createctorAndArgsProvider - produces element constructors [potentially] on a per element basispublic static <S extends StructuredArray<T>,T> S newInstance(CtorAndArgs<S> arrayCtorAndArgs, + java.lang.Class<T> elementClass, + long length, + CtorAndArgsProvider<T> ctorAndArgsProvider)+
arrayCtorAndArgs.getConstructor().getDeclaringClass() array of length
+ elements of type elementClass. Use constructor and arguments
+ supplied (on a potentially per element index basis) by the specified ctorAndArgsProvider
+ to construct and initialize each element.S - The class of the array to be createdT - The class of the array elementsarrayCtorAndArgs - of the array to createelementClass - of each element in the arraylength - of the array to createctorAndArgsProvider - produces element constructors [potentially] on a per element basispublic static <S extends StructuredArray<T>,T> S newInstance(java.lang.Class<S> arrayClass, + java.lang.Class<T> elementClass, + java.util.Collection<T> sourceCollection)+
S - The class of the array to be createdT - The class of the array elementsarrayClass - of the array to create.elementClass - of each element in the arraysourceCollection - provides details for building the arraypublic static <S extends StructuredArray<T>,T> S newInstance(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<S> arrayClass, + java.lang.Class<T> elementClass, + java.util.Collection<T> sourceCollection)+
S - The class of the array to be createdT - The class of the array elementslookup - The lookup object to use when resolving constructorsarrayClass - of the array to create.elementClass - of each element in the arraysourceCollection - provides details for building the arraypublic static <S extends StructuredArray<T>,T> S newInstance(StructuredArrayBuilder<S,T> arrayBuilder)+
S - The class of the array to be createdT - The class of the array elementsarrayBuilder - provides details for building the arraypublic static <S extends StructuredArray<T>,T> S copyInstance(S source)+
elementClass copy constructor to construct the individual member elements of the new
+ array based on the corresponding elements of the source array.S - The class of the array to be createdT - The class of the array elementssource - The array to duplicatepublic static <S extends StructuredArray<T>,T> S copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, + S source)+
elementClass copy constructor to construct the individual member elements of the new
+ array based on the corresponding elements of the source array.S - The class of the array to be createdT - The class of the array elementslookup - The lookup object to use when resolving constructorssource - The array to duplicatepublic static <S extends StructuredArray<T>,T> S copyInstance(S source, + long sourceOffset, + long count)+
elementClass copy constructor to construct the individual member elements of
+ the new array based on the corresponding elements of the source array.S - The class of the array to be createdT - The class of the array elementssource - The array to copy fromsourceOffset - offset index, indicating where the source region to be copied beginscount - the number of elements to copypublic static <S extends StructuredArray<T>,T> S copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, + S source, + long sourceOffset, + long count)+
elementClass copy constructor to construct the individual member elements of
+ the new array based on the corresponding elements of the source array.S - The class of the array to be createdT - The class of the array elementslookup - The lookup object to use when resolving constructorssource - The array to copy fromsourceOffset - offset index, indicating where the source region to be copied beginscount - the number of elements to copypublic static <S extends StructuredArray<T>,T> S copyInstance(S source, + long[] sourceOffsets, + long[] counts)+
elementClass copy constructor to construct the individual member elements of
+ the new array based on the corresponding elements of the source array.
+ + This form is useful [only] for copying partial ranges from nested StructuredArrays. +
S - The class of the array to be createdT - The class of the array elementssource - The array to copy fromsourceOffsets - offset indexes, indicating where the source region to be copied begins at each
+ StructuredArray nesting depthcounts - the number of elements to copy at each StructuredArray nesting depthpublic static <S extends StructuredArray<T>,T> S copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, + S source, + long[] sourceOffsets, + long[] counts)+
elementClass copy constructor to construct the individual member elements of
+ the new array based on the corresponding elements of the source array.
+ + This form is useful [only] for copying partial ranges from nested StructuredArrays. +
S - The class of the array to be createdT - The class of the array elementslookup - The lookup object to use when resolving constructorssource - The array to copy fromsourceOffsets - offset indexes, indicating where the source region to be copied begins at each
+ StructuredArray nesting depthcounts - the number of elements to copy at each StructuredArray nesting depthpublic long getLength()+
public java.lang.Class<T> getElementClass()+
Class of elements stored in the array.Class of elements stored in the array.public StructuredArrayModel<? extends StructuredArray<T>,T> getArrayModel()+
public T get(long index) + throws java.lang.IllegalArgumentException+
long index.index - of the element to retrieve.java.lang.IllegalArgumentExceptionpublic T get(int index) + throws java.lang.IllegalArgumentException+
int index.index - of the element to retrieve.java.lang.IllegalArgumentExceptionpublic StructuredArray.ElementIterator iterator()+
iterator in interface java.lang.Iterable<T>public static <S extends StructuredArray<T>,T> void shallowCopy(S src, + long srcOffset, + S dst, + long dstOffset, + long count)+
+ shallowCopy will copy all fields from each of the source elements to the corresponding fields in each + of the corresponding destination elements. If the same array is both the src and dst then the copy will + happen as if a temporary intermediate array was used.
S - The class of the arraysT - The class of the array elementssrc - array to copysrcOffset - offset index in src where the region beginsdst - array into which the copy should occurdstOffset - offset index in the dst where the region beginscount - of structure elements to copyjava.lang.IllegalArgumentException - if the source and destination array element types are not identical, or if
+ the source or destination arrays have nested StructuredArrays within them, or if final fields are discovered
+ and all allowFinalFieldOverwrite is not true.public static <S extends StructuredArray<T>,T> void shallowCopy(S src, + long srcOffset, + S dst, + long dstOffset, + long count, + boolean allowFinalFieldOverwrite)+
+ shallowCopy will copy all fields from each of the source elements to the corresponding fields in each
+ of the corresponding destination elements. If the same array is both the src and dst then the copy will
+ happen as if a temporary intermediate array was used.
+
+ If allowFinalFieldOverwrite is specified as true, even final fields will be copied.
S - The class of the arraysT - The class of the array elementssrc - array to copysrcOffset - offset index in src where the region beginsdst - array into which the copy should occurdstOffset - offset index in the dst where the region beginscount - of structure elements to copy.allowFinalFieldOverwrite - allow final fields to be overwritten during a copy operation.java.lang.IllegalArgumentException - if the source and destination array element types are not identical, or if
+ the source or destination arrays have nested StructuredArrays within them, or if final fields are discovered
+ and all allowFinalFieldOverwrite is not true.S - The class of the StructuredArray that is to be instantiated by the builderT - The class of the elements in the StructuredArray that is to be instantiated the builderpublic class StructuredArrayBuilder<S extends StructuredArray<T>,T>
+extends java.lang.Object
+StructuredArray<T>
+
+ StructuredArrayBuilder follows the commonly used builder pattern, and is useful for
+ capturing the instantiation parameters of StructuredArrays.
+
+ StructuredArrayBuilders can be created for "flat" and "nested" StructuredArray
+ constructs, and can range from the simplest forms used when default constructors are employed, to forms that
+ supply customized per-element construction arguments that can take construction context (such as index,
+ containing array, and arbitrary data passed in a contextCookie) into account.
+
StructuredArrayBuilder to instantiate a StructuredArray is:
+ ++ StructuredArray<MyElementClass> array = + new StructuredArrayBuilder(StructuredArray.class, MyElementClass.class, length). + build(); +
+ An example of passing specific (but identical) construction arguments to element constructors is: +
+ Some examples of providing per-element construction parameters that depend on construction context include: ++ Constructor<MyElementClass> constructor = MyElementClass.class.getConstructor(int.Class, int.Class); + + StructuredArray<MyElementClass> array = + new StructuredArrayBuilder( + StructuredArray.class, + MyElementClass.class, + length). + elementCtorAndArgs(constructor, initArg1, initArg2). + build(); +
+ Constructor<MyElementClass> constructor = MyElementClass.class.getConstructor(long.Class, long.Class);
+
+ // Using a pre-constructed elementCtorAndArgsProvider:
+ StructuredArray<MyElementClass> array =
+ new StructuredArrayBuilder(
+ StructuredArray.class,
+ MyElementClass.class,
+ length).
+ elementCtorAndArgsProvider(myCtorAndArgsProvider).
+ build();
+
+ // Using a Lambda expression for elementCtorAndArgsProvider:
+ StructuredArray<MyElementClass> array2 =
+ new StructuredArrayBuilder(
+ StructuredArray.class,
+ MyElementClass.class,
+ length).
+ elementCtorAndArgsProvider(
+ context -> new CtorAndArgs<MyElementClass>(
+ constructor, context.getIndex(), context.getIndex() * 2)
+ ).
+ build();
+
+ // Using an anonymous class for elementCtorAndArgsProvider:
+ StructuredArray<MyElementClass> array3 =
+ new StructuredArrayBuilder(
+ StructuredArray.class,
+ MyElementClass.class,
+ length).
+ elementCtorAndArgsProvider(
+ new CtorAndArgsProvider() {
+ @Override
+ public CtorAndArgs getForContext(ConstructionContext context) throws NoSuchMethodException {
+ return new CtorAndArgs(constructor, context.getIndex(), context.getIndex() * 2);
+ }
+ }
+ ).
+ build();
+ | Constructor and Description | +
|---|
StructuredArrayBuilder(java.lang.Class<S> arrayClass,
+ java.lang.Class<T> elementClass,
+ long length)
+Constructs a new
+StructuredArrayBuilder object for creating arrays of type S with
+ elements of type T, and the given length. |
+
StructuredArrayBuilder(java.lang.Class<S> arrayClass,
+ PrimitiveArrayBuilder<A> subArrayBuilder,
+ long length)
+Constructs a new
+StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length. |
+
StructuredArrayBuilder(java.lang.Class<S> arrayClass,
+ StructuredArrayBuilder<A,E> subArrayBuilder,
+ long length)
+Constructs a new
+StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length. |
+
StructuredArrayBuilder(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<S> arrayClass,
+ java.lang.Class<T> elementClass,
+ long length)
+Constructs a new
+StructuredArrayBuilder object for creating arrays of type S with
+ elements of type T, and the given length. |
+
StructuredArrayBuilder(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<S> arrayClass,
+ PrimitiveArrayBuilder<A> subArrayBuilder,
+ long length)
+Constructs a new
+StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length. |
+
StructuredArrayBuilder(java.lang.invoke.MethodHandles.Lookup lookup,
+ java.lang.Class<S> arrayClass,
+ StructuredArrayBuilder<A,E> subArrayBuilder,
+ long length)
+Constructs a new
+StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length. |
+
StructuredArrayBuilder(java.lang.invoke.MethodHandles.Lookup lookup,
+ StructuredArrayModel<S,T> arrayModel)
+Constructs a new
+StructuredArrayBuilder object for creating arrays of the given array model. |
+
StructuredArrayBuilder(StructuredArrayModel<S,T> arrayModel)
+Constructs a new
+StructuredArrayBuilder object for creating arrays of the given array model. |
+
| Modifier and Type | +Method and Description | +
|---|---|
StructuredArrayBuilder<S,T> |
+arrayCtorAndArgs(java.lang.reflect.Constructor<S> constructor,
+ java.lang.Object... args)
+Set the
+Constructor and construction arguments to be used in constructing arrays. |
+
StructuredArrayBuilder<S,T> |
+arrayCtorAndArgs(CtorAndArgs<S> arrayCtorAndArgs)
+Set the
+CtorAndArgs to be used in constructing arrays. |
+
S |
+build()
+Build a
+StructuredArray according to the information captured in this builder |
+
StructuredArrayBuilder<S,T> |
+contextCookie(java.lang.Object contextCookie)
+Set the (opaque) contextCookie object associated with this builder.
+ |
+
StructuredArrayBuilder<S,T> |
+elementCtorAndArgs(java.lang.reflect.Constructor<T> constructor,
+ java.lang.Object... args)
+Set the
+Constructor and construction arguments to be used for all elements in the array. |
+
StructuredArrayBuilder<S,T> |
+elementCtorAndArgs(CtorAndArgs<T> ctorAndArgs)
+Set the
+CtorAndArgs to be used for all elements in the array. |
+
StructuredArrayBuilder<S,T> |
+elementCtorAndArgsProvider(CtorAndArgsProvider<T> ctorAndArgsProvider)
+Set the
+CtorAndArgsProvider used for determining the constructor and construction
+ arguments used for each element in the array. |
+
CtorAndArgs<S> |
+getArrayCtorAndArgs()
+Get the
+CtorAndArgs describing the constructor and arguments used to instantiate arrays with
+ this builder. |
+
StructuredArrayModel<S,T> |
+getArrayModel()
+Get the
+StructuredArrayModel that describes the arrays built by this builder |
+
java.lang.Object |
+getContextCookie()
+Get the (opaque) contextCookie object associated with this builder.
+ |
+
CtorAndArgsProvider<T> |
+getElementCtorAndArgsProvider()
+Get the
+CtorAndArgsProvider which provides the constructor and arguments used to construct
+ individual elements of arrays instantiated with this builder. |
+
PrimitiveArrayBuilder |
+getPrimitiveSubArrayBuilder()
+Get the
+StructuredArrayBuilder for the elements of the arrays built by
+ this builder. |
+
StructuredArrayBuilder |
+getStructuredSubArrayBuilder()
+Get the
+StructuredArrayBuilder for the elements of the arrays built by
+ this builder. |
+
StructuredArrayBuilder<S,T> |
+resolve()
+Resolve any not-yet-resolved constructor information needed by this builder.
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic StructuredArrayBuilder(java.lang.Class<S> arrayClass, + java.lang.Class<T> elementClass, + long length)+
StructuredArrayBuilder object for creating arrays of type S with
+ elements of type T, and the given length.
+
+ Note: This constructor form cannot be used with an element type T that extends StructuredArray. Use the
+ constructor form StructuredArrayBuilder(Class, StructuredArrayBuilder, long)
+ to create builders that instantiate nested StructuredArrays.arrayClass - The class of the array to be built by this builderelementClass - The class of elements in the array to be built by this builderlength - The length of the array to be build by this builderpublic StructuredArrayBuilder(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<S> arrayClass, + java.lang.Class<T> elementClass, + long length)+
StructuredArrayBuilder object for creating arrays of type S with
+ elements of type T, and the given length.
+
+ Note: This constructor form cannot be used with an element type T that extends StructuredArray. Use the
+ constructor form StructuredArrayBuilder(Class, StructuredArrayBuilder, long)
+ to create builders that instantiate nested StructuredArrays.lookup - The lookup object to use for accessing constructors when resolving this builderarrayClass - The class of the array to be built by this builderelementClass - The class of elements in the array to be built by this builderlength - The length of the array to be build by this builderpublic StructuredArrayBuilder(StructuredArrayModel<S,T> arrayModel)+
StructuredArrayBuilder object for creating arrays of the given array model.arrayModel - The model of the array to be built by this builderpublic StructuredArrayBuilder(java.lang.invoke.MethodHandles.Lookup lookup, + StructuredArrayModel<S,T> arrayModel)+
StructuredArrayBuilder object for creating arrays of the given array model.lookup - The lookup object to use for accessing constructors when resolving this builderarrayModel - The model of the array to be built by this builderpublic StructuredArrayBuilder(java.lang.Class<S> arrayClass, + StructuredArrayBuilder<A,E> subArrayBuilder, + long length)+
StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length. Used when T extends StructuredArray, such that the
+ arrays instantiated by this builder would include nested StructuredArrays.A - The class or the subArray (should match T for the StructuredArrayBuilder)E - The element class in the subArray.arrayClass - The class of the array to be built by this buildersubArrayBuilder - The builder used for creating individual array elements (which are themselves
+ StructuredArrays)length - The length of the array to be build by this builderpublic StructuredArrayBuilder(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<S> arrayClass, + StructuredArrayBuilder<A,E> subArrayBuilder, + long length)+
StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length. Used when T extends StructuredArray, such that the
+ arrays instantiated by this builder would include nested StructuredArrays.A - The class or the subArray (should match T for the StructuredArrayBuilder)E - The element class in the subArray.lookup - The lookup object to use for accessing constructors when resolving this builderarrayClass - The class of the array to be built by this buildersubArrayBuilder - The builder used for creating individual array elements (which are themselves
+ StructuredArrays)length - The length of the array to be build by this builderpublic StructuredArrayBuilder(java.lang.Class<S> arrayClass, + PrimitiveArrayBuilder<A> subArrayBuilder, + long length)+
StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length. Used when T extends PrimitiveArray, such that the
+ arrays instantiated by this builder would include elements that are PrimitiveArrays.A - The class in the subArray (should match T for the StructuredArrayBuilder)arrayClass - The class of the array to be built by this buildersubArrayBuilder - The builder used for creating individual array elements (which are themselves
+ subclassable PrimitiveArrays)length - The length of the array to be build by this builderpublic StructuredArrayBuilder(java.lang.invoke.MethodHandles.Lookup lookup, + java.lang.Class<S> arrayClass, + PrimitiveArrayBuilder<A> subArrayBuilder, + long length)+
StructuredArrayBuilder object for creating an array of type S with
+ elements of type T, and the given length. Used when T extends PrimitiveArray, such that the
+ arrays instantiated by this builder would include elements that are PrimitiveArrays.A - The class in the subArray (should match T for the StructuredArrayBuilder)lookup - The lookup object to use for accessing constructors when resolving this builderarrayClass - The class of the array to be built by this buildersubArrayBuilder - The builder used for creating individual array elements (which are themselves
+ subclassable PrimitiveArrays)length - The length of the array to be build by this builderpublic StructuredArrayBuilder<S,T> elementCtorAndArgsProvider(CtorAndArgsProvider<T> ctorAndArgsProvider)+
CtorAndArgsProvider used for determining the constructor and construction
+ arguments used for each element in the array. The provider may use the specific element's
+ construction context in determining the construction parameters.
+
+ Note: This method overlaps in purpose with the alternate methods for controlling element
+ construction. Namely elementCtorAndArgs(CtorAndArgs) and
+ elementCtorAndArgs(Constructor, Object...).ctorAndArgsProvider - The provider used for determining the constructor and construction
+ arguments used for each element in instantiated arrayspublic StructuredArrayBuilder<S,T> elementCtorAndArgs(CtorAndArgs<T> ctorAndArgs)+
CtorAndArgs to be used for all elements in the array. All elements will be constructed with
+ the same constructor and the same arguments.
+
+ Note: This method overlaps in purpose with the alternate methods for controlling element
+ construction. Namely elementCtorAndArgsProvider(CtorAndArgsProvider) and
+ elementCtorAndArgs(Constructor, Object...).ctorAndArgs - The constructor and arguments used for all elements in arrayspublic StructuredArrayBuilder<S,T> elementCtorAndArgs(java.lang.reflect.Constructor<T> constructor, + java.lang.Object... args)+
Constructor and construction arguments to be used for all elements in the array.
+ All elements will be constructed with the same constructor and the same arguments.
+
+ Note: This method overlaps in purpose with the alternate methods for controlling element
+ construction. Namely elementCtorAndArgsProvider(CtorAndArgsProvider) and
+ elementCtorAndArgs(CtorAndArgs).constructor - The constructor used for all elements in arraysargs - The construction arguments supplied for the constructor, used for all elements in the arraypublic StructuredArrayBuilder<S,T> arrayCtorAndArgs(CtorAndArgs<S> arrayCtorAndArgs)+
CtorAndArgs to be used in constructing arrays.
+ Setting the means for array construction is Required if the array class (S) does not support a
+ default constructor, or if a non-default construction of the array instance is needed.arrayCtorAndArgs - The constructor and arguments used for constructing arrayspublic StructuredArrayBuilder<S,T> arrayCtorAndArgs(java.lang.reflect.Constructor<S> constructor, + java.lang.Object... args)+
Constructor and construction arguments to be used in constructing arrays.
+ Setting the means for array construction is Required if the array class (S) does not support a
+ default constructor, or if a non-default construction of the array instance is needed.constructor - The constructor used for constructing arraysargs - The construction arguments supplied for the constructorpublic StructuredArrayBuilder<S,T> contextCookie(java.lang.Object contextCookie)+
ConstructionContext object passed to the element
+ CtorAndArgsProvider provider for each element in instantiated arrays.contextCookie - the contextCookie objectpublic StructuredArrayBuilder<S,T> resolve()+
java.lang.IllegalArgumentException - if the array constructor or element constructor fail to resolve given
+ the current information in the builderpublic S build() + throws java.lang.IllegalArgumentException+
StructuredArray according to the information captured in this builderStructuredArrayjava.lang.IllegalArgumentException - if the array constructor or element constructor fail to resolve given
+ the current information in the builderpublic StructuredArrayModel<S,T> getArrayModel()+
StructuredArrayModel that describes the arrays built by this builderStructuredArrayModel that describes the arrays built by this builderpublic StructuredArrayBuilder getStructuredSubArrayBuilder()+
StructuredArrayBuilder for the elements of the arrays built by
+ this builder. NullStructuredArrayBuilder for the elements of the arrays built by
+ this builder. Null if the array element type T does not extend StructuredArray.public PrimitiveArrayBuilder getPrimitiveSubArrayBuilder()+
StructuredArrayBuilder for the elements of the arrays built by
+ this builder. NullStructuredArrayBuilder for the elements of the arrays built by
+ this builder. Null if the array element type T does not extend StructuredArray.public CtorAndArgs<S> getArrayCtorAndArgs()+
CtorAndArgs describing the constructor and arguments used to instantiate arrays with
+ this builder. May be null if non of arrayCtorAndArgs,
+ resolve() or
+ build() have been called yet.CtorAndArgs describing the constructor and arguments used to instantiate arrays with
+ this builder.public CtorAndArgsProvider<T> getElementCtorAndArgsProvider()+
CtorAndArgsProvider which provides the constructor and arguments used to construct
+ individual elements of arrays instantiated with this builder. May be null if non of
+ elementCtorAndArgsProvider,
+ elementCtorAndArgs(org.ObjectLayout.CtorAndArgs<T>),
+ resolve(boolean) or
+ build() have been called yet.CtorAndArgsProvider which provides the constructor and arguments used to construct
+ individual elements of arrays instantiated with this builderpublic java.lang.Object getContextCookie()+
ConstructionContext object passed to the element
+ CtorAndArgsProvider provider for each element in instantiated arrays.S - The class of the StructuredArray modeled by the modelT - The class of the elements in the StructuredArray modeled by the modelpublic class StructuredArrayModel<S extends StructuredArray<T>,T>
+extends java.lang.Object
+| Constructor and Description | +
|---|
StructuredArrayModel(java.lang.Class<S> arrayClass,
+ java.lang.Class<T> elementClass,
+ long length)
+Create a model of a StructuredArray instance with terminal (non StructuredArray) elements
+ |
+
StructuredArrayModel(java.lang.Class<S> arrayClass,
+ PrimitiveArrayModel<A2> subArrayModel,
+ long length)
+Create a model of a StructuredArray instance with elements that are themselves subclassable PrimitiveArrays
+ |
+
StructuredArrayModel(java.lang.Class<S> arrayClass,
+ StructuredArrayModel<A2,T2> subArrayModel,
+ long length)
+Create a model of a StructuredArray instance with elements that are themselves StructuredArrays
+ |
+
StructuredArrayModel(long length)
+Create a model of a StructuredArray instance with terminal (non StructuredArray) elements,
+ deriving the array class and element class from the generic class parameters
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
boolean |
+equals(java.lang.Object other)
+Determine if this model is equal to another object.
+ |
+
java.lang.Class<S> |
+getArrayClass()
+Get the class of the StructuredArray modeled by this model
+ |
+
java.lang.Class<T> |
+getElementClass()
+Get the class of the elements in the StructuredArray modeled by the model
+ |
+
long |
+getLength()
+Get the length of the StructuredArray modeled by the model
+ |
+
org.ObjectLayout.AbstractPrimitiveArrayModel |
+getPrimitiveSubArrayModel()
+Get the model describing the structure of the elements of the array being modeled
+ |
+
org.ObjectLayout.AbstractStructuredArrayModel |
+getStructuredSubArrayModel()
+Get the model describing the structure of the elements of the array being modeled
+ |
+
getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic StructuredArrayModel(long length)+
length - The length of the StructuredArray modeled by the modelpublic StructuredArrayModel(java.lang.Class<S> arrayClass, + java.lang.Class<T> elementClass, + long length)+
arrayClass - The class of the StructuredArray modeled by the modelelementClass - The class of the elements in the StructuredArray modeled by the modellength - The length of the StructuredArray modeled by the modelpublic StructuredArrayModel(java.lang.Class<S> arrayClass, + StructuredArrayModel<A2,T2> subArrayModel, + long length)+
A2 - The class of the StructuredArray modeled by the subArrayModelT2 - The class of the elements in the StructuredArray modeled by the subArrayModelarrayClass - The class of the StructuredArray modeled by the modelsubArrayModel - The model describing the structure of the elements of the array being modeledlength - The length of the StructuredArray modeled by the modelpublic StructuredArrayModel(java.lang.Class<S> arrayClass, + PrimitiveArrayModel<A2> subArrayModel, + long length)+
A2 - The class of the PrimitiveArray modeled by the subArrayModelarrayClass - The class of the StructuredArray modeled by the modelsubArrayModel - The model describing the structure of the elements of the array being modeledlength - The length of the StructuredArray modeled by the modelpublic boolean equals(java.lang.Object other)+
equals in class java.lang.Objectother - the other objectpublic final java.lang.Class<S> getArrayClass()+
public final java.lang.Class<T> getElementClass()+
public final org.ObjectLayout.AbstractStructuredArrayModel getStructuredSubArrayModel()+
public final org.ObjectLayout.AbstractPrimitiveArrayModel getPrimitiveSubArrayModel()+
public final long getLength()+
| Constructor and Description | +
|---|
BPlusTreeIterator(org.ObjectLayout.examples.BPlusTree.Leaf leaf) |
+
| Modifier and Type | +Method and Description | +
|---|---|
boolean |
+hasNext() |
+
java.util.Map.Entry<K,V> |
+next() |
+
void |
+remove() |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic class BPlusTree<K,V>
+extends java.lang.Object
+implements java.lang.Iterable<java.util.Map.Entry<K,V>>
+| Modifier and Type | +Class and Description | +
|---|---|
class |
+BPlusTree.BPlusTreeIterator |
+
| Constructor and Description | +
|---|
BPlusTree(int nodeSize) |
+
BPlusTree(int nodeSize,
+ java.util.Comparator<K> comparator) |
+
| Modifier and Type | +Method and Description | +
|---|---|
V |
+get(java.lang.Object key) |
+
java.util.Iterator<java.util.Map.Entry<K,V>> |
+iterator() |
+
V |
+put(K key,
+ V val) |
+
V |
+remove(java.lang.Object key) |
+
static <T> void |
+shallowCopy(ReferenceArray<T> src,
+ long srcOffset,
+ ReferenceArray<T> dst,
+ long dstOffset,
+ long count) |
+
int |
+size() |
+
java.lang.String |
+toString() |
+
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic BPlusTree(int nodeSize)+
public BPlusTree(int nodeSize, + java.util.Comparator<K> comparator)+
public V get(java.lang.Object key)+
public V remove(java.lang.Object key)+
public int size()+
public java.lang.String toString()+
toString in class java.lang.Objectpublic static <T> void shallowCopy(ReferenceArray<T> src, + long srcOffset, + ReferenceArray<T> dst, + long dstOffset, + long count)+
public class Line
+extends java.lang.Object
+IntrinsicObjectModel
+ members and their initialization, either at field initialization or during construction.
+
+ + Note that the following rules apply to intrinsic object members: +
IntrinsicObjects.constructWithin(java.lang.invoke.MethodHandles.Lookup, java.lang.String, java.lang.Object) variants| Constructor and Description | +
|---|
Line() |
+
Line(Line source) |
+
Line(long x1,
+ long y1,
+ long x2,
+ long y2) |
+
| Modifier and Type | +Method and Description | +
|---|---|
Point |
+getEndPoint1() |
+
Point |
+getEndPoint2() |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final class MassOrder.Builder +extends java.lang.Object +implements CtorAndArgsProvider<SimpleOrder>+
| Modifier and Type | +Method and Description | +
|---|---|
MassOrder.Builder |
+accountId(long accountId) |
+
MassOrder.Builder |
+addAsk(long price,
+ long quantity) |
+
MassOrder.Builder |
+addBid(long price,
+ long quantity) |
+
CtorAndArgs<SimpleOrder> |
+getForContext(ConstructionContext<SimpleOrder> context)
+Get a
+CtorAndArgs instance to be used in constructing a given element index in
+ a StructuredArray |
+
MassOrder.Builder |
+instructionId(java.lang.String instructionId) |
+
MassOrder.Builder |
+instrumentId(long instrumentId) |
+
MassOrder |
+newInstance() |
+
MassOrder.Builder |
+orderType(SimpleOrder.OrderType orderType) |
+
MassOrder.Builder |
+reset() |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic Builder() + throws java.lang.NoSuchMethodException+
java.lang.NoSuchMethodExceptionpublic MassOrder.Builder reset()+
public MassOrder.Builder accountId(long accountId)+
public MassOrder.Builder instrumentId(long instrumentId)+
public MassOrder.Builder instructionId(java.lang.String instructionId)+
public MassOrder.Builder orderType(SimpleOrder.OrderType orderType)+
public MassOrder.Builder addBid(long price, + long quantity)+
public MassOrder.Builder addAsk(long price, + long quantity)+
public CtorAndArgs<SimpleOrder> getForContext(ConstructionContext<SimpleOrder> context) + throws java.lang.NoSuchMethodException+
CtorAndArgsProviderCtorAndArgs instance to be used in constructing a given element index in
+ a StructuredArraygetForContext in interface CtorAndArgsProvider<SimpleOrder>context - The construction context (index, containing array, etc.) of the element to be constructedCtorAndArgs instance to used in element constructionjava.lang.NoSuchMethodException - if expected constructor is not found in element classpublic MassOrder newInstance()+
public class MassOrder +extends StructuredArray<SimpleOrder>+
| Modifier and Type | +Class and Description | +
|---|---|
static class |
+MassOrder.Builder |
+
StructuredArray.ElementIterator| Modifier and Type | +Method and Description | +
|---|---|
static MassOrder.Builder |
+builder() |
+
long |
+getAccountId() |
+
int |
+getAskOrderCount() |
+
int |
+getAskOrderIndex() |
+
java.lang.Iterable<SimpleOrder> |
+getAsks() |
+
int |
+getBidOrderCount() |
+
int |
+getBidOrderIndex() |
+
java.lang.Iterable<SimpleOrder> |
+getBids() |
+
java.lang.String |
+getInstructionId() |
+
long |
+getInstrumentId() |
+
SimpleOrder.OrderType |
+getOrderType() |
+
java.lang.String |
+toString() |
+
copyInstance, copyInstance, copyInstance, copyInstance, copyInstance, copyInstance, get, get, getArrayModel, getElementClass, getLength, iterator, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, shallowCopy, shallowCopyequals, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic long getAccountId()+
public java.lang.String getInstructionId()+
public SimpleOrder.OrderType getOrderType()+
public long getInstrumentId()+
public int getBidOrderIndex()+
public int getBidOrderCount()+
public java.lang.Iterable<SimpleOrder> getBids()+
public int getAskOrderCount()+
public int getAskOrderIndex()+
public java.lang.Iterable<SimpleOrder> getAsks()+
public java.lang.String toString()+
toString in class java.lang.Objectpublic static MassOrder.Builder builder()+
public class MassOrderExample
+extends java.lang.Object
+| Constructor and Description | +
|---|
MassOrderExample() |
+
| Modifier and Type | +Method and Description | +
|---|---|
static void |
+main(java.lang.String[] args) |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic class Octagon
+extends java.lang.Object
+IntrinsicObjectModel members and their initialization, when the
+ intrinsic member is a StructuredArray.| Constructor and Description | +
|---|
Octagon() |
+
Octagon(Octagon source) |
+
Octagon(java.lang.String color) |
+
Octagon(java.lang.String color,
+ long centerX,
+ long centerY,
+ long radius)
+Build an perfect octagon with center at (centerX, centerY), and first point
+ at (centerX + radius, centerY)
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
java.lang.String |
+getColor() |
+
PointArray |
+getPoints() |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic Octagon()+
public Octagon(java.lang.String color)+
public Octagon(Octagon source)+
public Octagon(java.lang.String color, + long centerX, + long centerY, + long radius)+
color - centerX - centerY - radius - public PointArray getPoints()+
public java.lang.String getColor()+
public class Octagons +extends StructuredArray<Octagon>+
StructuredArray.ElementIterator| Modifier and Type | +Field and Description | +
|---|---|
java.util.Date |
+creationDate |
+
| Constructor and Description | +
|---|
Octagons() |
+
Octagons(Octagons source) |
+
| Modifier and Type | +Method and Description | +
|---|---|
static Octagons |
+newInstance(long length) |
+
static Octagons |
+newInstance(long length,
+ CtorAndArgsProvider<Octagon> ctorAndArgsProvider) |
+
static Octagons |
+newInstance(long length,
+ java.lang.String color,
+ long initialCenterX,
+ long initialCenterY,
+ long radius,
+ long deltaX,
+ long deltaY) |
+
copyInstance, copyInstance, copyInstance, copyInstance, copyInstance, copyInstance, get, get, getArrayModel, getElementClass, getLength, iterator, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, shallowCopy, shallowCopyequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic Octagons()+
public Octagons(Octagons source)+
public static Octagons newInstance(long length)+
public static Octagons newInstance(long length, + CtorAndArgsProvider<Octagon> ctorAndArgsProvider)+
public static Octagons newInstance(long length, + java.lang.String color, + long initialCenterX, + long initialCenterY, + long radius, + long deltaX, + long deltaY)+
public class Point
+extends java.lang.Object
+| Constructor and Description | +
|---|
Point() |
+
Point(long x,
+ long y) |
+
Point(Point source) |
+
| Modifier and Type | +Method and Description | +
|---|---|
long |
+getX() |
+
long |
+getY() |
+
void |
+set(long x,
+ long y) |
+
void |
+setX(long x) |
+
void |
+setY(long y) |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic class PointArray +extends StructuredArray<Point>+
StructuredArray.ElementIterator| Constructor and Description | +
|---|
PointArray() |
+
PointArray(PointArray source) |
+
| Modifier and Type | +Method and Description | +
|---|---|
static PointArray |
+newInstance(long length) |
+
static PointArray |
+newInstance(long length,
+ CtorAndArgsProvider<Point> ctorAndArgsProvider) |
+
static PointArray |
+newInstance(long length,
+ long x,
+ long y) |
+
copyInstance, copyInstance, copyInstance, copyInstance, copyInstance, copyInstance, get, get, getArrayModel, getElementClass, getLength, iterator, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, shallowCopy, shallowCopyequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic PointArray(PointArray source)+
public PointArray()+
public static PointArray newInstance(long length)+
public static PointArray newInstance(long length, + CtorAndArgsProvider<Point> ctorAndArgsProvider)+
public static PointArray newInstance(long length, + long x, + long y)+
public class SimpleLine
+extends java.lang.Object
+Intrinsic and IntrinsicObjects| Constructor and Description | +
|---|
SimpleLine() |
+
SimpleLine(long x1,
+ long y1,
+ long x2,
+ long y2) |
+
SimpleLine(SimpleLine source) |
+
| Modifier and Type | +Method and Description | +
|---|---|
Point |
+getEndPoint1() |
+
Point |
+getEndPoint2() |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic SimpleLine()+
public SimpleLine(long x1, + long y1, + long x2, + long y2)+
public SimpleLine(SimpleLine source)+
public static enum SimpleOrder.OrderType +extends java.lang.Enum<SimpleOrder.OrderType>+
| Enum Constant and Description | +
|---|
LIMIT |
+
MARKET |
+
| Modifier and Type | +Method and Description | +
|---|---|
static SimpleOrder.OrderType |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static SimpleOrder.OrderType[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOfgetClass, notify, notifyAll, wait, wait, waitpublic static final SimpleOrder.OrderType MARKET+
public static final SimpleOrder.OrderType LIMIT+
public static SimpleOrder.OrderType[] values()+
+for (SimpleOrder.OrderType c : SimpleOrder.OrderType.values()) + System.out.println(c); +
public static SimpleOrder.OrderType valueOf(java.lang.String name)+
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static enum SimpleOrder.Side +extends java.lang.Enum<SimpleOrder.Side>+
| Enum Constant and Description | +
|---|
ASK |
+
BID |
+
| Modifier and Type | +Method and Description | +
|---|---|
static SimpleOrder.Side |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static SimpleOrder.Side[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOfgetClass, notify, notifyAll, wait, wait, waitpublic static final SimpleOrder.Side BID+
public static final SimpleOrder.Side ASK+
public static SimpleOrder.Side[] values()+
+for (SimpleOrder.Side c : SimpleOrder.Side.values()) + System.out.println(c); +
public static SimpleOrder.Side valueOf(java.lang.String name)+
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic class SimpleOrder
+extends java.lang.Object
+| Modifier and Type | +Class and Description | +
|---|---|
static class |
+SimpleOrder.OrderType |
+
static class |
+SimpleOrder.Side |
+
| Constructor and Description | +
|---|
SimpleOrder(MassOrder.Builder builder,
+ SimpleOrder.Side side,
+ long price,
+ long quantity) |
+
| Modifier and Type | +Method and Description | +
|---|---|
long |
+getAccountId() |
+
long |
+getCancelledQuantity() |
+
long |
+getFilledQuantity() |
+
long |
+getInstrumentId() |
+
SimpleOrder.OrderType |
+getOrderType() |
+
long |
+getPrice() |
+
long |
+getQuantity() |
+
java.lang.String |
+toString() |
+
void |
+updateCancelled(long delta) |
+
void |
+updateFill(long matchedQuantity) |
+
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic SimpleOrder(MassOrder.Builder builder, + SimpleOrder.Side side, + long price, + long quantity)+
public long getCancelledQuantity()+
public void updateCancelled(long delta)+
public long getFilledQuantity()+
public void updateFill(long matchedQuantity)+
public long getInstrumentId()+
public long getAccountId()+
public SimpleOrder.OrderType getOrderType()+
public long getPrice()+
public long getQuantity()+
public java.lang.String toString()+
toString in class java.lang.Objectpublic class StructuredArrayOfAtomicLong +extends StructuredArray<java.util.concurrent.atomic.AtomicLong>+
StructuredArray.ElementIterator| Constructor and Description | +
|---|
StructuredArrayOfAtomicLong() |
+
| Modifier and Type | +Method and Description | +
|---|---|
java.util.concurrent.atomic.AtomicLong |
+get(long index)
+Get a reference to an element in a single dimensional array, using a
+long index. |
+
static StructuredArrayOfAtomicLong |
+newInstance(long length) |
+
copyInstance, copyInstance, copyInstance, copyInstance, copyInstance, copyInstance, get, getArrayModel, getElementClass, getLength, iterator, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, shallowCopy, shallowCopyequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic StructuredArrayOfAtomicLong()+
public static StructuredArrayOfAtomicLong newInstance(long length)+
public java.util.concurrent.atomic.AtomicLong get(long index)+
StructuredArraylong index.get in class StructuredArray<java.util.concurrent.atomic.AtomicLong>index - of the element to retrieve.public class TwoDimPointMatrix +extends StructuredArray<PointArray>+
StructuredArray.ElementIterator| Constructor and Description | +
|---|
TwoDimPointMatrix() |
+
TwoDimPointMatrix(TwoDimPointMatrix source) |
+
| Modifier and Type | +Method and Description | +
|---|---|
static TwoDimPointMatrix |
+newInstance(long width,
+ long height) |
+
static TwoDimPointMatrix |
+newInstance(long width,
+ long height,
+ CtorAndArgsProvider<Point> ctorAndArgsProvider) |
+
static TwoDimPointMatrix |
+newInstance(long width,
+ long height,
+ long x,
+ long y) |
+
static TwoDimPointMatrix |
+newPreInitializedInstance(long width,
+ long height) |
+
copyInstance, copyInstance, copyInstance, copyInstance, copyInstance, copyInstance, get, get, getArrayModel, getElementClass, getLength, iterator, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, shallowCopy, shallowCopyequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic TwoDimPointMatrix()+
public TwoDimPointMatrix(TwoDimPointMatrix source)+
public static TwoDimPointMatrix newInstance(long width, + long height)+
public static TwoDimPointMatrix newInstance(long width, + long height, + CtorAndArgsProvider<Point> ctorAndArgsProvider)+
public static TwoDimPointMatrix newInstance(long width, + long height, + long x, + long y)+
public static TwoDimPointMatrix newPreInitializedInstance(long width, + long height)+
| Class | +Description | +
|---|---|
| BPlusTree<K,V> | ++ |
| Line | +
+ A simple org.ObjectLayout.examples.Line class example with two intrinsic org.ObjectLayout.examples.Point end point objects.
+ |
+
| MassOrder | ++ |
| MassOrder.Builder | ++ |
| MassOrderExample | ++ |
| Octagon | +
+ A simple org.ObjectLayout.examples.Octagon class example with an intrinsic StructuredArray of Points.
+ |
+
| Octagons | ++ |
| Point | +
+ A simple x,y point class to be used as an element in various other examples.
+ |
+
| PointArray | ++ |
| SimpleLine | +
+ A simple org.ObjectLayout.examples.Line class example with two intrinsic org.ObjectLayout.examples.Point end point objects.
+ |
+
| SimpleOrder | ++ |
| StructuredArrayOfAtomicLong | +
+ A simple, minimalistic example of a non-generic subclass of StructuredArray<AtomicLong>.
+ |
+
| TwoDimPointMatrix | +
+ A Matrix arranged as a height long array of columns (logically indexed as [x][y])
+ |
+
| Enum | +Description | +
|---|---|
| SimpleOrder.OrderType | ++ |
| SimpleOrder.Side | ++ |
public static class SAAbstractMap.SimpleEntry<K,V>
+extends java.lang.Object
+implements java.util.Map.Entry<K,V>, java.io.Serializable
+| Constructor and Description | +
|---|
SimpleEntry(K key,
+ V value)
+Creates an entry representing a mapping from the specified
+ key to the specified value.
+ |
+
SimpleEntry(java.util.Map.Entry<? extends K,? extends V> entry)
+Creates an entry representing the same mapping as the
+ specified entry.
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
boolean |
+equals(java.lang.Object o)
+Compares the specified object with this entry for equality.
+ |
+
K |
+getKey()
+Returns the key corresponding to this entry.
+ |
+
V |
+getValue()
+Returns the value corresponding to this entry.
+ |
+
int |
+hashCode()
+Returns the hash code value for this map entry.
+ |
+
V |
+setValue(V value)
+Replaces the value corresponding to this entry with the specified
+ value.
+ |
+
java.lang.String |
+toString()
+Returns a String representation of this map entry.
+ |
+
getClass, notify, notifyAll, wait, wait, waitcomparingByKey, comparingByKey, comparingByValue, comparingByValuepublic SimpleEntry(K key, + V value)+
key - the key represented by this entryvalue - the value represented by this entrypublic K getKey()+
public V getValue()+
public V setValue(V value)+
public boolean equals(java.lang.Object o)+
true if the given object is also a map entry and
+ the two entries represent the same mapping. More formally, two
+ entries e1 and e2 represent the same mapping
+ if+ (e1.getKey()==null ? + e2.getKey()==null : + e1.getKey().equals(e2.getKey())) + && + (e1.getValue()==null ? + e2.getValue()==null : + e1.getValue().equals(e2.getValue()))+ This ensures that the
equals method works properly across
+ different implementations of the Map.Entry interface.equals in interface java.util.Map.Entry<K,V>equals in class java.lang.Objecto - object to be compared for equality with this map entrytrue if the specified object is equal to this map
+ entryhashCode()public int hashCode()+
e is defined to be: + (e.getKey()==null ? 0 : e.getKey().hashCode()) ^ + (e.getValue()==null ? 0 : e.getValue().hashCode())+ This ensures that
e1.equals(e2) implies that
+ e1.hashCode()==e2.hashCode() for any two Entries
+ e1 and e2, as required by the general
+ contract of Object.hashCode().hashCode in interface java.util.Map.Entry<K,V>hashCode in class java.lang.Objectequals(java.lang.Object)public java.lang.String toString()+
toString in class java.lang.Objectpublic static class SAAbstractMap.SimpleImmutableEntry<K,V>
+extends java.lang.Object
+implements java.util.Map.Entry<K,V>, java.io.Serializable
+| Constructor and Description | +
|---|
SimpleImmutableEntry(K key,
+ V value)
+Creates an entry representing a mapping from the specified
+ key to the specified value.
+ |
+
SimpleImmutableEntry(java.util.Map.Entry<? extends K,? extends V> entry)
+Creates an entry representing the same mapping as the
+ specified entry.
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
boolean |
+equals(java.lang.Object o)
+Compares the specified object with this entry for equality.
+ |
+
K |
+getKey()
+Returns the key corresponding to this entry.
+ |
+
V |
+getValue()
+Returns the value corresponding to this entry.
+ |
+
int |
+hashCode()
+Returns the hash code value for this map entry.
+ |
+
V |
+setValue(V value)
+Replaces the value corresponding to this entry with the specified
+ value (optional operation).
+ |
+
java.lang.String |
+toString()
+Returns a String representation of this map entry.
+ |
+
getClass, notify, notifyAll, wait, wait, waitcomparingByKey, comparingByKey, comparingByValue, comparingByValuepublic SimpleImmutableEntry(K key, + V value)+
key - the key represented by this entryvalue - the value represented by this entrypublic K getKey()+
public V getValue()+
public V setValue(V value)+
public boolean equals(java.lang.Object o)+
true if the given object is also a map entry and
+ the two entries represent the same mapping. More formally, two
+ entries e1 and e2 represent the same mapping
+ if+ (e1.getKey()==null ? + e2.getKey()==null : + e1.getKey().equals(e2.getKey())) + && + (e1.getValue()==null ? + e2.getValue()==null : + e1.getValue().equals(e2.getValue()))+ This ensures that the
equals method works properly across
+ different implementations of the Map.Entry interface.equals in interface java.util.Map.Entry<K,V>equals in class java.lang.Objecto - object to be compared for equality with this map entrytrue if the specified object is equal to this map
+ entryhashCode()public int hashCode()+
e is defined to be: + (e.getKey()==null ? 0 : e.getKey().hashCode()) ^ + (e.getValue()==null ? 0 : e.getValue().hashCode())+ This ensures that
e1.equals(e2) implies that
+ e1.hashCode()==e2.hashCode() for any two Entries
+ e1 and e2, as required by the general
+ contract of Object.hashCode().hashCode in interface java.util.Map.Entry<K,V>hashCode in class java.lang.Objectequals(java.lang.Object)public java.lang.String toString()+
toString in class java.lang.ObjectK - the type of keys maintained by this mapV - the type of mapped valuespublic abstract class SAAbstractMap<K,V>
+extends java.lang.Object
+implements java.util.Map<K,V>
+To implement an unmodifiable map, the programmer needs only to extend this + class and provide an implementation for the entrySet method, which + returns a set-view of the map's mappings. Typically, the returned set + will, in turn, be implemented atop AbstractSet. This set should + not support the add or remove methods, and its iterator + should not support the remove method. + +
To implement a modifiable map, the programmer must additionally override + this class's put method (which otherwise throws an + UnsupportedOperationException), and the iterator returned by + entrySet().iterator() must additionally implement its + remove method. + +
The programmer should generally provide a void (no argument) and map + constructor, as per the recommendation in the Map interface + specification. + +
The documentation for each non-abstract method in this class describes its + implementation in detail. Each of these methods may be overridden if the + map being implemented admits a more efficient implementation. + +
This class is a member of the + + Java Collections Framework.
Map,
+Collection| Modifier and Type | +Class and Description | +
|---|---|
static class |
+SAAbstractMap.SimpleEntry<K,V>
+An Entry maintaining a key and a value.
+ |
+
static class |
+SAAbstractMap.SimpleImmutableEntry<K,V>
+An Entry maintaining an immutable key and value.
+ |
+
java.util.Map.Entry<K,V>| Modifier and Type | +Method and Description | +
|---|---|
void |
+clear() |
+
boolean |
+containsKey(java.lang.Object key) |
+
boolean |
+containsValue(java.lang.Object value) |
+
abstract java.util.Set<java.util.Map.Entry<K,V>> |
+entrySet() |
+
boolean |
+equals(java.lang.Object o)
+Compares the specified object with this map for equality.
+ |
+
V |
+get(java.lang.Object key) |
+
int |
+hashCode()
+Returns the hash code value for this map.
+ |
+
boolean |
+isEmpty() |
+
java.util.Set<K> |
+keySet() |
+
V |
+put(K key,
+ V value) |
+
void |
+putAll(java.util.Map<? extends K,? extends V> m) |
+
V |
+remove(java.lang.Object key) |
+
int |
+size() |
+
java.lang.String |
+toString()
+Returns a string representation of this map.
+ |
+
java.util.Collection<V> |
+values() |
+
getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic boolean isEmpty()+ +
public boolean containsValue(java.lang.Object value)+ +
public boolean containsKey(java.lang.Object key)+ +
public V get(java.lang.Object key)+ +
public V remove(java.lang.Object key)+ +
public void clear()+ +
public java.util.Set<K> keySet()+ +
public java.util.Collection<V> values()+ +
public boolean equals(java.lang.Object o)+
public int hashCode()+
Object.hashCode().public java.lang.String toString()+
String.valueOf(Object).toString in class java.lang.ObjectK - the type of keys maintained by this mapV - the type of mapped valuespublic class SAHashMap<K,V> +extends SAAbstractMap<K,V> +implements java.util.Map<K,V>, java.lang.Cloneable, java.io.Serializable+
This implementation provides constant-time performance for the basic + operations (get and put), assuming the hash function + disperses the elements properly among the buckets. Iteration over + collection views requires time proportional to the "capacity" of the + HashMap instance (the number of buckets) plus its size (the number + of key-value mappings). Thus, it's very important not to set the initial + capacity too high (or the load factor too low) if iteration performance is + important. + +
An instance of HashMap has two parameters that affect its + performance: initial capacity and load factor. The + capacity is the number of buckets in the hash table, and the initial + capacity is simply the capacity at the time the hash table is created. The + load factor is a measure of how full the hash table is allowed to + get before its capacity is automatically increased. When the number of + entries in the hash table exceeds the product of the load factor and the + current capacity, the hash table is rehashed (that is, internal data + structures are rebuilt) so that the hash table has approximately twice the + number of buckets. + +
As a general rule, the default load factor (.75) offers a good + tradeoff between time and space costs. Higher values decrease the + space overhead but increase the lookup cost (reflected in most of + the operations of the HashMap class, including + get and put). The expected number of entries in + the map and its load factor should be taken into account when + setting its initial capacity, so as to minimize the number of + rehash operations. If the initial capacity is greater than the + maximum number of entries divided by the load factor, no rehash + operations will ever occur. + +
If many mappings are to be stored in a HashMap
+ instance, creating it with a sufficiently large capacity will allow
+ the mappings to be stored more efficiently than letting it perform
+ automatic rehashing as needed to grow the table. Note that using
+ many keys with the same hashCode() is a sure way to slow
+ down performance of any hash table. To ameliorate impact, when keys
+ are Comparable, this class may use comparison order among
+ keys to help break ties.
+
+
Note that this implementation is not synchronized.
+ If multiple threads access a hash map concurrently, and at least one of
+ the threads modifies the map structurally, it must be
+ synchronized externally. (A structural modification is any operation
+ that adds or deletes one or more mappings; merely changing the value
+ associated with a key that an instance already contains is not a
+ structural modification.) This is typically accomplished by
+ synchronizing on some object that naturally encapsulates the map.
+
+ If no such object exists, the map should be "wrapped" using the
+ Collections.synchronizedMap
+ method. This is best done at creation time, to prevent accidental
+ unsynchronized access to the map:
+ Map m = Collections.synchronizedMap(new HashMap(...));+ +
The iterators returned by all of this class's "collection view methods"
+ are fail-fast: if the map is structurally modified at any time after
+ the iterator is created, in any way except through the iterator's own
+ remove method, the iterator will throw a
+ ConcurrentModificationException. Thus, in the face of concurrent
+ modification, the iterator fails quickly and cleanly, rather than risking
+ arbitrary, non-deterministic behavior at an undetermined time in the
+ future.
+
+
Note that the fail-fast behavior of an iterator cannot be guaranteed + as it is, generally speaking, impossible to make any hard guarantees in the + presence of unsynchronized concurrent modification. Fail-fast iterators + throw ConcurrentModificationException on a best-effort basis. + Therefore, it would be wrong to write a program that depended on this + exception for its correctness: the fail-fast behavior of iterators + should be used only to detect bugs. + +
This class is a member of the + + Java Collections Framework.
Object.hashCode(),
+Collection,
+Map,
+TreeMap,
+Hashtable,
+Serialized FormSAAbstractMap.SimpleEntry<K,V>, SAAbstractMap.SimpleImmutableEntry<K,V>java.util.Map.Entry<K,V>| Constructor and Description | +
|---|
SAHashMap()
+Constructs an empty HashMap with the default initial capacity
+ (16) and the default load factor (0.75).
+ |
+
SAHashMap(int initialCapacity)
+Constructs an empty HashMap with the specified initial
+ capacity and the default load factor (0.75).
+ |
+
SAHashMap(int initialCapacity,
+ float loadFactor)
+Constructs an empty HashMap with the specified initial
+ capacity and load factor.
+ |
+
SAHashMap(java.util.Map<? extends K,? extends V> m)
+Constructs a new HashMap with the same mappings as the
+ specified Map.
+ |
+
| Modifier and Type | +Method and Description | +
|---|---|
void |
+clear()
+Removes all of the mappings from this map.
+ |
+
java.lang.Object |
+clone()
+Returns a shallow copy of this HashMap instance: the keys and
+ values themselves are not cloned.
+ |
+
V |
+compute(K key,
+ java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction) |
+
V |
+computeIfAbsent(K key,
+ java.util.function.Function<? super K,? extends V> mappingFunction) |
+
V |
+computeIfPresent(K key,
+ java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction) |
+
boolean |
+containsKey(java.lang.Object key)
+Returns true if this map contains a mapping for the
+ specified key.
+ |
+
boolean |
+containsValue(java.lang.Object value)
+Returns true if this map maps one or more keys to the
+ specified value.
+ |
+
java.util.Set<java.util.Map.Entry<K,V>> |
+entrySet()
+Returns a
+Set view of the mappings contained in this map. |
+
void |
+forEach(java.util.function.BiConsumer<? super K,? super V> action) |
+
V |
+get(java.lang.Object key)
+Returns the value to which the specified key is mapped,
+ or
+null if this map contains no mapping for the key. |
+
V |
+getOrDefault(java.lang.Object key,
+ V defaultValue) |
+
boolean |
+isEmpty()
+Returns true if this map contains no key-value mappings.
+ |
+
java.util.Set<K> |
+keySet()
+Returns a
+Set view of the keys contained in this map. |
+
V |
+merge(K key,
+ V value,
+ java.util.function.BiFunction<? super V,? super V,? extends V> remappingFunction) |
+
V |
+put(K key,
+ V value)
+Associates the specified value with the specified key in this map.
+ |
+
void |
+putAll(java.util.Map<? extends K,? extends V> m)
+Copies all of the mappings from the specified map to this map.
+ |
+
V |
+putIfAbsent(K key,
+ V value) |
+
V |
+remove(java.lang.Object key)
+Removes the mapping for the specified key from this map if present.
+ |
+
boolean |
+remove(java.lang.Object key,
+ java.lang.Object value) |
+
V |
+replace(K key,
+ V value) |
+
boolean |
+replace(K key,
+ V oldValue,
+ V newValue) |
+
void |
+replaceAll(java.util.function.BiFunction<? super K,? super V,? extends V> function) |
+
int |
+size()
+Returns the number of key-value mappings in this map.
+ |
+
java.util.Collection<V> |
+values()
+Returns a
+Collection view of the values contained in this map. |
+
equals, hashCode, toStringgetClass, notify, notifyAll, wait, wait, waitequals, hashCodepublic SAHashMap(int initialCapacity, + float loadFactor)+
initialCapacity - the initial capacityloadFactor - the load factorjava.lang.IllegalArgumentException - if the initial capacity is negative
+ or the load factor is nonpositivepublic SAHashMap(int initialCapacity)+
initialCapacity - the initial capacity.java.lang.IllegalArgumentException - if the initial capacity is negative.public SAHashMap()+
public SAHashMap(java.util.Map<? extends K,? extends V> m)+
m - the map whose mappings are to be placed in this mapjava.lang.NullPointerException - if the specified map is nullpublic int size()+
public boolean isEmpty()+
public V get(java.lang.Object key)+
null if this map contains no mapping for the key.
+
+ More formally, if this map contains a mapping from a key
+ k to a value v such that (key==null ? k==null :
+ key.equals(k)), then this method returns v; otherwise
+ it returns null. (There can be at most one such mapping.)
+
+
A return value of null does not necessarily
+ indicate that the map contains no mapping for the key; it's also
+ possible that the map explicitly maps the key to null.
+ The containsKey operation may be used to
+ distinguish these two cases.
get in interface java.util.Map<K,V>get in class SAAbstractMap<K,V>put(Object, Object)public boolean containsKey(java.lang.Object key)+
containsKey in interface java.util.Map<K,V>containsKey in class SAAbstractMap<K,V>key - The key whose presence in this map is to be testedpublic V put(K key, + V value)+
put in interface java.util.Map<K,V>put in class SAAbstractMap<K,V>key - key with which the specified value is to be associatedvalue - value to be associated with the specified keypublic void putAll(java.util.Map<? extends K,? extends V> m)+
public V remove(java.lang.Object key)+
remove in interface java.util.Map<K,V>remove in class SAAbstractMap<K,V>key - key whose mapping is to be removed from the mappublic void clear()+
public boolean containsValue(java.lang.Object value)+
containsValue in interface java.util.Map<K,V>containsValue in class SAAbstractMap<K,V>value - value whose presence in this map is to be testedpublic java.util.Set<K> keySet()+
Set view of the keys contained in this map.
+ The set is backed by the map, so changes to the map are
+ reflected in the set, and vice-versa. If the map is modified
+ while an iteration over the set is in progress (except through
+ the iterator's own remove operation), the results of
+ the iteration are undefined. The set supports element removal,
+ which removes the corresponding mapping from the map, via the
+ Iterator.remove, Set.remove,
+ removeAll, retainAll, and clear
+ operations. It does not support the add or addAll
+ operations.public java.util.Collection<V> values()+
Collection view of the values contained in this map.
+ The collection is backed by the map, so changes to the map are
+ reflected in the collection, and vice-versa. If the map is
+ modified while an iteration over the collection is in progress
+ (except through the iterator's own remove operation),
+ the results of the iteration are undefined. The collection
+ supports element removal, which removes the corresponding
+ mapping from the map, via the Iterator.remove,
+ Collection.remove, removeAll,
+ retainAll and clear operations. It does not
+ support the add or addAll operations.public java.util.Set<java.util.Map.Entry<K,V>> entrySet()+
Set view of the mappings contained in this map.
+ The set is backed by the map, so changes to the map are
+ reflected in the set, and vice-versa. If the map is modified
+ while an iteration over the set is in progress (except through
+ the iterator's own remove operation, or through the
+ setValue operation on a map entry returned by the
+ iterator) the results of the iteration are undefined. The set
+ supports element removal, which removes the corresponding
+ mapping from the map, via the Iterator.remove,
+ Set.remove, removeAll, retainAll and
+ clear operations. It does not support the
+ add or addAll operations.public boolean remove(java.lang.Object key, + java.lang.Object value)+ +
public V computeIfAbsent(K key, + java.util.function.Function<? super K,? extends V> mappingFunction)+ +
public V computeIfPresent(K key, + java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)+ +
public V compute(K key, + java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)+ +
public V merge(K key, + V value, + java.util.function.BiFunction<? super V,? super V,? extends V> remappingFunction)+ +
public void replaceAll(java.util.function.BiFunction<? super K,? super V,? extends V> function)+ +
public java.lang.Object clone()+
| Class | +Description | +
|---|---|
| SAAbstractMap<K,V> | +
+ This class provides a skeletal implementation of the Map
+ interface, to minimize the effort required to implement this interface.
+ |
+
| SAAbstractMap.SimpleEntry<K,V> | +
+ An Entry maintaining a key and a value.
+ |
+
| SAAbstractMap.SimpleImmutableEntry<K,V> | +
+ An Entry maintaining an immutable key and value.
+ |
+
| SAHashMap<K,V> | +
+ Hash table based implementation of the Map interface.
+ |
+
See: Description
+| Interface | +Description | +
|---|---|
| CtorAndArgsProvider<T> | +
+ A functional interface for providing a constructor and arguments given a construction context (index, etc.).
+ |
+
| Class | +Description | +
|---|---|
| AbstractPrimitiveArray | +
+ A abstract base class for subclassable primitive and reference arrays.
+ |
+
| ConstructionContext<T> | +
+ The construction context for object instantiated within a StructuredArray
+ |
+
| CtorAndArgs<T> | +
+ Captures a specific constructor and arguments to be passed to it.
+ |
+
| Intrinsic.NO_DECLARED_CLASS | +
+ A no-op class used to indicate no value set for the
+Intrinsic.elementClass() element. |
+
| IntrinsicObjects | +
+ Intrinsic objects (declared with the
+@Intrisic annotation) 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. |
+
| IntrinsicProcessor | +
+ A javac annotation processor for the @Intrinsic annotation.
+ |
+
| PrimitiveArrayBuilder<S extends AbstractPrimitiveArray> | +
+ A builder used for instantiating a
+AbstractPrimitiveArray<T> |
+
| PrimitiveArrayModel<S extends AbstractPrimitiveArray> | +
+ A model that describes the structure of a PrimitiveArray
+ |
+
| PrimitiveByteArray | +
+ A subclassable array of bytes.
+ |
+
| PrimitiveCharArray | +
+ A subclassable array of chars.
+ |
+
| PrimitiveDoubleArray | +
+ A subclassable array of doubles.
+ |
+
| PrimitiveFloatArray | +
+ A subclassable array of floats.
+ |
+
| PrimitiveIntArray | +
+ A subclassable array of ints.
+ |
+
| PrimitiveLongArray | +
+ A subclassable array of longs.
+ |
+
| PrimitiveShortArray | +
+ A subclassable array of shorts.
+ |
+
| ReferenceArray<T> | +
+ A subclassable array of object references.
+ |
+
| StructuredArray<T> | +
+ An array of non-replaceable objects.
+ |
+
| StructuredArrayBuilder<S extends StructuredArray<T>,T> | +
+ A builder used for instantiating a
+StructuredArray<T> |
+
| StructuredArrayModel<S extends StructuredArray<T>,T> | +
+ A model that describes the structure of a StructuredArray
+ |
+
| Annotation Type | +Description | +
|---|---|
| Intrinsic | +
+ The
+@Intrisic annotation defines a declared object field to be
+ intrinsic to the class it is declared in. |
+
+ The ObjectLayout package provides some key data structure classes designed with optimised memory layout + in mind. These classes are aimed at matching the natural speed benefits similar data structure + constructs enable in most C-style languages, while maintaining an idiomatic Java feel and a natural + fit with existing code and libraries. +
+ The package classes provide full functionality on all JVMs (of Java SE 5 or above) at reasonable layouts + and execution speeds. However, the classes are carefully designed with semantics that would allow an + optimised JVM to implement them with improved memory layout not directly expressible in Java. +
+ The StructuredArray class is a good example of this design pattern.
+ StructuredArray is carefully designed to allow a JVM to store it in memory with a layout similar to
+ an array of structs in C-like languages. When a JVM optimises StructuredArray in such a way, array
+ access benefits from both direct (as opposed to de-referenced) dead-reckoning index access, as well
+ as from fixed memory strides during streaming operations.
+
+ The three commonly used C-style container layout forms that ObjectLayout seeks to enable in Java are: +
+ The speed benefits in these three forms of layout derive from two dominant benefits: +
+ StructuredArray provides an idiomatic Java collection form
+ with speed (and semantics) similar to an "array of structs" form, supporting any constructable
+ java Object as an array member.
+
+ @Intrinsic provides an idiomatic Java means for declaring
+ member objects that are intrinsic to the instances of the class they are declared in.
+ @Intrinsic provides a "struct in struct" equivalent
+ relationship between Java objects, exposing the speed and layout benefits similar to the same
+ form in the C family languages.
+
+ Sub-classable Primitive and Reference array classes (e.g. PrimitiveLongArray
+ and ReferenceArray) provide an idiomatic Java means of
+ declaring constructs with speed (and semantics) similar to "struct with array at the end". They do
+ so by supporting the subclassing of arrays of the various primitive and reference forms possible
+ in Java. StructuredArray similarly supports this capability (via
+ subclassing) for the equivalent of "struct with array of structs at the end".
+ + diff --git a/JavaDoc/overview-summary.html b/JavaDoc/overview-summary.html new file mode 100644 index 0000000..4749cc7 --- /dev/null +++ b/JavaDoc/overview-summary.html @@ -0,0 +1,147 @@ + + + + + +
| Package | +Description | +
|---|---|
| bench | ++ |
| org.ObjectLayout | +
+ ObjectLayout: An optimised memory layout package.
+ |
+
| org.ObjectLayout.examples | ++ |
| org.ObjectLayout.examples.util | ++ |
java.lang.Object key+
java.lang.Object value+
java.lang.Object key+
java.lang.Object value+
private void readObject(java.io.ObjectInputStream s) + throws java.io.IOException, + java.lang.ClassNotFoundException+
HashMap instance from a stream (i.e.,
+ deserialize it).java.io.IOExceptionjava.lang.ClassNotFoundExceptionprivate void writeObject(java.io.ObjectOutputStream s) + throws java.io.IOException+
java.io.IOExceptionint threshold+
float loadFactor+