简体   繁体   English

Scala中的递归数据类型

[英]Recursive DataType in Scala

Hi I was wondering if someone could explain this signature I found in the Spark codebase. 嗨,我想知道是否有人可以解释我在Spark代码库中找到的签名。 It looks like a recursive datatype, it's used to build the query plan so it kind of makes sense. 它看起来像一个递归数据类型,用于构建查询计划,因此很有意义。 Does anyone have anymore detailed knowledge of this? 有人对此有更详细的了解吗?

abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product 

It is F-Bounded Types (or self-recursive types ). 它是F界限类型 (或自递归类型 )。 Not scala specific, eg equivalent in java 不特定于Scala,例如Java中的等价物

public abstract class Enum<E extends Enum<E>> implements Comparable<E>

You can read here or here 您可以在这里这里阅读

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

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