Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Other Collections1-27-2012Opening DiscussionMinute essay comments:Renaming in Eclipse.Tabs in Eclipse.Where can you learn about Any, AnyRef, etc.? Pg. 413Details of implicit conversions beyond this course. Will be in an appendix.Limiting the sort to numeric types.Parametric polymorphism is polymorphism you get by having a type parameter.Finishing SortsDo sort with comparison function first.scala.collectionhttp://www.scala-lang.org/docu/files/collections-api/collections_1.htmlThe collection API in Scala is really powerful. This is a big part of what makes the language so great to use.In the first semester we focus on basic sequence types.We gain a lot of power by adding Map, Set, and Buffer.MapStores (key, value) pairs. Let's you do fast look-up by key.Two type parameters.A sequence is indexed by Int and need “all slots filled”.A Map can be indexed by anything and can be sparse.You should only use immutable values for keys.SetBased on math idea.Order doesn't matter.Elements have to be unique.BufferLike an array with the ability to grow and shrink.Drawing ProgramLet's add more code do the drawing program.DrawTransform is a great place for a Buffer.The command processor is a great example of a place where a Map can come in handy.Minute EssayQuestions?How do you see various collections being used in your projects?We have TA/budget issues with the department so I want to survey how many of you feel you would benefit from having Chris as the TA for this
View Full Document