/** * Copy the current immutable object by setting a value for the {@link RangeInclusiveIType#lower() lower} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for lower * @return A modified copy of the {@code this} object */ public final RangeInclusiveI withLower(int value) { if (this.lower == value) return this; return validate(new RangeInclusiveI(value, this.upper)); }
private static RangeInclusiveI validate(RangeInclusiveI instance) { instance.checkPreconditions(); return instance; }
/** * This instance is equal to all instances of {@code RangeInclusiveI} that have equal attribute values. * @return {@code true} if {@code this} is equal to {@code another} instance */ @Override public boolean equals(Object another) { if (this == another) return true; return another instanceof RangeInclusiveI && equalTo((RangeInclusiveI) another); }
/** * Builds a new {@link RangeInclusiveI RangeInclusiveI}. * @return An immutable instance of RangeInclusiveI * @throws java.lang.IllegalStateException if any required attributes are missing */ public RangeInclusiveI build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return RangeInclusiveI.validate(new RangeInclusiveI(lower, upper)); }
Objects.requireNonNull(range_name, "Range name"); if (range.includesValue(x)) { return x; Integer.valueOf(range.lower()), x_name, Integer.valueOf(x), Integer.valueOf(range.upper()), range_name); assert message != null;
NullCheck.notNull(range_name, "Range name"); if (range.includesValue(x)) { return x; Integer.valueOf(range.getLower()), x_name, Integer.valueOf(x), Integer.valueOf(range.getUpper()), range_name); assert message != null;
Objects.requireNonNull(outer_name, "Outer range name"); if (inner.isIncludedIn(outer)) { return inner;
/** * Creates an immutable copy of a {@link RangeInclusiveIType} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable RangeInclusiveI instance */ public static RangeInclusiveI copyOf(RangeInclusiveIType instance) { if (instance instanceof RangeInclusiveI) { return (RangeInclusiveI) instance; } return RangeInclusiveI.builder() .from(instance) .build(); }
this.valid_attribs = new RangeInclusiveI(0, this.max_attribs - 1);
NullCheck.notNull(outer_name, "Outer range name"); if (inner.isIncludedIn(outer)) { return inner;
this.valid_attribs = new RangeInclusiveI(0, this.max_attribs - 1);
/** * Copy the current immutable object by setting a value for the {@link RangeInclusiveIType#upper() upper} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for upper * @return A modified copy of the {@code this} object */ public final RangeInclusiveI withUpper(int value) { if (this.upper == value) return this; return validate(new RangeInclusiveI(this.lower, value)); }
FakeArrayObjects( final FakeContext c, final FakeArrayBuffers ga, final FakeIndexBuffers gi) throws JCGLExceptionNonCompliant { this.context = NullCheck.notNull(c); this.array_buffers = NullCheck.notNull(ga); this.index_buffers = NullCheck.notNull(gi); this.index_buffers.setArrayObjects(this); this.max_attribs = 16; this.valid_attribs = new RangeInclusiveI(0, this.max_attribs - 1); this.default_buffer = new FakeArrayObject( c, c.getFreshID(), new JCGLArrayVertexAttributeType[0]); this.bind = this.default_buffer; }
/** * Construct a new immutable {@code RangeInclusiveI} instance. * @param lower The value for the {@code lower} attribute * @param upper The value for the {@code upper} attribute * @return An immutable RangeInclusiveI instance */ public static RangeInclusiveI of(int lower, int upper) { return validate(new RangeInclusiveI(lower, upper)); }
FakeArrayObjects( final FakeContext c, final FakeArrayBuffers ga, final FakeIndexBuffers gi) throws JCGLExceptionNonCompliant { this.context = NullCheck.notNull(c, "Context"); this.array_buffers = NullCheck.notNull(ga, "Array buffers"); this.index_buffers = NullCheck.notNull(gi, "Index buffers"); this.index_buffers.setArrayObjects(this); this.max_attribs = 16; this.valid_attribs = new RangeInclusiveI(0, this.max_attribs - 1); this.default_buffer = new FakeArrayObject( c, c.getFreshID(), true, null, new JCGLArrayVertexAttributeType[0]); this.bind = this.default_buffer; }