SexScripts : Programming my own classes - https://ss.deviatenow.com:443/viewtopic.php?f=4&t=270 | Page 1 of 1 |
Programming my own classes |
Jariservus [ Fri Sep 21, 2012 5:50 pm ] |
---|---|
Hi, first off, great program! I was wondering if a script writer could define his/her own classes. I noticed that defining a class within a script would prompt an error. I want to implement my own Comparator class to use on a SortedMap. |
Re: Programming my own classes |
doti [ Fri Sep 21, 2012 8:44 pm ] |
---|---|
You can only use closures for this. But it won't be hard for that Code: Comparator comparator = [compare: {a , b ->
b.compareTo(a) //or anything else }] as Comparator SortedMap sm = new TreeMap(comparator) ... |
Page 1 of 1 | All times are UTC + 1 hour [ DST ] |