/** * Indicates that this item has been added to the given section at * the given offset. It is only valid to call this method once per * instance. * * @param addedTo {@code non-null;} the section this instance has * been added to * @param offset {@code >= 0;} the desired offset from the start of the * section where this instance was placed * @return {@code >= 0;} the offset that this instance should be placed at * in order to meet its alignment constraint */ public final int place(Section addedTo, int offset) { if (addedTo == null) { throw new NullPointerException("addedTo == null"); } if (offset < 0) { throw new IllegalArgumentException("offset < 0"); } if (this.addedTo != null) { throw new RuntimeException("already written"); } int mask = alignment - 1; offset = (offset + mask) & ~mask; this.addedTo = addedTo; this.offset = offset; place0(addedTo, offset); return offset; }
/** * Indicates that this item has been added to the given section at * the given offset. It is only valid to call this method once per * instance. * * @param addedTo {@code non-null;} the section this instance has * been added to * @param offset {@code >= 0;} the desired offset from the start of the * section where this instance was placed * @return {@code >= 0;} the offset that this instance should be placed at * in order to meet its alignment constraint */ public final int place(Section addedTo, int offset) { if (addedTo == null) { throw new NullPointerException("addedTo == null"); } if (offset < 0) { throw new IllegalArgumentException("offset < 0"); } if (this.addedTo != null) { throw new RuntimeException("already written"); } int mask = alignment - 1; offset = (offset + mask) & ~mask; this.addedTo = addedTo; this.offset = offset; place0(addedTo, offset); return offset; }
/** * Indicates that this item has been added to the given section at * the given offset. It is only valid to call this method once per * instance. * * @param addedTo {@code non-null;} the section this instance has * been added to * @param offset {@code >= 0;} the desired offset from the start of the * section where this instance was placed * @return {@code >= 0;} the offset that this instance should be placed at * in order to meet its alignment constraint */ public final int place(Section addedTo, int offset) { if (addedTo == null) { throw new NullPointerException("addedTo == null"); } if (offset < 0) { throw new IllegalArgumentException("offset < 0"); } if (this.addedTo != null) { throw new RuntimeException("already written"); } int mask = alignment - 1; offset = (offset + mask) & ~mask; this.addedTo = addedTo; this.offset = offset; place0(addedTo, offset); return offset; }
/** * Indicates that this item has been added to the given section at * the given offset. It is only valid to call this method once per * instance. * * @param addedTo {@code non-null;} the section this instance has * been added to * @param offset {@code >= 0;} the desired offset from the start of the * section where this instance was placed * @return {@code >= 0;} the offset that this instance should be placed at * in order to meet its alignment constraint */ public final int place(Section addedTo, int offset) { if (addedTo == null) { throw new NullPointerException("addedTo == null"); } if (offset < 0) { throw new IllegalArgumentException("offset < 0"); } if (this.addedTo != null) { throw new RuntimeException("already written"); } int mask = alignment - 1; offset = (offset + mask) & ~mask; this.addedTo = addedTo; this.offset = offset; place0(addedTo, offset); return offset; }
/** * Indicates that this item has been added to the given section at * the given offset. It is only valid to call this method once per * instance. * * @param addedTo {@code non-null;} the section this instance has * been added to * @param offset {@code >= 0;} the desired offset from the start of the * section where this instance was placed * @return {@code >= 0;} the offset that this instance should be placed at * in order to meet its alignment constraint */ public final int place(Section addedTo, int offset) { if (addedTo == null) { throw new NullPointerException("addedTo == null"); } if (offset < 0) { throw new IllegalArgumentException("offset < 0"); } if (this.addedTo != null) { throw new RuntimeException("already written"); } int mask = alignment - 1; offset = (offset + mask) & ~mask; this.addedTo = addedTo; this.offset = offset; place0(addedTo, offset); return offset; }
/** * Indicates that this item has been added to the given section at * the given offset. It is only valid to call this method once per * instance. * * @param addedTo {@code non-null;} the section this instance has * been added to * @param offset {@code >= 0;} the desired offset from the start of the * section where this instance was placed * @return {@code >= 0;} the offset that this instance should be placed at * in order to meet its alignment constraint */ public final int place(Section addedTo, int offset) { if (addedTo == null) { throw new NullPointerException("addedTo == null"); } if (offset < 0) { throw new IllegalArgumentException("offset < 0"); } if (this.addedTo != null) { throw new RuntimeException("already written"); } int mask = alignment - 1; offset = (offset + mask) & ~mask; this.addedTo = addedTo; this.offset = offset; place0(addedTo, offset); return offset; }
/** * Indicates that this item has been added to the given section at * the given offset. It is only valid to call this method once per * instance. * * @param addedTo {@code non-null;} the section this instance has * been added to * @param offset {@code >= 0;} the desired offset from the start of the * section where this instance was placed * @return {@code >= 0;} the offset that this instance should be placed at * in order to meet its alignment constraint */ public final int place(Section addedTo, int offset) { if (addedTo == null) { throw new NullPointerException("addedTo == null"); } if (offset < 0) { throw new IllegalArgumentException("offset < 0"); } if (this.addedTo != null) { throw new RuntimeException("already written"); } int mask = alignment - 1; offset = (offset + mask) & ~mask; this.addedTo = addedTo; this.offset = offset; place0(addedTo, offset); return offset; }
/** * Indicates that this item has been added to the given section at * the given offset. It is only valid to call this method once per * instance. * * @param addedTo {@code non-null;} the section this instance has * been added to * @param offset {@code >= 0;} the desired offset from the start of the * section where this instance was placed * @return {@code >= 0;} the offset that this instance should be placed at * in order to meet its alignment constraint */ public final int place(Section addedTo, int offset) { if (addedTo == null) { throw new NullPointerException("addedTo == null"); } if (offset < 0) { throw new IllegalArgumentException("offset < 0"); } if (this.addedTo != null) { throw new RuntimeException("already written"); } int mask = alignment - 1; offset = (offset + mask) & ~mask; this.addedTo = addedTo; this.offset = offset; place0(addedTo, offset); return offset; }