< prev index next >

src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SequenceLayout.java

Print this page

  8  *  particular file as subject to the "Classpath" exception as provided
  9  *  by Oracle in the LICENSE file that accompanied this code.
 10  *
 11  *  This code is distributed in the hope that it will be useful, but WITHOUT
 12  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  *  version 2 for more details (a copy is included in the LICENSE file that
 15  *  accompanied this code).
 16  *
 17  *  You should have received a copy of the GNU General Public License version
 18  *  2 along with this work; if not, write to the Free Software Foundation,
 19  *  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  *   Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  *  or visit www.oracle.com if you need additional information or have any
 23  *  questions.
 24  *
 25  */
 26 package jdk.incubator.foreign;
 27 
 28 import java.lang.constant.Constable;
 29 import java.lang.constant.ConstantDescs;
 30 import java.lang.constant.DynamicConstantDesc;
 31 import java.util.Map;
 32 import java.util.Objects;
 33 import java.util.Optional;
 34 import java.util.OptionalLong;
 35 
 36 /**
 37  * A sequence layout. A sequence layout is used to denote a repetition of a given layout, also called the sequence layout's <em>element layout</em>.
 38  * The repetition count, where it exists (e.g. for <em>finite</em> sequence layouts) is said to be the the sequence layout's <em>element count</em>.
 39  * A finite sequence layout can be thought of as a group layout where the sequence layout's element layout is repeated a number of times
 40  * that is equal to the sequence layout's element count. In other words this layout:
 41  *
 42  * <pre>{@code
 43 MemoryLayout.sequenceLayout(3, MemoryLayout.valueLayout(32, ByteOrder.BIG_ENDIAN));
 44  * }</pre>
 45  *
 46  * is equivalent to the following layout:
 47  *
 48  * <pre>{@code
 49 MemoryLayout.structLayout(
 50     MemoryLayout.valueLayout(32, ByteOrder.BIG_ENDIAN),
 51     MemoryLayout.valueLayout(32, ByteOrder.BIG_ENDIAN),
 52     MemoryLayout.valueLayout(32, ByteOrder.BIG_ENDIAN));
 53  * }</pre>
 54  *
 55  * <p>
 56  * This is a <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>
 57  * class; programmers should treat instances that are
 58  * {@linkplain #equals(Object) equal} as interchangeable and should not
 59  * use instances for synchronization, or unpredictable behavior may
 60  * occur. For example, in a future release, synchronization may fail.
 61  * The {@code equals} method should be used for comparisons.
 62  *
 63  * <p> Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null}
 64  * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown. </p>
 65  *
 66  * @implSpec
 67  * This class is immutable and thread-safe.
 68  */
 69 public final class SequenceLayout extends AbstractLayout implements MemoryLayout {
 70 
 71     private final OptionalLong elemCount;
 72     private final MemoryLayout elementLayout;
 73 
 74     SequenceLayout(OptionalLong elemCount, MemoryLayout elementLayout) {
 75         this(elemCount, elementLayout, elementLayout.bitAlignment(), Map.of());
 76     }
 77 
 78     SequenceLayout(OptionalLong elemCount, MemoryLayout elementLayout, long alignment, Map<String, Constable> attributes) {
 79         super(elemCount.isPresent() && AbstractLayout.optSize(elementLayout).isPresent() ?
 80                 OptionalLong.of(elemCount.getAsLong() * elementLayout.bitSize()) :
 81                 OptionalLong.empty(), alignment, attributes);
 82         this.elemCount = elemCount;
 83         this.elementLayout = elementLayout;
 84     }
 85 
 86     /**
 87      * Returns the element layout associated with this sequence layout.
 88      *
 89      * @return The element layout associated with this sequence layout.
 90      */
 91     public MemoryLayout elementLayout() {
 92         return elementLayout;
 93     }
 94 
 95     /**
 96      * Returns the element count of this sequence layout (if any).
 97      *
 98      * @return the element count of this sequence layout (if any).
 99      */
100     public OptionalLong elementCount() {
101         return elemCount;
102     }
103 
104     /**
105      * Obtains a new sequence layout with same element layout, alignment constraints and name as this sequence layout
106      * but with the new specified element count.
107      * @param elementCount the new element count.
108      * @return a new sequence with given element count.
109      * @throws IllegalArgumentException if {@code elementCount < 0}.
110      */
111     public SequenceLayout withElementCount(long elementCount) {
112         AbstractLayout.checkSize(elementCount, true);
113         return new SequenceLayout(OptionalLong.of(elementCount), elementLayout, alignment, attributes);
114     }
115 
116     /**
117      * Returns a new sequence layout where element layouts in the flattened projection of this
118      * sequence layout (see {@link #flatten()}) are re-arranged into one or more nested sequence layouts
119      * according to the provided element counts. This transformation preserves the layout size;
120      * that is, multiplying the provided element counts must yield the same element count
121      * as the flattened projection of this sequence layout.
122      * <p>
123      * For instance, given a sequence layout of the kind:
124      * <pre>{@code
125     var seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(3, MemoryLayouts.JAVA_INT));
126      * }</pre>
127      * calling {@code seq.reshape(2, 6)} will yield the following sequence layout:
128      * <pre>{@code
129     var reshapeSeq = MemoryLayout.sequenceLayout(2, MemoryLayout.sequenceLayout(6, MemoryLayouts.JAVA_INT));
130      * }</pre>
131      * <p>
132      * If one of the provided element count is the special value {@code -1}, then the element
133      * count in that position will be inferred from the remaining element counts and the
134      * element count of the flattened projection of this layout. For instance, a layout equivalent to
135      * the above {@code reshapeSeq} can also be computed in the following ways:
136      * <pre>{@code
137     var reshapeSeqImplicit1 = seq.reshape(-1, 6);
138     var reshapeSeqImplicit2 = seq.reshape(2, -1);
139      * }</pre>
140      * @param elementCounts an array of element counts, of which at most one can be {@code -1}.
141      * @return a new sequence layout where element layouts in the flattened projection of this
142      * sequence layout (see {@link #flatten()}) are re-arranged into one or more nested sequence layouts.
143      * @throws UnsupportedOperationException if this sequence layout does not have an element count.
144      * @throws IllegalArgumentException if two or more element counts are set to {@code -1}, or if one
145      * or more element count is {@code <= 0} (but other than {@code -1}) or, if, after any required inference,
146      * multiplying the element counts does not yield the same element count as the flattened projection of this
147      * sequence layout.
148      */
149     public SequenceLayout reshape(long... elementCounts) {
150         Objects.requireNonNull(elementCounts);
151         if (elementCounts.length == 0) {
152             throw new IllegalArgumentException();
153         }
154         if (!elementCount().isPresent()) {
155             throw new UnsupportedOperationException("Cannot reshape a sequence layout whose element count is unspecified");
156         }
157         SequenceLayout flat = flatten();
158         long expectedCount = flat.elementCount().getAsLong();
159 
160         long actualCount = 1;
161         int inferPosition = -1;
162         for (int i = 0 ; i < elementCounts.length ; i++) {
163             if (elementCounts[i] == -1) {
164                 if (inferPosition == -1) {
165                     inferPosition = i;
166                 } else {
167                     throw new IllegalArgumentException("Too many unspecified element counts");
168                 }
169             } else if (elementCounts[i] <= 0) {
170                 throw new IllegalArgumentException("Invalid element count: " + elementCounts[i]);
171             } else {
172                 actualCount = elementCounts[i] * actualCount;
173             }
174         }

181         }
182 
183         if (actualCount != expectedCount) {
184             throw new IllegalArgumentException("Element counts do not match expected size: " + expectedCount);
185         }
186 
187         MemoryLayout res = flat.elementLayout();
188         for (int i = elementCounts.length - 1 ; i >= 0 ; i--) {
189             res = MemoryLayout.sequenceLayout(elementCounts[i], res);
190         }
191         return (SequenceLayout)res;
192     }
193 
194     /**
195      * Returns a new, flattened sequence layout whose element layout is the first non-sequence
196      * element layout found by recursively traversing the element layouts of this sequence layout.
197      * This transformation preserves the layout size; nested sequence layout in this sequence layout will
198      * be dropped and their element counts will be incorporated into that of the returned sequence layout.
199      * For instance, given a sequence layout of the kind:
200      * <pre>{@code
201     var seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(3, MemoryLayouts.JAVA_INT));
202      * }</pre>
203      * calling {@code seq.flatten()} will yield the following sequence layout:
204      * <pre>{@code
205     var flattenedSeq = MemoryLayout.sequenceLayout(12, MemoryLayouts.JAVA_INT);
206      * }</pre>
207      * @return a new sequence layout with the same size as this layout (but, possibly, with different
208      * element count), whose element layout is not a sequence layout.
209      * @throws UnsupportedOperationException if this sequence layout, or one of the nested sequence layouts being
210      * flattened, does not have an element count.
211      */
212     public SequenceLayout flatten() {
213         if (!elementCount().isPresent()) {
214             throw badUnboundSequenceLayout();
215         }
216         long count = elementCount().getAsLong();
217         MemoryLayout elemLayout = elementLayout();
218         while (elemLayout instanceof SequenceLayout) {
219             SequenceLayout elemSeq = (SequenceLayout)elemLayout;
220             count = count * elemSeq.elementCount().orElseThrow(this::badUnboundSequenceLayout);
221             elemLayout = elemSeq.elementLayout();
222         }
223         return MemoryLayout.sequenceLayout(count, elemLayout);
224     }
225 
226     private UnsupportedOperationException badUnboundSequenceLayout() {
227         return new UnsupportedOperationException("Cannot flatten a sequence layout whose element count is unspecified");
228     }
229 
230     @Override
231     public String toString() {
232         return decorateLayoutString(String.format("[%s:%s]",
233                 elemCount.isPresent() ? elemCount.getAsLong() : "", elementLayout));
234     }
235 
236     @Override
237     public boolean equals(Object other) {
238         if (this == other) {
239             return true;
240         }
241         if (!super.equals(other)) {
242             return false;
243         }
244         if (!(other instanceof SequenceLayout)) {
245             return false;
246         }
247         SequenceLayout s = (SequenceLayout)other;
248         return elemCount.equals(s.elemCount) && elementLayout.equals(s.elementLayout);
249     }
250 
251     @Override
252     public int hashCode() {
253         return Objects.hash(super.hashCode(), elemCount, elementLayout);
254     }
255 
256     @Override
257     SequenceLayout dup(long alignment, Map<String, Constable> attributes) {
258         return new SequenceLayout(elementCount(), elementLayout, alignment, attributes);
259     }
260 
261     @Override
262     boolean hasNaturalAlignment() {
263         return alignment == elementLayout.bitAlignment();
264     }
265 
266     @Override
267     public Optional<DynamicConstantDesc<SequenceLayout>> describeConstable() {
268         return Optional.of(decorateLayoutConstant(elemCount.isPresent() ?
269                 DynamicConstantDesc.ofNamed(ConstantDescs.BSM_INVOKE, "value",
270                         CD_SEQUENCE_LAYOUT, MH_SIZED_SEQUENCE, elemCount.getAsLong(), elementLayout.describeConstable().get()) :
271                 DynamicConstantDesc.ofNamed(ConstantDescs.BSM_INVOKE, "value",
272                         CD_SEQUENCE_LAYOUT, MH_UNSIZED_SEQUENCE, elementLayout.describeConstable().get())));
273     }
274 
275     //hack: the declarations below are to make javadoc happy; we could have used generics in AbstractLayout
276     //but that causes issues with javadoc, see JDK-8224052
277 
278     /**
279      * {@inheritDoc}
280      */
281     @Override
282     public SequenceLayout withName(String name) {
283         return (SequenceLayout)super.withName(name);
284     }
285 
286     /**
287      * {@inheritDoc}
288      */
289     @Override
290     public SequenceLayout withBitAlignment(long alignmentBits) {
291         return (SequenceLayout)super.withBitAlignment(alignmentBits);
292     }
293 
294     /**
295      * {@inheritDoc}
296      */
297     @Override
298     public SequenceLayout withAttribute(String name, Constable value) {
299         return (SequenceLayout)super.withAttribute(name, value);
300     }
301 }

  8  *  particular file as subject to the "Classpath" exception as provided
  9  *  by Oracle in the LICENSE file that accompanied this code.
 10  *
 11  *  This code is distributed in the hope that it will be useful, but WITHOUT
 12  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  *  version 2 for more details (a copy is included in the LICENSE file that
 15  *  accompanied this code).
 16  *
 17  *  You should have received a copy of the GNU General Public License version
 18  *  2 along with this work; if not, write to the Free Software Foundation,
 19  *  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  *   Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  *  or visit www.oracle.com if you need additional information or have any
 23  *  questions.
 24  *
 25  */
 26 package jdk.incubator.foreign;
 27 

 28 import java.lang.constant.ConstantDescs;
 29 import java.lang.constant.DynamicConstantDesc;

 30 import java.util.Objects;
 31 import java.util.Optional;
 32 import java.util.OptionalLong;
 33 
 34 /**
 35  * A sequence layout. A sequence layout is used to denote a repetition of a given layout, also called the sequence layout's <em>element layout</em>.
 36  * The repetition count, where it exists (e.g. for <em>finite</em> sequence layouts) is said to be the sequence layout's <em>element count</em>.
 37  * A finite sequence layout can be thought of as a group layout where the sequence layout's element layout is repeated a number of times
 38  * that is equal to the sequence layout's element count. In other words this layout:
 39  *
 40  * <pre>{@code
 41 MemoryLayout.sequenceLayout(3, ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN));
 42  * }</pre>
 43  *
 44  * is equivalent to the following layout:
 45  *
 46  * <pre>{@code
 47 MemoryLayout.structLayout(
 48     ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN),
 49     ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN),
 50     ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN));
 51  * }</pre>
 52  *
 53  * <p>
 54  * This is a <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>
 55  * class; programmers should treat instances that are
 56  * {@linkplain #equals(Object) equal} as interchangeable and should not
 57  * use instances for synchronization, or unpredictable behavior may
 58  * occur. For example, in a future release, synchronization may fail.
 59  * The {@code equals} method should be used for comparisons.
 60  *
 61  * <p> Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null}
 62  * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown. </p>
 63  *
 64  * @implSpec
 65  * This class is immutable and thread-safe.
 66  */
 67 public final class SequenceLayout extends AbstractLayout implements MemoryLayout {
 68 
 69     private final OptionalLong elemCount;
 70     private final MemoryLayout elementLayout;
 71 
 72     SequenceLayout(OptionalLong elemCount, MemoryLayout elementLayout) {
 73         this(elemCount, elementLayout, elementLayout.bitAlignment(), Optional.empty());
 74     }
 75 
 76     SequenceLayout(OptionalLong elemCount, MemoryLayout elementLayout, long alignment, Optional<String> name) {
 77         super(elemCount.isPresent() && AbstractLayout.optSize(elementLayout).isPresent() ?
 78                 OptionalLong.of(elemCount.getAsLong() * elementLayout.bitSize()) :
 79                 OptionalLong.empty(), alignment, name);
 80         this.elemCount = elemCount;
 81         this.elementLayout = elementLayout;
 82     }
 83 
 84     /**
 85      * Returns the element layout associated with this sequence layout.
 86      *
 87      * @return The element layout associated with this sequence layout.
 88      */
 89     public MemoryLayout elementLayout() {
 90         return elementLayout;
 91     }
 92 
 93     /**
 94      * Returns the element count of this sequence layout (if any).
 95      *
 96      * @return the element count of this sequence layout (if any).
 97      */
 98     public OptionalLong elementCount() {
 99         return elemCount;
100     }
101 
102     /**
103      * Obtains a new sequence layout with same element layout, alignment constraints and name as this sequence layout
104      * but with the new specified element count.
105      * @param elementCount the new element count.
106      * @return a new sequence with given element count.
107      * @throws IllegalArgumentException if {@code elementCount < 0}.
108      */
109     public SequenceLayout withElementCount(long elementCount) {
110         AbstractLayout.checkSize(elementCount, true);
111         return new SequenceLayout(OptionalLong.of(elementCount), elementLayout, alignment, name());
112     }
113 
114     /**
115      * Returns a new sequence layout where element layouts in the flattened projection of this
116      * sequence layout (see {@link #flatten()}) are re-arranged into one or more nested sequence layouts
117      * according to the provided element counts. This transformation preserves the layout size;
118      * that is, multiplying the provided element counts must yield the same element count
119      * as the flattened projection of this sequence layout.
120      * <p>
121      * For instance, given a sequence layout of the kind:
122      * <pre>{@code
123     var seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(3, ValueLayout.JAVA_INT));
124      * }</pre>
125      * calling {@code seq.reshape(2, 6)} will yield the following sequence layout:
126      * <pre>{@code
127     var reshapeSeq = MemoryLayout.sequenceLayout(2, MemoryLayout.sequenceLayout(6, ValueLayout.JAVA_INT));
128      * }</pre>
129      * <p>
130      * If one of the provided element count is the special value {@code -1}, then the element
131      * count in that position will be inferred from the remaining element counts and the
132      * element count of the flattened projection of this layout. For instance, a layout equivalent to
133      * the above {@code reshapeSeq} can also be computed in the following ways:
134      * <pre>{@code
135     var reshapeSeqImplicit1 = seq.reshape(-1, 6);
136     var reshapeSeqImplicit2 = seq.reshape(2, -1);
137      * }</pre>
138      * @param elementCounts an array of element counts, of which at most one can be {@code -1}.
139      * @return a new sequence layout where element layouts in the flattened projection of this
140      * sequence layout (see {@link #flatten()}) are re-arranged into one or more nested sequence layouts.
141      * @throws UnsupportedOperationException if this sequence layout does not have an element count.
142      * @throws IllegalArgumentException if two or more element counts are set to {@code -1}, or if one
143      * or more element count is {@code <= 0} (but other than {@code -1}) or, if, after any required inference,
144      * multiplying the element counts does not yield the same element count as the flattened projection of this
145      * sequence layout.
146      */
147     public SequenceLayout reshape(long... elementCounts) {
148         Objects.requireNonNull(elementCounts);
149         if (elementCounts.length == 0) {
150             throw new IllegalArgumentException();
151         }
152         if (elementCount().isEmpty()) {
153             throw new UnsupportedOperationException("Cannot reshape a sequence layout whose element count is unspecified");
154         }
155         SequenceLayout flat = flatten();
156         long expectedCount = flat.elementCount().getAsLong();
157 
158         long actualCount = 1;
159         int inferPosition = -1;
160         for (int i = 0 ; i < elementCounts.length ; i++) {
161             if (elementCounts[i] == -1) {
162                 if (inferPosition == -1) {
163                     inferPosition = i;
164                 } else {
165                     throw new IllegalArgumentException("Too many unspecified element counts");
166                 }
167             } else if (elementCounts[i] <= 0) {
168                 throw new IllegalArgumentException("Invalid element count: " + elementCounts[i]);
169             } else {
170                 actualCount = elementCounts[i] * actualCount;
171             }
172         }

179         }
180 
181         if (actualCount != expectedCount) {
182             throw new IllegalArgumentException("Element counts do not match expected size: " + expectedCount);
183         }
184 
185         MemoryLayout res = flat.elementLayout();
186         for (int i = elementCounts.length - 1 ; i >= 0 ; i--) {
187             res = MemoryLayout.sequenceLayout(elementCounts[i], res);
188         }
189         return (SequenceLayout)res;
190     }
191 
192     /**
193      * Returns a new, flattened sequence layout whose element layout is the first non-sequence
194      * element layout found by recursively traversing the element layouts of this sequence layout.
195      * This transformation preserves the layout size; nested sequence layout in this sequence layout will
196      * be dropped and their element counts will be incorporated into that of the returned sequence layout.
197      * For instance, given a sequence layout of the kind:
198      * <pre>{@code
199     var seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(3, ValueLayout.JAVA_INT));
200      * }</pre>
201      * calling {@code seq.flatten()} will yield the following sequence layout:
202      * <pre>{@code
203     var flattenedSeq = MemoryLayout.sequenceLayout(12, ValueLayout.JAVA_INT);
204      * }</pre>
205      * @return a new sequence layout with the same size as this layout (but, possibly, with different
206      * element count), whose element layout is not a sequence layout.
207      * @throws UnsupportedOperationException if this sequence layout, or one of the nested sequence layouts being
208      * flattened, does not have an element count.
209      */
210     public SequenceLayout flatten() {
211         if (elementCount().isEmpty()) {
212             throw badUnboundSequenceLayout();
213         }
214         long count = elementCount().getAsLong();
215         MemoryLayout elemLayout = elementLayout();
216         while (elemLayout instanceof SequenceLayout elemSeq) {

217             count = count * elemSeq.elementCount().orElseThrow(this::badUnboundSequenceLayout);
218             elemLayout = elemSeq.elementLayout();
219         }
220         return MemoryLayout.sequenceLayout(count, elemLayout);
221     }
222 
223     private UnsupportedOperationException badUnboundSequenceLayout() {
224         return new UnsupportedOperationException("Cannot flatten a sequence layout whose element count is unspecified");
225     }
226 
227     @Override
228     public String toString() {
229         return decorateLayoutString(String.format("[%s:%s]",
230                 elemCount.isPresent() ? elemCount.getAsLong() : "", elementLayout));
231     }
232 
233     @Override
234     public boolean equals(Object other) {
235         if (this == other) {
236             return true;
237         }
238         if (!super.equals(other)) {
239             return false;
240         }
241         if (!(other instanceof SequenceLayout s)) {
242             return false;
243         }

244         return elemCount.equals(s.elemCount) && elementLayout.equals(s.elementLayout);
245     }
246 
247     @Override
248     public int hashCode() {
249         return Objects.hash(super.hashCode(), elemCount, elementLayout);
250     }
251 
252     @Override
253     SequenceLayout dup(long alignment, Optional<String> name) {
254         return new SequenceLayout(elementCount(), elementLayout, alignment, name);
255     }
256 
257     @Override
258     boolean hasNaturalAlignment() {
259         return alignment == elementLayout.bitAlignment();
260     }
261 
262     @Override
263     public Optional<DynamicConstantDesc<SequenceLayout>> describeConstable() {
264         return Optional.of(decorateLayoutConstant(elemCount.isPresent() ?
265                 DynamicConstantDesc.ofNamed(ConstantDescs.BSM_INVOKE, "value",
266                         CD_SEQUENCE_LAYOUT, MH_SIZED_SEQUENCE, elemCount.getAsLong(), elementLayout.describeConstable().get()) :
267                 DynamicConstantDesc.ofNamed(ConstantDescs.BSM_INVOKE, "value",
268                         CD_SEQUENCE_LAYOUT, MH_UNSIZED_SEQUENCE, elementLayout.describeConstable().get())));
269     }
270 
271     //hack: the declarations below are to make javadoc happy; we could have used generics in AbstractLayout
272     //but that causes issues with javadoc, see JDK-8224052
273 
274     /**
275      * {@inheritDoc}
276      */
277     @Override
278     public SequenceLayout withName(String name) {
279         return (SequenceLayout)super.withName(name);
280     }
281 
282     /**
283      * {@inheritDoc}
284      */
285     @Override
286     public SequenceLayout withBitAlignment(long alignmentBits) {
287         return (SequenceLayout)super.withBitAlignment(alignmentBits);
288     }








289 }
< prev index next >