For example,
class BasicTransitionFunction(TransitionFunction[GrammarBasedState]):
...
where TransitionFunction
is the base class of BasicTransitionFunction
, and GrammarBasedState
is also a class name. I only know that []
can be used to indexed arrays. What does it mean here?
This is the syntax for generic types. Like @Sraw said, it means that TransitionFunction
is a generic type. For example, List
is a generic type, so you can have List[Int]
.
This is the same idea as for C++ templates (e.g. std::vector<int>
).
So here BasicTransitionFunction
is a subclass of a TransitionFunction
between GrammarBasedState
s.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With