javaslang.collection.List.isEmpty()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(100)

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

List.isEmpty介绍

暂无

代码示例

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

@Override
public JCGLArrayBufferType arrayBuffer()
 throws IllegalStateException
{
 if (!this.errors.isEmpty()) {
  throw new IllegalStateException("Array loading has failed");
 }
 return this.array_buffer;
}

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

@Override
public SMFByteBufferPackedMesh mesh()
 throws IllegalStateException
{
 if (this.errors.isEmpty()) {
  return this.mesh;
 }
 throw new IllegalStateException("Buffer packer has failed");
}

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

@Override
public JCGLArrayObjectType arrayObject()
 throws IllegalStateException
{
 if (!this.errors.isEmpty()) {
  throw new IllegalStateException("Array loading has failed");
 }
 return this.array_object;
}

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

@Override
public JCGLIndexBufferType indexBuffer()
 throws IllegalStateException
{
 if (!this.errors.isEmpty()) {
  throw new IllegalStateException("Array loading has failed");
 }
 return this.index_buffer;
}

代码示例来源: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: dswarm/dswarm

/**
 * _1 = mapping output - last attribute
 * _2 = mapping output attributes - last attribute
 * _3 = last attribute of mapping output
 *
 * @param mappingOutput
 * @return
 */
private static Optional<Tuple3<Optional<String>, javaslang.collection.List<String>, String>> determineMappingOutputAttribute(final MappingAttributePathInstance mappingOutput) {
  return Optional.ofNullable(mappingOutput)
      .flatMap(mappingOutput1 -> Optional.ofNullable(mappingOutput1.getAttributePath()))
      .flatMap(attributePath -> Optional.ofNullable(attributePath.toAttributePath()))
      .flatMap(attributePathString -> {
        // .ESCAPE_XML11.with(NumericEntityEscaper.between(0x7f, Integer.MAX_VALUE)).translate( <- also doesn't work
        final String escapedMappingOutputAP = StringEscapeUtils.escapeXml(attributePathString);
        final javaslang.collection.List<String> mappingOutputAttributes = javaslang.collection.List.of(escapedMappingOutputAP.split(ATTRIBUTE_DELIMITER));
        if (mappingOutputAttributes.isEmpty()) {
          return Optional.of(Tuple.of(Optional.empty(), mappingOutputAttributes.init(), escapedMappingOutputAP));
        }
        final String lastAttribute = mappingOutputAttributes.last();
        final String mappingOutputRoot = mappingOutputAttributes.init().mkString(ATTRIBUTE_DELIMITER);
        final Optional<String> optionalMappingOutputRoot = Optional.of(mappingOutputRoot).filter(mappingOutputRoot1 -> !mappingOutputRoot1.isEmpty());
        return Optional.of(Tuple.of(optionalMappingOutputRoot, mappingOutputAttributes.init(), lastAttribute));
      });
}

代码示例来源:origin: dswarm/dswarm

