- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Why does Builder redefine method inherited from Growable
Fri, 2009-09-18, 13:15
Hi all,
sorry if this is a stupid question. I try to get a deeper understanding
of Scala by having a look on the new collection classes of version 2.8.
In the trait scala.collection.generic.Builder if found these two defintions:
/** Adds a single element to the builder.
* @param elem The element to be added
*/
def +=(elem: Elem): this.type
/** Clear the contents of this builder
*/
def clear()
The Builder trait extends the Growable trait that contains the same
defintions:
/** Adds a single element to this collection.
*
* @param elem the element to add.
*/
def +=(elem: A): this.type
/** Clears the collection contents.
*/
def clear()
Why are these methods redefined on the Builder trait?
Thanks for your attention,
Stefan