本文整理了Java中javaslang.collection.List.empty()
方法的一些代码示例,展示了List.empty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。List.empty()
方法的具体详情如下:
包路径:javaslang.collection.List
类名称:List
方法名:empty
暂无
代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.bytebuffer
private SMFByteBufferPackedMeshes(
final SMFParserEventsDataMetaOptionalSupplierType in_meta,
final SMFByteBufferPackerEventsType in_events)
{
this.meta = NullCheck.notNull(in_meta, "Meta");
this.events = NullCheck.notNull(in_events, "Events");
this.errors = List.empty();
this.warnings = List.empty();
}
代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.processing.api
private SMFMemoryMeshProducer()
{
this.started = false;
this.errors = List.empty();
this.warnings = List.empty();
this.arrays = HashMap.empty();
this.triangles = Vector.empty();
this.metadata = Vector.empty();
}
代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.validation.main
private static <E, T> Validation<List<E>, T> flatten(
final Validation<List<List<E>>, T> v)
{
return v.mapError(xs -> xs.fold(List.empty(), List::appendAll));
}
代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.bytebuffer
@Override
public void onStart()
{
this.errors = List.empty();
this.attr_buffers = TreeMap.empty();
this.attr_packers = TreeMap.empty();
this.mesh = null;
this.header = null;
this.tri_buffer = null;
this.tri_packer = null;
}
代码示例来源:origin: com.io7m.smfj/io7m-smfj-format-text
@Override
public final Optional<List<String>> line()
throws IOException
{
final String line = this.lineNextRaw();
this.position.setLine(Math.addExact(this.position.line(), 1));
if (line == null) {
return Optional.empty();
}
final String trimmed = line.trim();
if (trimmed.isEmpty()) {
return Optional.of(List.empty());
}
if (trimmed.startsWith("#")) {
return Optional.of(List.empty());
}
return Optional.of(this.lexer.lex(trimmed));
}
代码示例来源:origin: com.io7m.smfj.jcanephora/io7m-smfj-jcanephora-core
Loader(
final JCGLInterfaceGL33Type in_g,
final SMFParserEventsMetaType in_meta,
final SMFArrayObjectConfiguration in_configuration)
{
this.g = NullCheck.notNull(in_g, "GL");
this.configuration = NullCheck.notNull(in_configuration, "Configuration");
this.meta = NullCheck.notNull(in_meta, "Meta");
this.attributes_by_index = new TreeMap<>();
this.attributes_by_name = new TreeMap<>();
this.vertex_size = 0;
this.array_buffer_size = 0L;
this.index_position = 0;
this.errors = List.empty();
}
代码示例来源:origin: com.io7m.smfj/io7m-smfj-format-text
SMFTV1HeaderParser(
final SMFTAbstractParser in_parent,
final SMFParserEventsType in_events,
final SMFTLineReaderType in_reader,
final SMFFormatVersion in_version)
{
super(
in_events,
in_reader,
NullCheck.notNull(in_parent, "Parent").state);
this.attribute_lines = HashMap.empty();
this.attributes_list = List.empty();
this.ok_triangles = false;
this.ok_vertices = false;
this.schema_id = SMFSchemaIdentifier.of(0, 0, 0, 0);
}
代码示例来源:origin: dswarm/dswarm
final Optional<String> optionalCommonAttributePathOfMappingInputs = entityMappingOutputTuple._2;
mappingOutputAttributes.foldLeft(javaslang.collection.List.empty(), (currentAttributePath, currentAttribute) -> {
代码示例来源:origin: dswarm/dswarm
/**
* sort components re. their natural order (begin from the end, i.e., component without output components)
*
* @param components original components set
* @return
*/
private static javaslang.collection.List<Component> sortComponents(final Set<Component> components) {
final Optional<Component> optionalLastComponent = components.stream()
.filter(component -> {
final Set<Component> outputComponents = component.getOutputComponents();
return outputComponents == null || outputComponents.isEmpty();
})
.findFirst();
if (!optionalLastComponent.isPresent()) {
return javaslang.collection.List.ofAll(components);
}
final Component lastComponent = optionalLastComponent.get();
final javaslang.collection.List<Component> lastComponentList = javaslang.collection.List.of(lastComponent);
final javaslang.collection.Map<String, Component> componentMap = javaslang.collection.HashSet.ofAll(components)
.toMap(component -> Tuple.of(component.getUuid(), component));
final javaslang.collection.List<Component> emptyComponentList = javaslang.collection.List.empty();
return addComponents(lastComponentList, componentMap, emptyComponentList);
}
代码示例来源:origin: dswarm/dswarm
final javaslang.collection.List<Component> emptyPreviousComponentList = javaslang.collection.List.empty();
代码示例来源: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
SMF_VERTICES_REQUIRED);
List<SMFErrorType> errors = List.empty();
代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.processing.main
Seq<SMFProcessingError> errors = List.empty();
errors = checkAttributeExists(errors, by_name, this.attribute);
代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.processing.main
NullCheck.notNull(m, "Mesh");
List<SMFProcessingError> errors = List.empty();
final long vertices = m.header().vertexCount();
final Vector<Vector3L> triangles = m.triangles();
代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.processing.main
Seq<SMFProcessingError> errors = List.empty();
for (final SMFAttributeName name : this.attributes) {
errors = checkAttributeExists(errors, by_name, name);
代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.processing.main
List.empty(), m.header().attributesByName(), this.source);
if (!errors.isEmpty()) {
return invalid(List.ofAll(errors));
代码示例来源:origin: com.io7m.smfj/com.io7m.smfj.processing.main
m.header().attributesByName();
Seq<SMFProcessingError> errors =
checkAttributeExists(List.empty(), by_name, this.source);
errors = checkAttributeNonexistent(errors, by_name, this.target);
内容来源于网络,如有侵权,请联系作者删除!