final javaslang.collection.List<Tuple2<Attribute, Optional<Boolean>>> attributesList = determineAndCreateAttributes(fields, schemaBaseURI);
if (attributesList.isEmpty()) {
if (attributePathsList.isEmpty()) {

代码示例来源:origin: com.io7m.smfj/io7m-smfj-format-text

private void parseMetaDataValues(
 final long vendor_id,
 final long schema_id,
 final long lines)
 throws Exception
{
 final ArrayList<String> saved_lines = new ArrayList<>();
 while ((long) saved_lines.size() < lines) {
  final Optional<List<String>> line_opt = super.reader.line();
  if (!line_opt.isPresent()) {
   this.onEOF();
   return;
  }
  this.log().trace("line: {}", line_opt.get());
  final List<String> line = line_opt.get();
  if (line.isEmpty()) {
   super.failExpectedGot(
    "Received an empty line.",
    "A line of Base64 encoded data.",
    "");
   return;
  }
  saved_lines.add(line.toJavaStream().collect(Collectors.joining()));
 }
 final byte[] decoded = SMFBase64Lines.fromBase64Lines(saved_lines);
 if (this.events.onMeta(vendor_id, schema_id, (long) decoded.length)) {
  this.events.onMetaData(vendor_id, schema_id, decoded);
 }
}

代码示例来源:origin: com.io7m.smfj/io7m-smfj-format-text

if (line.isEmpty()) {
 continue;

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

@Override
public void onFinish()
{
 if (this.errors.isEmpty()) {
  this.mesh =
   SMFMemoryMesh.builder()
    .setArrays(this.arrays)
    .setHeader(this.header)
    .setTriangles(this.triangles)
    .setMetadata(this.metadata)
    .build();
 }
 this.finished = true;
}

代码示例来源:origin: com.io7m.smfj/io7m-smfj-format-text

if (line.isEmpty()) {
 continue;

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

@Override
public Validation<List<SMFErrorType>, SMFHeader> validate(
 final SMFHeader header,
 final SMFSchema schema)
{
 NullCheck.notNull(header, "Header");
 NullCheck.notNull(schema, "Schema");
 List<SMFErrorType> errors = List.empty();
 final Optional<SMFSchemaIdentifier> file_id_opt = header.schemaIdentifier();
 if (file_id_opt.isPresent()) {
  final SMFSchemaIdentifier file_id = file_id_opt.get();
  final SMFSchemaIdentifier schema_id = schema.schemaIdentifier();
  if (!Objects.equals(schema_id, file_id)) {
   errors = errors.append(errorWrongSchemaID(schema_id, file_id));
  }
 }
 errors = checkVerticesAndTriangles(header, schema, errors);
 errors = checkAttributes(header, schema, errors);
 errors = checkCoordinateSystem(header, schema, errors);
 if (errors.isEmpty()) {
  return valid(header);
 }
 return invalid(errors);
}

代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.validation.main

if (line.isEmpty()) {
   continue;
if (errors.isEmpty()) {
 if (!this.received_identifier) {
  return invalid(errors.append(SMFParseError.of(

代码示例来源:origin: com.io7m.smfj/io7m-smfj-format-text

private Validation<List<SMFParseError>, SMFFormatVersion> onParseVersion(
 final List<String> line)
 if (line.isEmpty()) {
  return invalid(List.of(this.makeErrorExpectedGot(
   "The first line must be a version declaration.",

代码示例来源:origin: com.io7m.smfj/io7m-smfj-format-text

if (line.isEmpty()) {
 continue;

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

@Override
public void onFinish()
{
 final JCGLArrayBuffersType g_ab = this.g.getArrayBuffers();
 final JCGLIndexBuffersType g_ib = this.g.getIndexBuffers();
 if (!this.errors.isEmpty()) {
  if (this.array_buffer != null) {
   g_ab.arrayBufferDelete(this.array_buffer);
   this.array_buffer = null;
  }
  if (this.index_buffer != null) {
   g_ib.indexBufferDelete(this.index_buffer);
   this.index_buffer = null;
  }
 }
 g_ab.arrayBufferUpdate(this.array_update);
 g_ib.indexBufferUpdate(this.index_update);
 this.array_object =
  this.g.getArrayObjects().arrayObjectAllocate(this.array_object_builder);
}

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

/**
 * Attempt to parse a command.
 *
 * @param file The file, if any
 * @param line The line
 * @param text The text
 *
 * @return A parsed command or a list of parse errors
 */
public static Validation<List<SMFParseError>, SMFMemoryMeshFilterType> parse(
 final Optional<URI> file,
 final int line,
 final List<String> text)
{
 NullCheck.notNull(file, "file");
 NullCheck.notNull(text, "text");
 if (text.isEmpty()) {
  try {
   return valid(create());
  } catch (final IllegalArgumentException e) {
   return errorExpectedGotValidation(file, line, makeSyntax(), text);
  }
 }
 return errorExpectedGotValidation(file, line, makeSyntax(), text);
}

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

@Override
public void onFinish()
{
 if (this.errors.isEmpty()) {
  Invariants.checkInvariantI(
   this.attr_buffers.size(),
   this.attr_buffers.size() == this.config.size(),
   x -> "Must have correct number of buffers");
  final SMFByteBufferPackedMesh.Builder mb =
   SMFByteBufferPackedMesh.builder();
  for (final Tuple2<Integer, ByteBuffer> p : this.attr_buffers) {
   mb.addAttributeSets(SMFByteBufferPackedAttributeSet.of(
    p._1.intValue(),
    this.config.get(p._1).get(),
    p._2));
  }
  if (this.tri_buffer != null) {
   final SMFTriangles triangles = this.header.triangles();
   mb.setTriangles(SMFByteBufferPackedTriangles.of(
    this.tri_buffer,
    triangles.triangleCount(),
    Math.toIntExact(triangles.triangleIndexSizeBits())));
  }
  mb.setHeader(this.header);
  this.mesh = mb.build();
 }
}

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

if (errors.isEmpty()) {
 final SMFTriangles new_triangles =
  m.header().triangles().withTriangleIndexSizeBits(triangle_size);

代码示例来源:origin: com.io7m.smfj.jcanephora/io7m-smfj-jcanephora-tests

Assert.assertTrue(loader.errors().isEmpty());

相关文章