Collections Java e Google Collections

Download Collections Java e Google Collections

Post on 11-Nov-2014

2.744 views

Category:

Technology

2 download

Embed Size (px)

DESCRIPTION

Introduo as Collections do JDK e Google Collections

TRANSCRIPT

<ul><li> 1. Java and Google Collections Andr Faria Gomes </li> <li> 2. What is a Collection? </li> <li> 3. It is a container ? </li> <li> 4. is simply an object that groups multiple elements into a single unit </li> <li> 5. Why? </li> <li> 6. store, retrieve, manipulate, and communicate aggregate data </li> <li> 7. The Java Collections Framework </li> <li> 8. Generics </li> <li> 9. The Collection Interface </li> <li> 10. The Iterator Interface </li> <li> 11. Lists (Positional access, Search, Iteration, Range-view) </li> <li> 12. The List Interface </li> <li> 13. The List Iterator </li> <li> 14. ArrayList Resizable-array implementation of the List interface. </li> <li> 15. Linked List (Doubly-linked) better performance if elements are frequently inserted or deleted within the list. </li> <li> 16. Vector Synchronized resizable-array with legacy methods. </li> <li> 17. Push Pop Peek The ArrayDeque is a better option Stack (LIFO) </li> <li> 18. Queue </li> <li> 19. Queue Offer(element) Method Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions. When using a capacity-restricted queue, this method is generally preferable to add(E), which can fail to insert an element only by throwing an exception. </li> <li> 20. Queue add() Method Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing an IllegalStateException if no space is currently available. </li> <li> 21. Queue Pool Method Retrieves and removes the head of this queue, or returns null if this queue is empty. </li> <li> 22. Queue Peek Method Retrieves, but does not remove, the head of this queue, or returns null if this queue is empty. </li> <li> 23. Queue element() Method Retrieves, but does not remove, the head of this queue. This method differs from peek only in that it throws an exception if this queue is empty. </li> <li> 24. The Queue Interface ArrayDeque, LinkedBlockingDeque, LinkedList </li> <li> 25. Linked List (FIFO) Insertion Order (QUEUE - LIST - DEQUE) </li> <li> 26. PriorityQueue A Queue Ordered By Natural or Non Natural Order </li> <li> 27. The Deque Interface (Java 6) element insertion and removal at both ends </li> <li> 28. Deque Interface Methods </li> <li> 29. Deque Descending Iterator </li> <li> 30. Resizable-array implementation of the Deque interface. Array deques have no capacity restrictions; they grow as necessary to support usage. They are not thread-safe; in the absence of external synchronization, they do not support concurrent access by multiple threads. Null elements are prohibited. This class is likely to be faster than Stack when used as a stack, and faster than LinkedList when used as a queue. The ArrayDeque Implementation </li> <li> 31. BlockingQueue / BlockingDeque additionally supports operations that wait for the queue to become non-empty when retrieving an element, and wait for space to become available in the queue when storing an element </li> <li> 32. Sets </li> <li> 33. The Set Interface </li> <li> 34. HashSet (Fast, No Order) </li> <li> 35. TreeSet (Ordered by Value) </li> <li> 36. LinkedHashSet (Insertion Order) </li> <li> 37. Maps </li> <li> 38. The Map Interface </li> <li> 39. HashMap, TreeMap, LinkedHashMap </li> <li> 40. Hashtable (Synchronized HashMap) </li> <li> 41. Concurrent Map A java.util.Map providing additional atomic putIfAbsent(k,v), remove(k,v), and replace (k, oldV,newV) methods. </li> <li> 42. WeakHashMap An implementation of the Map interface that stores only weak references to its keys. Storing only weak references allows key-value pairs to be garbage-collected when the key is no longer referenced outside of the WeakHashMap. </li> <li> 43. Ordering </li> <li> 44. The Comparable Interface (Natural Order) </li> <li> 45. The Comparable Interface (Non Natural Order) </li> <li> 46. The Sorted Set and Sorted Map Interfaces maintains its elements in ascending order, sorted according to the elements' natural ordering or according to a Comparator provided at SortedSet creation time. (TreeSet and TreeMap) </li> <li> 47. The SortedSet Interface </li> <li> 48. The SortedMap Interface </li> <li> 49. The NavigableSet Interface </li> <li> 50. A SortedSet extended with navigation methods. Methods lower, floor, ceiling, and higher return elements respectively less than, less than or equal, greater than or equal, and greater than a given element, returning null if there is no such element. Ascending or descending order. This interface additionally defines methods pollFirst and pollLast that return and remove the lowest and highest element, if one exists, else returning null. Methods subSet, headSet, and tailSet. Implemented By TreeMap The NavigableSet Interface </li> <li> 51. The NavigableMap Inteface Implemented by TreeMao </li> <li> 52. Enums </li> <li> 53. EnumSet </li> <li> 54. EnumMap </li> <li> 55. Wrapper Implementations </li> <li> 56. Unmodifiable </li> <li> 57. Synchronized </li> <li> 58. Checked Collections </li> <li> 59. Joshua Bloch </li> <li> 60. Google Collections Extending the Java Collections Library </li> <li> 61. The Google Collections Library 1.0 is a set of new collection types, implementations and related goodness for Java 5 and higher, brought to you by Google. It is a natural extension of the Java Collections Framework you already know and love. What? </li> <li> 62. Multimap </li> <li> 63. MultiMap </li> <li> 64. Multisets </li> <li> 65. very useful for histograms and counting purposes Multiset </li> <li> 66. BiMap </li> <li> 67. Bi-directional map functionality. Both keys and values are unique, and looking up a key from a value is possible. BiMap </li> <li> 68. MapMaker </li> <li> 69. MapMaker </li> <li> 70. Immutable Collections </li> <li> 71. Immutable Collections </li> <li> 72. Functional Programming </li> <li> 73. Predicates </li> <li> 74. Predicate </li> <li> 75. Class Predicates </li> <li> 76. Functions (Transformation) </li> <li> 77. Functions </li> <li> 78. Preconditions (Constraints) </li> <li> 79. Preconditions </li> <li> 80. Utilities </li> <li> 81. Joiner </li> <li> 82. Joiner </li> <li> 83. Object - Equals and HashCode </li> <li> 84. Reducing Verbosity </li> <li> 85. Get Only Element </li> <li> 86. Map&gt; mapOfLists = Maps.newHashMap(); List strings = Lists.newArrayList(); Reducing Verbosity </li> <li> 87. You Tube http://www.youtube.com/watch?v=ZeO_J2OcHYM </li> <li> 88. Java Posse http://www.javaposse.com </li> <li> 89. Creative Commons Images (1/2) http://www.flickr.com/photos/tonyjcase/2381294958/ http://www.flickr.com/photos/rcsaxon/689732379/ http://www.flickr.com/photos/caveman_92223/3185534518/ http://www.flickr.com/photos/northbaywanderer/121971249/ http://www.flickr.com/photos/photohome_uk/1494590209/ http://www.flickr.com/photos/mworrell/266913194/ http://www.flickr.com/photos/romanlily/2609759239/ http://www.flickr.com/photos/seandreilinger/713631512/ http://www.flickr.com/photos/thatguyfromcchs08/2300190277/ http://www.flickr.com/photos/flyzipper/61475775/ http://www.flickr.com/photos/kasaa/2315571104/ http://www.flickr.com/photos/vermininc/2335148856/ http://www.flickr.com/photos/stewf/2026818238/ http://www.flickr.com/photos/kinghuang/3172003953/ http://www.flickr.com/photos/jgoforth/3111875161/ http://farm3.static.flickr.com/2045/2247502690_d72ec4c683.jpg?v=0 http://www.flickr.com/photos/expressmonorail/3024990539/ http://www.flickr.com/photos/tonivc/403265960/ http://www.flickr.com/photos/kt/146500920/ http://www.flickr.com/photos/marcelgermain/2070007716/ http://www.flickr.com/photos/darwinbell/465459020/ http://www.flickr.com/photos/vgm8383/2482555985/ http://www.flickr.com/photos/darhadubai/2950522110/ http://www.flickr.com/photos/jackhynes/330890500/ http://www.flickr.com/photos/breakfastpirate/167192101/ continue.... </li> <li> 90. Creative Commons Images (2/2) http://www.flickr.com/photos/gadl/8965...</li></ul>