final T r = constructor.apply(a, b); Postconditions.checkPostcondition( Objects.equals(a.getClass(), r.getClass()), "Scaler must preserve class");
/** * <p>Evaluate the given {@code predicate} using {@code value} as input.</p> * * <p>The function throws {@link PostconditionViolationException} if the * predicate is false.</p> * * @param value The value * @param condition The predicate * @param <T> The type of values * * @return value * * @throws PostconditionViolationException If the predicate is false */ public static <T> T checkPostcondition( final T value, final ContractConditionType<T> condition) throws PostconditionViolationException { return checkPostcondition( value, condition.predicate(), condition.describer()); }
/** * <p>Evaluate the given {@code predicate} using {@code value} as input.</p> * * <p>The function throws {@link PostconditionViolationException} if the * predicate is false.</p> * * @param value The value * @param condition The predicate * @param <T> The type of values * * @return value * * @throws PostconditionViolationException If the predicate is false */ public static <T> T checkPostcondition( final T value, final ContractConditionType<T> condition) throws PostconditionViolationException { return checkPostcondition( value, condition.predicate(), condition.describer()); }
void trim() { if (this.timer.isPresent()) { final JCGLTimerQueryType t = this.timer.get(); JCGLProfiling.this.timers.timerQueryDelete(t); this.timer = Optional.empty(); } final ObjectBidirectionalIterator<String> k_iter = this.children.keySet().iterator(); while (k_iter.hasNext()) { final String k = k_iter.next(); final Context c = this.children.get(k); c.trim(); k_iter.remove(); } Postconditions.checkPostcondition( this.children, this.children.isEmpty(), ignored -> "Child nodes have been correctly cleared"); Postconditions.checkPostcondition( this.timer, !this.timer.isPresent(), ignored -> "Timer must have been deleted"); }
this.program.uniforms(); Postconditions.checkPostcondition( uniforms, uniforms.containsKey("t_albedo"),
this.program.getUniforms(); Postconditions.checkPostcondition( uniforms, uniforms.containsKey("t_albedo"),
this.program.getUniforms(); Postconditions.checkPostcondition( uniforms, uniforms.containsKey("t_albedo"),
this.program.uniforms(); Postconditions.checkPostcondition( uniforms, uniforms.containsKey("t_albedo"),
this.program.getUniforms(); Postconditions.checkPostcondition( uniforms, uniforms.containsKey("t_albedo"),
this.program.uniforms(); Postconditions.checkPostcondition( uniforms, uniforms.containsKey("t_albedo"),
this.program.uniforms(); Postconditions.checkPostcondition( uniforms, uniforms.containsKey("t_albedo"),
this.program.getUniforms(); Postconditions.checkPostcondition( uniforms, uniforms.containsKey("t_albedo"),
void trimRecursive() { this.elapsed_total = 0L; final ReferenceCollection<Context> os = this.children.values(); final ObjectIterator<Context> o_iter = os.iterator(); while (o_iter.hasNext()) { final Context c = o_iter.next(); c.trim(); o_iter.remove(); } this.children.trim(); Postconditions.checkPostcondition( this.children, this.children.isEmpty(), ignored -> "Child nodes have been correctly cleared"); }