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

ArrayBuffer with SynchronizedBuffer sortWith produces ArrayBuffer

No replies
richard emberson
Joined: 2010-03-22,
User offline. Last seen 42 years 45 weeks ago.

I've got a synchronized array buffer:

var fnameIdx = new ArrayBuffer[Contact] with
SynchronizedBuffer[Contact]

and I'd like to sort it:

fnameIdx = fnameIdx.sortWith((o1, o2) =>
o1.getFirstName.compareTo(o2.getFirstName) > 0)

But sortWith returns an ArrayBuffer not a
ArrayBuffer with SynchronizedBuffer.

Is there a simple way to associate a Builder with the fnameIdx
that will produce a ArrayBuffer with SynchronizedBuffer?
Is there another way short of simply writing my own sorting routine?

Richard

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