Package org.capnproto
Class StructList.Builder<T extends StructBuilder>
- java.lang.Object
-
- org.capnproto.ListBuilder
-
- org.capnproto.StructList.Builder<T>
-
- All Implemented Interfaces:
Iterable<T>
- Enclosing class:
- StructList
public static final class StructList.Builder<T extends StructBuilder> extends ListBuilder implements Iterable<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classStructList.Builder.Iterator-
Nested classes/interfaces inherited from class org.capnproto.ListBuilder
ListBuilder.Factory<T>
-
-
Field Summary
Fields Modifier and Type Field Description StructBuilder.Factory<T>factory
-
Constructor Summary
Constructors Constructor Description Builder(StructBuilder.Factory<T> factory, SegmentBuilder segment, int ptr, int elementCount, int step, int structDataSize, short structPointerCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <U extends StructReader>
StructList.Reader<U>asReader(StructFactory<T,U> factory)Sets the list element, with the following limitation based on the fact that structs in a struct list are allocated inline: if the source struct is larger than the target struct (as can happen if it was created with a newer version of the schema), then it will be truncated, losing fields.Tget(int index)Iterator<T>iterator()<U extends StructReader>
voidsetWithCaveats(StructFactory<T,U> factory, int index, U value)-
Methods inherited from class org.capnproto.ListBuilder
_getBooleanElement, _getByteElement, _getDoubleElement, _getFloatElement, _getIntElement, _getLongElement, _getPointerElement, _getShortElement, _getStructElement, _initPointerElement, _setBooleanElement, _setByteElement, _setDoubleElement, _setFloatElement, _setIntElement, _setLongElement, _setPointerElement, _setShortElement, size
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
factory
public final StructBuilder.Factory<T extends StructBuilder> factory
-
-
Constructor Detail
-
Builder
public Builder(StructBuilder.Factory<T> factory, SegmentBuilder segment, int ptr, int elementCount, int step, int structDataSize, short structPointerCount)
-
-
Method Detail
-
get
public final T get(int index)
-
setWithCaveats
public final <U extends StructReader> void setWithCaveats(StructFactory<T,U> factory, int index, U value)
-
asReader
public final <U extends StructReader> StructList.Reader<U> asReader(StructFactory<T,U> factory)
Sets the list element, with the following limitation based on the fact that structs in a struct list are allocated inline: if the source struct is larger than the target struct (as can happen if it was created with a newer version of the schema), then it will be truncated, losing fields. TODO: rework generics, so that we don't need this factory parameter
-
-