com.io7m.jaffirm.core.Preconditions.checkPrecondition()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中com.io7m.jaffirm.core.Preconditions.checkPrecondition()方法的一些代码示例,展示了Preconditions.checkPrecondition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Preconditions.checkPrecondition()方法的具体详情如下:
包路径:com.io7m.jaffirm.core.Preconditions
类名称:Preconditions
方法名:checkPrecondition

Preconditions.checkPrecondition介绍

[英]Evaluate the given predicate using value as input.

The function throws PreconditionViolationException if the predicate is false.
[中]使用值作为输入计算给定谓词。
如果谓词为false,函数将抛出PremissionException。

代码示例

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
public PMatrixDirectReadable4x4FType<R2SpaceEyeType, R2SpaceLightEyeType>
matrixProjectiveEyeToLightEye()
{
 Preconditions.checkPrecondition(this.active, "Projective must be active");
 return this.m_projective_eye_to_light_eye;
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
public PMatrixDirectReadable4x4FType<R2SpaceLightEyeType,
 R2SpaceLightClipType> matrixProjectiveProjection()
{
 Preconditions.checkPrecondition(this.active, "Projective must be active");
 return this.m_projective_projection;
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
public PMatrixDirectReadable4x4FType<R2SpaceWorldType, R2SpaceLightEyeType>
matrixProjectiveView()
{
 Preconditions.checkPrecondition(this.active, "Projective must be active");
 return this.m_projective_view;
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
public PMatrixDirectReadable4x4FType<R2SpaceClipType, R2SpaceEyeType>
matrixProjectionInverse()
{
 Preconditions.checkPrecondition(this.active, "Observer must be active");
 return this.m_projection_inverse;
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
public R2ViewRaysReadableType viewRays()
{
 Preconditions.checkPrecondition(this.active, "Observer must be active");
 return this.view_rays;
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
public R2ProjectionType projectiveProjection()
{
 Preconditions.checkPrecondition(this.active, "Projective must be active");
 return this.projection;
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
public PMatrixDirectReadable4x4FType<R2SpaceObjectType, R2SpaceEyeType>
matrixModelView()
{
 Preconditions.checkPrecondition(this.active, "Instance must be active");
 return this.m_modelview;
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
 public PMatrixDirectReadable3x3FType<R2SpaceTextureType,
  R2SpaceTextureType> matrixUV()
 {
  Preconditions.checkPrecondition(this.active, "Instance must be active");
  return this.m_uv;
 }
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
 public PMatrixDirectReadable4x4FType<R2SpaceObjectType, R2SpaceEyeType>
 matrixLightModelView()
 {
  Preconditions.checkPrecondition(
   this.active,
   "Volume light must be active");
  return this.m_modelview;
 }
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
public PMatrixDirectReadable4x4FType<R2SpaceEyeType, R2SpaceClipType>
matrixProjection()
{
 Preconditions.checkPrecondition(this.active, "Observer must be active");
 return this.m_projection;
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
public void shadowMapContextFinish()
{
 Preconditions.checkPrecondition(
  this.active, "Renderer context must be active");
 try {
  this.light = null;
  RendererContext.this.finishContext();
 } finally {
  this.active = false;
 }
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
 public PMatrixDirectReadable4x4FType<R2SpaceObjectType, R2SpaceEyeType>
 matrixLightModelView()
 {
  Preconditions.checkPrecondition(this.active, "Projective must be active");
  return this.m_modelview;
 }
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
public PMatrixDirectReadable3x3FType<R2SpaceObjectType,
 R2SpaceNormalEyeType> matrixNormal()
{
 Preconditions.checkPrecondition(this.active, "Instance must be active");
 return this.m_normal;
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

@Override
public R2ProjectionReadableType projection()
{
 Preconditions.checkPrecondition(this.active, "Observer must be active");
 return this.projection;
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

/**
 * @return The usable array object for the batch
 */
public JCGLArrayObjectUsableType arrayObject()
{
 Preconditions.checkPrecondition(
  this.array_object != null,
  "Line segments must have been provided");
 return this.array_object;
}

代码示例来源:origin: com.io7m.r2/io7m-r2-meshes-obj

private void finishCurrentMesh()
{
 Preconditions.checkPrecondition(
  this.mesh.isPresent(), "Mesh must be present");
 final String name = this.mesh.get();
 Preconditions.checkPrecondition(
  !this.meshes.containsKey(name), "Mesh must not already exist");
 final R2MeshBasicType m = this.builder.build();
 LOG.debug("loaded {}", name);
 this.meshes.put(name, m);
}

代码示例来源:origin: com.io7m.r2/io7m-r2-core

void start()
{
 Preconditions.checkPrecondition(
  !this.active, "Renderer context must not be active");
 this.variance.clear();
 this.active = true;
}

代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.processing.api

@Override
public SMFMemoryMesh mesh()
 throws IllegalStateException
{
 Preconditions.checkPrecondition(
  this.finished, "Mesh parsing has not yet finished");
 if (this.errors.isEmpty()) {
  return this.mesh;
 }
 throw new IllegalStateException("Mesh parsing failed");
}

代码示例来源:origin: com.io7m.jcanephora/com.io7m.jcanephora.lwjgl3

public static LWJGL3TextureSpec getTextureSpec(
  final JCGLTextureFormat format)
 {
  NullCheck.notNull(format, "Format");

  Preconditions.checkPrecondition(
   format,
   SPECS.containsKey(format),
   ignored -> "Format specification must be known");

  return SPECS.get(format);
 }
}

代码示例来源:origin: com.io7m.jpra/com.io7m.jpra.compiler.core

private static ImmutableList<FieldName> getFieldPath(
 final Optional<LexicalPosition<Path>> lex,
 final SExpressionSymbolType se,
 final String text)
 throws JPRACompilerParseException
{
 Preconditions.checkPrecondition(!text.isEmpty(), "Text must non-empty");
 final String[] segments = text.split("\\.");
 return Lists.immutable.of(segments)
  .reject(String::isEmpty)
  .collect(x -> new FieldName(lex, x));
}

相关文章