- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
ArrayBuffer with SynchronizedBuffer sortWith produces ArrayBuffer
Thu, 2010-12-16, 17:21
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