简体   繁体   English

Scala集合工厂对象在文档中的apply方法在哪里?

[英]Where is the apply method in the docs, for Scala collection factory objects?

Because I can write: 因为我可以写:

DoubleLinkedList(1,2,3,4)

I expected to find an apply method in the DoubleLinkedList companion object, but I see nothing in the docs linked here . 我希望在DoubleLinkedListDoubleLinkedList对象中找到一个apply方法,但是在这里链接文档中什么也看不到。 Where is it? 它在哪里? Or, why is it not there? 或者,为什么不在那里?

Going up in the hierarchy found it in GenericCompanion . 在层次结构中向上找到它是在GenericCompanion It looks to me like its not being shown may be a Scaladoc bug. 在我看来,没有显示它可能是Scaladoc错误。

If you read carefully the doc page you mention : 如果您仔细阅读了文档页面,则会提到:

A generic implementation of the CanBuildFrom trait, which forwards all calls to apply(from) to the genericBuilder method of collection from, and which forwards all calls of apply() to the newBuilder method of this factory. CanBuildFrom特质的一般实现,它将所有对apply(from)的调用转发到collection的genericBuilder方法,并将所有对apply()的调用转发到该工厂的newBuilder方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM