Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. //java style collections for ocaml?
  2.  
  3. [Collection].retainAll -- (?)
  4.  
  5. each collection needs to present its own iterator.
  6.  
  7. //[] notation redundant ?
  8.  
  9. to retrofit
  10. old structures: vector stack?
  11.  
  12. LIST
  13. how many iterators in list: 2
  14. one : ListIterator
  15. two : Iterator (generic -- like a walkman)
  16. in implementation :
  17. just ListIterator needs to be present,
  18. but its perception depends on what we want.
  19.  
  20. QUEUE
  21. head::tail structure //this is interesting : functional prog in java
  22.  
  23. SET
  24. (hashSet, treeSet)
  25. no order
  26. why doesn't it have any new methods but its a separate interface anyway?
  27. 'cuz different semantics
  28.  
  29. MAP (key, value)
  30. (hashMap, treeMap, sortedMap) //wasn't there another maptype that was sorted?
  31. 3 collections : keys, values, mappings
  32. why mappings and keys are sets? they need to be unique
  33.  
  34. ITERATOR
  35. usually internal class for collection : tight binding, encap
  36.  
  37. remember the for-loop //the alamo
  38. //does anyone know the word legible?
  39.  
  40. UTILITIES
  41. Arrays Collections
  42. why are the sort etc. methods not implemented in the collections?
  43. 'cuz there are no intermediate classes, so all the implementation would have to be put into the leaves of the inheritance tree.
  44. //why not make the intermediate class then?
  45.  
  46. [Collections].unmodifiable...(Collection c) - wrapper
  47. [Collections].checked...(Collection c) - wrapper
  48. [Collections].synchronized...(Collection c) - wrapper
  49.  
  50. COMPARATOR & COMPARABLE
  51. {<0, =0, >0}: my object is {first, same, second}
  52.  
  53. # ___ ___
  54. # ___ ___ _ | _| ___ ___ |_ |
  55. # \ \ / / | | | | | \/ | | |
  56. # \ \/ / | | | | | |\ /| | | |
  57. # \ / | | | | | | \/ | | | |
  58. # \__/ |_| | |_ |_| |_| _| |
  59. # |___| |___|
  60.  
  61. GENERICS //parametric polymorphism
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement