This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Class extending Set

No replies
porfirio
Joined: 2009-03-25,
User offline. Last seen 42 years 45 weeks ago.

Lets say i have this class

class Foo{
def bar()={

}
}

And i want to have other class that will extend Foo but will be a set of
Foo's

class FooGroup extends Foo with Set[Foo]{
overide def bar()={
for (foo <- this) {
foo.create()
}
}
}

Also i want that when a foo is added to a FooGroup to call change a variable
on the foo

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland