| Modifier and Type | Class and Description |
|---|---|
| public static class | Snippets.
Generate bytecode to load an array of the given referene type onto the operand stack. |
| public abstract static class | Snippets.
Generate bytecodes for loading a collection of elements, support using pagination to avoid overloading the 64k code limit. |
| public static interface | |
| public static record | Snippets.
Describe an operand that can be load onto the operand stack. |
| public static record | Snippets.
Some basic information about pagination. |
| public static class | Snippets.
Generate bytecodes to load a set onto the operand stack. |
| public static interface | Snippets.
Snippet of bytecodes |
| Access | Constructor and Description |
|---|---|
| public |
| Snippets | back to summary |
|---|---|
| public Snippets() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final ClassDesc | |
| pack-priv Snippets. | |
| pack-priv final MethodTypeDesc |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Snippets. | build(Snippets.
Implements abstract jdk. Build the Loadable snippet to load the collection of elements onto the operand stack. |
| protected void | |
| private void | |
| private void | |
| private void | |
| private void |
| classDesc | back to summary |
|---|---|
| pack-priv final ClassDesc classDesc | |
| loadElementSnippets | back to summary |
|---|---|
| pack-priv Snippets. | |
| MTD_PageHelper | back to summary |
|---|---|
| pack-priv final MethodTypeDesc MTD_PageHelper | |
| ArraySnippetBuilder | back to summary |
|---|---|
| public ArraySnippetBuilder(ClassDesc elementType) | |
| build | back to summary |
|---|---|
| public Snippets. Implements abstract jdk. Doc from jdk. Build the Loadable snippet to load the collection of elements onto the operand stack. When pagination is enabled and needed as the total count of elements is larger than the given threshold, missing required field will lead to NullPointerException.
| |
| fill | back to summary |
|---|---|
| protected void fill(CodeBuilder cob, int fromIndex, int toIndex) | |
| genFillPageHelper | back to summary |
|---|---|
| private void genFillPageHelper(int pageNo, boolean hasNextPage) | |
| invokePageHelper | back to summary |
|---|---|
| private void invokePageHelper(CodeBuilder cob) | |
| newArray | back to summary |
|---|---|
| private void newArray(CodeBuilder cob) | |
| setupHelpers | back to summary |
|---|---|
| private void setupHelpers() Generate helper methods to fill each page | |
| Modifier and Type | Field and Description |
|---|---|
| protected int | |
| protected ClassBuilder | |
| public static final int | DEFAULT_PAGE_SIZE
Good enough for average ~30 bytes per element |
| protected static final int | DEFAULT_THRESHOLD
Default threshold based on 15K code size on ~30 bytes per element |
| protected ClassDesc | |
| public static final int | ENUM_PAGE_SIZE
Default page size of enum array |
| protected String | |
| protected ClassDesc | |
| protected int | |
| public static final int | STRING_PAGE_SIZE
Default page size of string array |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Snippets. | activatePagingThreshold(int
Use pagination methods if the count of elements is larger
than the given value activatePagingThreshold)Set the threshold of element count to enable pagination. |
| public abstract Snippets. | |
| public Snippets. | |
| public Snippets. | |
| public Snippets. | enablePagination(String
The method name prefix for generated paging helper methods methodNamePrefix, int The page size pageSize, int The element count to actiave the pagination threshold)Enable pagination if the count of elements is larger than the given threshold. |
| public Snippets. | enablePagination(String methodNamePrefix, int pageSize)
Enable pagination if the count of elements is larger than pageSize or DEFAULT_THRESHOLD |
| public Snippets. | enablePagination(String methodNamePrefix)
Enable pagination if the count of elements is larger than pageSize or DEFAULT_THRESHOLD with page size DEFAULT_PAGE_SIZE. |
| public Snippets. | methodNamePrefix(String
The method name prefix. Generated method will have the name of
this value appended with page number methodNamePrefix)Set the method name prefix for the pagination methods. |
| public Snippets. | ownerClassDesc(ClassDesc
The owner class for the pagination methods ownerClassDesc)Set the owner class host the pagination methods. |
| public Snippets. | |
| protected boolean |
| activatePagingThreshold | back to summary |
|---|---|
| protected int activatePagingThreshold | |
| clb | back to summary |
|---|---|
| protected ClassBuilder clb | |
| DEFAULT_PAGE_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_PAGE_SIZE Good enough for average ~30 bytes per element | |
| DEFAULT_THRESHOLD | back to summary |
|---|---|
| protected static final int DEFAULT_THRESHOLD Default threshold based on 15K code size on ~30 bytes per element | |
| elementType | back to summary |
|---|---|
| protected ClassDesc elementType | |
| ENUM_PAGE_SIZE | back to summary |
|---|---|
| public static final int ENUM_PAGE_SIZE Default page size of enum array | |
| methodNamePrefix | back to summary |
|---|---|
| protected String methodNamePrefix | |
| ownerClassDesc | back to summary |
|---|---|
| protected ClassDesc ownerClassDesc | |
| pageSize | back to summary |
|---|---|
| protected int pageSize | |
| STRING_PAGE_SIZE | back to summary |
|---|---|
| public static final int STRING_PAGE_SIZE Default page size of string array | |
| CollectionSnippetBuilder | back to summary |
|---|---|
protected CollectionSnippetBuilder(ClassDesc elementType)
| |
| activatePagingThreshold | back to summary |
|---|---|
| public Snippets. Set the threshold of element count to enable pagination.
| |
| build | back to summary |
|---|---|
| public abstract Snippets. Build the Loadable snippet to load the collection of elements onto the operand stack. When pagination is enabled and needed as the total count of elements is larger than the given threshold, missing required field will lead to NullPointerException. | |
| classBuilder | back to summary |
|---|---|
| public Snippets. Set the class builder used to generate the pagination methods. This value must be set if pagination is needed, otherwise the build would lead to NullPointerException. | |
| disablePagination | back to summary |
|---|---|
| public Snippets. Disable pagination. Generated bytecode will always try to construct the collection inline. | |
| enablePagination | back to summary |
|---|---|
| public Snippets. Enable pagination if the count of elements is larger than the given threshold.
| |
| enablePagination | back to summary |
|---|---|
| public Snippets. Enable pagination if the count of elements is larger than pageSize or DEFAULT_THRESHOLD | |
| enablePagination | back to summary |
|---|---|
| public Snippets. Enable pagination if the count of elements is larger than pageSize or DEFAULT_THRESHOLD with page size DEFAULT_PAGE_SIZE. | |
| methodNamePrefix | back to summary |
|---|---|
| public Snippets. Set the method name prefix for the pagination methods.
| |
| ownerClassDesc | back to summary |
|---|---|
| public Snippets. Set the owner class host the pagination methods.
| |
| pageSize | back to summary |
|---|---|
| public Snippets. Set the page size. The max page size is STRING_PAGE_SIZE.
| |
| shouldPaginate | back to summary |
|---|---|
| protected boolean shouldPaginate(int length) | |
| Modifier and Type | Method and Description |
|---|---|
| public Snippets. | Returns: A snippet of bytecodes to process the elementThe element element, int The index of the element in the containing collection index)Build a snippet for the element at the index. |
| public default Snippets. |
| build | back to summary |
|---|---|
| public Snippets. Build a snippet for the element at the index. | |
| buildAll | back to summary |
|---|---|
| public default Snippets. | |
| Modifier and Type | Field and Description |
|---|---|
| private final ClassDesc | classDesc
Record Component accessed by classDesc(). The type of the operand |
| private final Snippets. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ClassDesc | |
| public void | emit(CodeBuilder
The CodeBuilder to add the bytecode for loading cob)Implements jdk. Generate the bytecode to load the Loadable onto the operand stack. |
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public Snippets. | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| classDesc | back to summary |
|---|---|
| private final ClassDesc classDesc Record Component accessed by classDesc(). The type of the operand | |
| load | back to summary |
|---|---|
| private final Snippets. Record Component accessed by load(). The snippet to load the operand onto the operand stack | |
| Loadable | back to summary |
|---|---|
| public Loadable(ClassDesc classDesc, Snippets. | |
| classDesc | back to summary |
|---|---|
| public ClassDesc classDesc() Record Component getter of classDesc.
| |
| emit | back to summary |
|---|---|
| public void emit(CodeBuilder cob) Implements jdk. Generate the bytecode to load the Loadable onto the operand stack.
| |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| load | back to summary |
|---|---|
| public Snippets. Record Component getter of load.
| |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | pageSize
Record Component accessed by pageSize(). the number or elements to be included in a page |
| private final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public boolean | |
| public int | |
| public int | |
| public int | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| public int |
| pageSize | back to summary |
|---|---|
| private final int pageSize Record Component accessed by pageSize(). the number or elements to be included in a page | |
| total | back to summary |
|---|---|
| private final int total Record Component accessed by total(). The total count of elements | |
| PagingContext | back to summary |
|---|---|
| public PagingContext(int total, int pageSize) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| isLastPagePartial | back to summary |
|---|---|
| public boolean isLastPagePartial() If the last page has less elements than given page size. | |
| lastPageSize | back to summary |
|---|---|
| public int lastPageSize() The number of elements in the last page. | |
| pageCount | back to summary |
|---|---|
| public int pageCount() The number of pages. | |
| pageSize | back to summary |
|---|---|
| public int pageSize() Record Component getter of pageSize.
| |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |
| total | back to summary |
|---|---|
| public int total() Record Component getter of total.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Snippets. | build(Snippets.
Overrides jdk. Build the Loadable snippet to load the collection of elements onto the operand stack. |
| private void |
| SetSnippetBuilder | back to summary |
|---|---|
| public SetSnippetBuilder(ClassDesc elementType) | |
| build | back to summary |
|---|---|
| public Snippets. Overrides jdk. Doc from jdk. Build the Loadable snippet to load the collection of elements onto the operand stack. When pagination is enabled and needed as the total count of elements is larger than the given threshold, missing required field will lead to NullPointerException.
| |
| buildTinySet | back to summary |
|---|---|
| private void buildTinySet(CodeBuilder cob) | |
| Modifier and Type | Method and Description |
|---|---|
| public static <T> Snippets. | Returns: SnippetsThe elements to be processed elements, Function<T, Snippets.The snippet building function for a given element fnBuild snippets each to process the corresponding element. |
| public void | |
| public static <T extends ConstantDesc> Snippets. | |
| public static Snippets. | |
| public static Snippets. |
| buildAll | back to summary |
|---|---|
| public static <T> Snippets. Build snippets each to process the corresponding element. | |
| emit | back to summary |
|---|---|
| public void emit(CodeBuilder cob) Emit the bytecode snippet to the CodeBuilder.
| |
| loadConstant | back to summary |
|---|---|
| public static <T extends ConstantDesc> Snippets. Load a constant onto the operand stack. | |
| loadEnum | back to summary |
|---|---|
| public static Snippets. Load an enum constant onto the operand stack. | |
| loadInteger | back to summary |
|---|---|
| public static Snippets. Load an Integer, boxed int value onto the operand stack. | |