- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Class extending Set
Wed, 2009-03-25, 15:59
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