Scratch that, had to change to:

def keys: List[KeyType] = map.keySet().toList.map(_.asInstanceOf
[KeyType])

because of a type error.

On Mar 6, 9:50 am, Timothy Perrett <timo...@getintheloop.eu> wrote:
> Ok - I changed it to:
>
> def keys: List[KeyType] = map.keySet().asInstanceOf[Set
> [KeyType]].toList
>
> there was an implicit in jcl:
>
> import _root_.scala.collection.jcl.Conversions.convertSet
>
> Cheers, Tim
>
> On Mar 5, 9:49 pm, David Pollak <feeder.of.the.be...@gmail.com> wrote:
>
> > On Thu, Mar 5, 2009 at 12:04 PM, Timothy Perrett 
> > <timo...@getintheloop.eu>wrote:
>
> > > I agree, and I would have gone for toList or toSeq or something
> > > however its a java.util.Set, so in order to get that functionality
> > > we'd need to to:
>
> > > .toArray.toList
>
> > Try looking at scala.collection.jcl  I think there's an implicit that will
> > take the set and turn it into a Seq[whatever]
>
> > > Whilst I could live with this, it does feel somewhat dirty.
>
> > > Cheers, Tim
>
> > > On Mar 5, 7:57 pm, David Pollak <feeder.of.the.be...@gmail.com> wrote:
> > > > Looks good to me except the toArray part... I prefer toList is that's
> > > > available
>
> > > > On Mar 5, 2009 11:41 AM, "Tim Perrett" <timo...@getintheloop.eu> wrote:
>
> > > > Guys,
>
> > > > I have a situation where I need to retrive all the keys in my
> > > > KeyedCache - however, KeyedCache extends LRU, which it turn uses
> > > > apache commons LRUMap internally.
>
> > > > The LRU class has a private val map: LRUMap
>
> > > > Is there any objections to me adding a method to LRU to return all the
> > > > keys from that map?:
>
> > > > // off the top of my head...
> > > > def keys: Array[KeyType] = map.keySet().asInstanceOf[Set
> > > > [KeyType]].toArray
>
> > > > Thoughts?
>
> > > > Cheers, Tim
>
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Git some:http://github.com/dpp
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to