I have several wrapper classes that contain basic forwarding methods like this:
case class Tracks(tracks: Vector[Track] = Vector()): def isEmpty = tracks.isEmpty def nonEmpty = tracks.nonEmpty def length = tracks.length def indices = tracks.indices def head = tracks.head def last = tracks.last def apply(i: Int) = tracks(i) def take(n: Int) = copy(tracks.take(n)) def drop(n: Int) = copy(tracks.drop(n)) def takeRight(n: Int) = copy(tracks.takeRight(n)) def dropRight(n: Int) = copy(tracks.dropRight(n)) def reverse = copy(tracks.reverse)
I was wondering if there is a way to get all Vector methods forwarded without this kind of boilerplate. Any ideas? Thanks.