Changing the type of Dlist

25 views
Skip to first unread message

Imran Pochi

unread,
May 19, 2014, 8:48:24 AM5/19/14
to scoobi...@googlegroups.com
hello guys , 

after performing a few operations a get a result which is of the type

"val result: com.nicta.scoobi.core.DList[(String, String, Float, String, String)]"


i wanted to chage/cast this to type of a user defined class which has the same fields(string, string, float , string)

I m drawing a blank so a help in the right direction would be much appreciated.

just started using  scala , scoobi , so go easy on me.


Thanks and regards.

Eric Springer

unread,
May 19, 2014, 11:16:01 AM5/19/14
to scoobi...@googlegroups.com
If your user defined type is X, you need a function (String, String, Float, String, String) => X

You can either create this yourself, or if it's a case class -- it should be the X.apply function. Now you can take this function, and map it onto your DList

x.map(transformationFunction)

and viola.


--
You received this message because you are subscribed to the Google Groups "scoobi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scoobi-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Imran Pochi

unread,
May 20, 2014, 4:46:55 AM5/20/14
to scoobi...@googlegroups.com
thankx mate  :)
Reply all
Reply to author
Forward
0 new messages