home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / jgl_1_1 / examples / examplesoutput.txt < prev    next >
Encoding:
Text File  |  1996-09-17  |  36.4 KB  |  1,410 lines

  1. Output from Adapters1.class
  2. ----------------------
  3. Unsorted native int array = int[]( 3, -1, 2, -3, 4 )
  4. Sorted = int[]( -3, -1, 2, 3, 4 )
  5. Randomized = int[]( -1, -3, 2, 4, 3 )
  6. -1 -3 2 4 3 
  7.  
  8. Output from Adapters2.class
  9. ----------------------
  10. Unsorted JDK Vector = [3, -1, 2, -3, 4]
  11. Sorted = [-3, -1, 2, 3, 4]
  12. Randomized = [-3, -1, 2, 3, 4]
  13. JDK vector = [-3, -1, 2, 3, 4]
  14.  
  15. Output from Algorithms1.class
  16. ----------------------
  17. PRINT cat
  18. PRINT monkey
  19. PRINT goat
  20. list = SList( 3, 7, 4 ), total = 14
  21.  
  22. Output from Algorithms2.class
  23. ----------------------
  24. vector before copying = [1, 4]
  25. vector after copying = [1, 4, 2, 6, 3, 7]
  26.  
  27. Output from Algorithms3.class
  28. ----------------------
  29. list = SList( -1, 1, -2, 1, -3 )
  30. Occurences of 1 = 2
  31. Occurences of a negative = 3
  32.  
  33. Output from Algorithms4.class
  34. ----------------------
  35. array = int[]( 3, 7, 8, 2, -5, 8, 9, -2 )
  36. first negative = -5
  37. some items are negative = true
  38.  
  39. Output from Algorithms5.class
  40. ----------------------
  41. array1 = Array( cat, monkey, goat, elephant )
  42. strings with length > 4 = Array( monkey, elephant )
  43. strings with length <= 4 = Array( cat, goat )
  44.  
  45. Output from Algorithms6.class
  46. ----------------------
  47. list = DList( -1, 1, -2, 1, -3 )
  48. after 1 -> 4, list = DList( -1, 4, -2, 4, -3 )
  49. list = DList( -1, 4, -2, 4, -3 )
  50. array = Array( 0, 4, 0, 4, 0 )
  51.  
  52. Output from Algorithms7.class
  53. ----------------------
  54. before reverse = Deque( Batman, Superman, Phantom, Spiderman )
  55. after reverse = Deque( Spiderman, Phantom, Superman, Batman )
  56.  
  57. Output from Algorithms8.class
  58. ----------------------
  59. unsorted array = Array( 3, -2, 4, -5 )
  60. sorted array = Array( -5, -2, 3, 4 )
  61. unsorted deque = Deque( triangle, square, pentagon, hexagon )
  62. sorted deque = Deque( hexagon, pentagon, square, triangle )
  63.  
  64. Output from Algorithms9.class
  65. ----------------------
  66. ints1 = int[]( 1, 3, 5, 2 )
  67. array = Array( -1, -3, -5, -2 )
  68.  
  69. ints2 = int[]( 2, 4, 2, 3 )
  70. ints3 = int[]( 3, 6, 2, 1 )
  71. list = SList( 6, 24, 4, 3 )
  72.  
  73. array1 = Array( cat, monkey, goat )
  74. array2 = Array( 3, 6, 4 )
  75.  
  76. Output from Applying1.class
  77. ----------------------
  78. array = Array( cat, dog, emu )
  79. Print each element to standard output
  80. cat
  81. dog
  82. emu
  83. Print each element to standard output
  84. cat
  85. dog
  86. emu
  87.  
  88. Output from Applying2.class
  89. ----------------------
  90. array = Array( 100, 2, 71 )
  91. injecting TimesInteger(initial value==1) = 14200
  92. injecting PlusInteger(initial value==0) = 173
  93. injecting MinusInteger(initial value==0) = -173
  94. injecting DividesInteger(initial value==1000) = 7
  95.  
  96. Output from Array1.class
  97. ----------------------
  98. Array( ape, bat, cat )
  99.  
  100. Enumerate the Array
  101. ape
  102. bat
  103. cat
  104.  
  105. Iterate through the Array
  106. ape
  107. bat
  108. cat
  109.  
  110. Demonstrate access
  111. array.at( 0 ) = ape
  112. array.front() = ape
  113. array.at( 2 ) = cat
  114. array.back() = cat
  115.  
  116. Demonstrate modification
  117. Array( ape, fox, cat )
  118. After popFront() = Array( fox, cat )
  119. After popBack() = Array( fox )
  120.  
  121. Output from Array2.class
  122. ----------------------
  123. Array( ape, bat, cat, bat, bat, cat )
  124.  
  125. array.count( bat ) = 3
  126. array.indexOf( bat ) = 1
  127. After array.remove( 1 ) = Array( ape, cat, bat, bat, cat )
  128. After array.replace( 0, 2, bat, BAT ) = Array( ape, cat, BAT, bat, cat )
  129. array.remove( cat ) = 2
  130. After array.remove( cat ) = Array( ape, BAT, bat )
  131. After array.remove( begin() ) = Array( BAT, bat )
  132.  
  133. Output from Array3.class
  134. ----------------------
  135. array = Array( bat, cat, dog )
  136.  
  137. After insert at begin = Array( ape, bat, cat, dog )
  138. After insert at end = Array( ape, bat, cat, dog, emu )
  139. After array.insert( 3, 2, fox ) = Array( ape, bat, cat, fox, fox, dog, emu )
  140.  
  141. Output from Array4.class
  142. ----------------------
  143. array = Array( bat, CAT, dog ), capacity = 3
  144. array = bat CAT dog 
  145. array = Array( bat, CAT, DOG ), capacity = 100
  146. array = bat CAT dog 
  147.  
  148. Output from Array5.class
  149. ----------------------
  150. Caught jgl.InvalidOperationException: Array is empty
  151. Caught java.lang.IndexOutOfBoundsException: Attempt to access index 5 when valid range is 0..2
  152.  
  153. Output from Comparing1.class
  154. ----------------------
  155. median of cat, ape and dog = cat
  156.  
  157. array1 = Array( ape, bat, emu )
  158. array2 = Array( ape, bat, dog, cat )
  159. array1 mismatch @ emu
  160. array2 mismatch @ dog
  161. array2 equals deque1? true
  162. (array1 < deque1) = false
  163.  
  164. Output from Container1.class
  165. ----------------------
  166. array = Array( triangle, square, pentagon, hexagon )
  167. array.size() = 4
  168. array.empty() = false
  169. after array is cleared...
  170. array.size() = 0
  171. array.empty() = true
  172.  
  173. Output from Container10.class
  174. ----------------------
  175. unsorted native int array = int[]( 3, -1, 2, 0, -6 )
  176. sorted = -6 -1 0 2 3 
  177.  
  178. Output from Container2.class
  179. ----------------------
  180. triangle
  181. square
  182. pentagon
  183. hexagon
  184.  
  185. Output from Container3.class
  186. ----------------------
  187. array1 = Array( triangle, square, pentagon )
  188. array2 = Array( triangle, square, pentagon )
  189. array1.equals( array2 ) = true
  190. before copy, array3 = Array( heptagon, octagon )
  191. after copy, array3 = Array( triangle, square, pentagon )
  192. array4 = Array( triangle, square, pentagon )
  193.  
  194. Output from Container4.class
  195. ----------------------
  196. array1 = Array( ape, bat, cat ), array2 = Array( red, blue )
  197. array1 = Array( red, blue ), array2 = Array( ape, bat, cat )
  198.  
  199. Output from Container5.class
  200. ----------------------
  201. Array = Array( 2, false, x, 3.14 )
  202.  
  203. Output from Container6.class
  204. ----------------------
  205. The headquarters of Company( ObjectSpace ) are in Texas
  206.  
  207. Output from Container7.class
  208. ----------------------
  209. Caught java.lang.IndexOutOfBoundsException: Attempt to access index 5 when valid range is 0..1
  210.  
  211. Output from Container8.class
  212. ----------------------
  213. Caught jgl.InvalidOperationException: Array is empty
  214.  
  215. Output from Container9.class
  216. ----------------------
  217. Caught java.lang.IllegalArgumentException: Attempt to create an Array with a negative size
  218.  
  219. Output from Copying1.class
  220. ----------------------
  221. array = Array( 3, 6, 4, 1 ), deque = Deque( 6, 4 )
  222. Copy array to System.out.
  223. 3 6 4 1 
  224. array = Array( 3, 6, 6, 4 )
  225.  
  226. Output from DList1.class
  227. ----------------------
  228. DList( ape, bat, cat )
  229.  
  230. Enumerate the DList
  231. ape
  232. bat
  233. cat
  234.  
  235. Iterate through the DList
  236. ape
  237. bat
  238. cat
  239.  
  240. Demonstrate access
  241. dlist.at( 0 ) = ape
  242. dlist.front() = ape
  243. dlist.at( 2 ) = cat
  244. dlist.back() = cat
  245.  
  246. Demonstrate modification
  247. DList( ape, fox, cat )
  248. popFront() returns: ape
  249. After popFront() = DList( fox, cat )
  250. popBack() returns: cat
  251. After popBack() = DList( fox )
  252.  
  253. Output from DList2.class
  254. ----------------------
  255. DList( ape, bat, cat, bat, bat, cat )
  256.  
  257. dlist.count( bat ) = 3
  258. object at dlist.find( bat ) = bat
  259. After dlist.remove( iterator ) = DList( ape, cat, bat, bat, cat )
  260. After dlist.replace( start, finish, bat, BAT ) = DList( ape, cat, BAT, bat, cat )
  261. dlist.remove( cat ) = 2
  262. After dlist.remove( cat ) = DList( ape, BAT, bat )
  263. After dlist.remove( begin() ) = DList( BAT, bat )
  264.  
  265. Output from DList3.class
  266. ----------------------
  267. dlist = DList( bat, cat, dog )
  268.  
  269. After insert at begin = DList( ape, bat, cat, dog )
  270. After insert at end = DList( ape, bat, cat, dog, emu )
  271. After dlist.insert( i, 2, fox ) = DList( ape, bat, cat, fox, fox, dog, emu )
  272.  
  273. Output from DList4.class
  274. ----------------------
  275. Caught jgl.InvalidOperationException: DList is empty
  276. Caught java.lang.IndexOutOfBoundsException: Attempt to access index 5 when valid range is 0..2
  277.  
  278. Output from DList5.class
  279. ----------------------
  280. before: dlist1 = DList( apple, banana ), dlist2 = DList( lotus, ferrari, lamborghini )
  281. after: dlist1 = DList( lotus, ferrari, lamborghini, apple, banana ), dlist2 = DList()
  282.  
  283. Output from DList6.class
  284. ----------------------
  285. before: dlist1 = DList( apple, banana ), dlist2 = DList( lotus, ferrari, lamborghini )
  286. after: dlist1 = DList( apple, lotus, ferrari, banana ), dlist2 = DList( lamborghini )
  287.  
  288. Output from DList7.class
  289. ----------------------
  290. dlist = DList( x, l, x, g, s, s )
  291. After dlist.reverse() = DList( s, s, g, x, l, x )
  292. After dlist.remove( x ) = DList( s, s, g, l )
  293. After dlist.unique() = DList( s, g, l )
  294.  
  295. Output from DList8.class
  296. ----------------------
  297. dlist = DList( apple, banana, lotus, ferrari, lamborghini )
  298.  
  299. Output from Deque1.class
  300. ----------------------
  301. Deque( ape, bat, cat )
  302.  
  303. Enumerate the Deque
  304. ape
  305. bat
  306. cat
  307.  
  308. Iterate through the Deque
  309. ape
  310. bat
  311. cat
  312.  
  313. Demonstrate access
  314. deque.at( 0 ) = ape
  315. deque.front() = ape
  316. deque.at( 2 ) = cat
  317. deque.back() = cat
  318.  
  319. Demonstrate modification
  320. Deque( ape, fox, cat )
  321. After popFront() = Deque( fox, cat )
  322. After popBack() = Deque( fox )
  323.  
  324. Output from Deque2.class
  325. ----------------------
  326. Deque( ape, bat, cat, bat, bat, cat )
  327.  
  328. deque.count( bat ) = 3
  329. deque.indexOf( bat ) = 1
  330. After deque.remove( 1 ) = Deque( ape, cat, bat, bat, cat )
  331. After deque.replace( 0, 2, bat, BAT ) = Deque( ape, cat, BAT, bat, cat )
  332. deque.remove( cat ) = 2
  333. After deque.remove( cat ) = Deque( ape, BAT, bat )
  334. After deque.remove( begin() ) = Deque( BAT, bat )
  335.  
  336. Output from Deque3.class
  337. ----------------------
  338. deque = Deque( bat, cat, dog )
  339.  
  340. After insert at begin = Deque( ape, bat, cat, dog )
  341. After insert at end = Deque( ape, bat, cat, dog, emu )
  342. After deque.insert( 3, 2, fox ) = Deque( ape, bat, cat, fox, fox, dog, emu )
  343.  
  344. Output from Deque4.class
  345. ----------------------
  346. Caught jgl.InvalidOperationException: Deque is empty
  347. Caught java.lang.IndexOutOfBoundsException: Attempt to access index 5 when valid range is 0..2
  348.  
  349. Output from Filling1.class
  350. ----------------------
  351. Fill a native array of integers with 42
  352. ( 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 )
  353.  
  354. array = Array( cat, dog, emu, fox )
  355. Fill the array with gnu
  356. array = Array( gnu, gnu, gnu, gnu )
  357. Fill the first 3 elements with bat.
  358. array = Array( bat, bat, bat, gnu )
  359.  
  360. Output from Filtering1.class
  361. ----------------------
  362. strings = ( gnu, emu, emu, fox, fox, fox, gnu )
  363. filtered strings = ( gnu, emu, fox, gnu, fox, fox, gnu )
  364. remaining = 4
  365. filtered array with bounds given = ( gnu, emu, fox )
  366. array = Array( gnu, emu, emu, fox, fox, fox, gnu )
  367. deque = Deque( gnu, emu, fox, gnu )
  368.  
  369. Output from Filtering2.class
  370. ----------------------
  371. array = Array( cat, monkey, lion, armadillo, zebra )
  372. Collecting strings > 5 chars  == Array( monkey, armadillo )
  373. Rejecting strings > 5 chars   == Array( cat, lion, zebra )
  374.  
  375. Output from Finding1.class
  376. ----------------------
  377. iterator found dog at index 1
  378. iterator found dog at index 3
  379. iterator found dog at index 4
  380. First element > 7 is 8 at index 4
  381. First consecutive sequence is of emu at index 2
  382.  
  383. Output from Finding2.class
  384. ----------------------
  385. array = Array( cat, monkey, lion, armadillo, zebra )
  386. Array has SOME string > 5 chars  == true
  387. Array has EVERY string > 5 chars == false
  388. 1st Object in array > 5 chars    == monkey
  389.  
  390. Output from Functions1.class
  391. ----------------------
  392. Number of positive Integers in Array( 3, -2, 3, -5, -4 ) = 2
  393.  
  394. Output from Functions2.class
  395. ----------------------
  396. Number of false in boolean[]( false, false, true, false, true ) = 3
  397.  
  398. Output from Functions3.class
  399. ----------------------
  400. unsorted = Deque( cat, ape, dog, bat )
  401. sorted = Deque( dog, cat, bat, ape )
  402.  
  403. Output from Functions4.class
  404. ----------------------
  405. unsorted = int[]( 3, 1, 5, -2, 7, 9 )
  406. sorted = int[]( -2, 1, 3, 5, 7, 9 )
  407.  
  408. Output from Functions5.class
  409. ----------------------
  410. before = Deque( 4, -2, 3 )
  411. after = Deque( -4, 2, -3 )
  412.  
  413. Output from Functions6.class
  414. ----------------------
  415. The number of strings in DList( dog, ape, emu ) > bat = 2
  416.  
  417. Output from Functions7.class
  418. ----------------------
  419. before = Array( ape, giraffe, lizard )
  420. after = Array( giraffe, lizard, ape )
  421.  
  422. Output from HashMap1.class
  423. ----------------------
  424. HashMap( Pair( 2, two ), Pair( 4, four ) )
  425.  
  426. Enumerate the HashMap
  427. two
  428. four
  429.  
  430. Iterate through the HashMap
  431. Pair( 2, two ), key = 2, value = two
  432. Pair( 4, four ), key = 4, value = four
  433.  
  434. Demonstrate access
  435. map.get( 2 ) = two
  436. map.get( 5 ) = null
  437. map = HashMap( Pair( 2, two ), Pair( 4, four ) )
  438.  
  439. Show that duplicates cannot be added.
  440. Added 8.
  441. map = HashMap( Pair( 2, two ), Pair( 4, four ), Pair( 8, eight ) )
  442. Could not add 4.
  443. map = HashMap( Pair( 2, two ), Pair( 4, four ), Pair( 8, eight ) )
  444.  
  445. Demonstrate modification
  446. map = HashMap( Pair( 2, two ), Pair( 4, FOUR ), Pair( 8, eight ) )
  447.  
  448. Output from HashMap2.class
  449. ----------------------
  450. map = HashMap( Pair( ape, Squeak ), Pair( dog, Woof ), Pair( bat, Squeak ), Pair( cat, Meow ) )
  451. Enumerate the HashMap: Squeak Woof Squeak Meow 
  452. map.keys() = ape dog bat cat 
  453. map.keys( Squeak ) = ape bat 
  454. map.values( bat ) = Squeak 
  455.  
  456. Output from HashMap3.class
  457. ----------------------
  458. HashMap( Pair( ape, Squeak ), Pair( dog, Woof ), Pair( bat, Squeak ), Pair( cat, Meow ) )
  459. map.count( dog ) = 1
  460. Found Pair( dog, Woof )
  461. map.remove( dog ) = Woof
  462. Could not find dog.
  463.  
  464. Output from HashMap4.class
  465. ----------------------
  466. HashMap( Pair( 2, two ), Pair( 4, four ) )
  467.  
  468. Enumerate the HashMap
  469. two
  470. four
  471.  
  472. Iterate through the HashMap
  473. Pair( 2, two ), key = 2, value = two
  474. Pair( 4, four ), key = 4, value = four
  475.  
  476. Show that duplicates can be added.
  477. map = HashMap( Pair( 2, two ), Pair( 4, four ), Pair( 8, eight ) )
  478. map = HashMap( Pair( 2, two ), Pair( 4, four ), Pair( 4, FOUR ), Pair( 8, eight ) )
  479. Show that even with duplicates, put() does a replacement.
  480. map = HashMap( Pair( 2, two ), Pair( 4, FoUr ), Pair( 4, FOUR ), Pair( 8, eight ) )
  481.  
  482. Output from HashMap5.class
  483. ----------------------
  484. map = HashMap( Pair( ape, Squeak ), Pair( ape, Whoop ), Pair( bat, Squeak ), Pair( cat, Meow ) )
  485.  
  486. Enumerate the HashMap
  487. Squeak
  488. Whoop
  489. Squeak
  490. Meow
  491.  
  492. map.keys() = ape ape bat cat 
  493. map.keys( Squeak ) = ape bat 
  494. map.keys( ape ) = Squeak Whoop 
  495.  
  496. Output from HashMap6.class
  497. ----------------------
  498. HashMap( Pair( ape, Squeak ), Pair( ape, Whoop ), Pair( bat, Squeak ), Pair( cat, Meow ) )
  499. map.count( ape ) = 2
  500. Found Pair( ape, Squeak )
  501. Found Pair( ape, Whoop )
  502. map.remove( ape ) = Squeak
  503. Could not find ape.
  504.  
  505. Output from HashMap7.class
  506. ----------------------
  507. HashMap( Pair( 2, two ), Pair( 3, three ), Pair( 3, THREE ), Pair( 8, eight ) )
  508. match @ Pair( 3, three )
  509. match @ Pair( 3, THREE )
  510.  
  511. Output from HashSet1.class
  512. ----------------------
  513. HashSet( 1, 4, 6 )
  514.  
  515. Enumerate the HashSet
  516. 1
  517. 4
  518. 6
  519.  
  520. Iterate through the HashSet
  521. 1
  522. 4
  523. 6
  524.  
  525. Show that duplicates cannot be added.
  526. Added 8
  527. New contents are HashSet( 1, 4, 6, 8 )
  528. Could not add 4.
  529.  
  530. Output from HashSet2.class
  531. ----------------------
  532. set1 = HashSet( ape, bat, cat ), set2 = HashSet( ape, bat, fox )
  533. set3 = set1.union( set2 ) = HashSet( ape, bat, fox, cat )
  534. set4 = set1.intersection( set2 ) = HashSet( ape, bat )
  535. set5 = set1.difference( set2 ) = HashSet( cat )
  536. set6 = set1.symmetricDifference( set2 ) = HashSet( fox, cat )
  537. set4.subsetOf( set3 ) = true
  538. set3.subsetOf( set4 ) = false
  539.  
  540. Output from HashSet3.class
  541. ----------------------
  542. HashSet( ape, dog, bat, cat )
  543. set.count( dog ) = 1
  544. Found dog
  545. set.remove( dog ) = dog
  546. Could not find dog.
  547.  
  548. Output from HashSet4.class
  549. ----------------------
  550. HashSet( 1, 1, 4, 6 )
  551.  
  552. Enumerate the HashSet
  553. 1
  554. 1
  555. 4
  556. 6
  557.  
  558. Iterate through the HashSet
  559. 1
  560. 1
  561. 4
  562. 6
  563.  
  564. Show that duplicates can be added.
  565. set = HashSet( 1, 1, 4, 6, 8 )
  566. set = HashSet( 1, 1, 4, 4, 6, 8 )
  567.  
  568. Output from HashSet5.class
  569. ----------------------
  570. HashSet( ape, dog, dog, bat, cat )
  571. set.count( dog ) = 2
  572. Found dog
  573. set.remove( dog ) = dog
  574. Could not find dog.
  575.  
  576. Output from HashSet6.class
  577. ----------------------
  578. HashSet( 2, 3, 3, 8, 10, -2 )
  579. match @ 3
  580. match @ 3
  581.  
  582. Output from HashSet7.class
  583. ----------------------
  584. HashSet( 1, 1, 4, 6 )
  585.  
  586. Add an object Integer(100)
  587. add returns: null
  588. set = HashSet( 1, 1, 4, 6, 100 )
  589. Try to add the EXACT same object Integer(100)
  590. add returns: 100
  591. set = HashSet( 1, 1, 4, 6, 100 )
  592.  
  593. Output from Heap1.class
  594. ----------------------
  595. fox
  596. emu
  597. dog
  598. cat
  599. bat
  600. ape
  601. unsorted vector = Array( bat, ape, fox, cat, dog, emu )
  602. sorted vector = Array( ape, bat, cat, dog, emu, fox )
  603.  
  604. Output from Iterators1.class
  605. ----------------------
  606. magical
  607. mystery
  608. tour
  609.  
  610. Output from Iterators2.class
  611. ----------------------
  612. before array = Array( magical, mystery, tour )
  613. after array = Array( MAGICAL, MYSTERY, TOUR )
  614. before list = DList( magical, mystery, tour )
  615. after list = DList( MAGICAL, MYSTERY, TOUR )
  616.  
  617. Output from Iterators3.class
  618. ----------------------
  619. array = Array( ape, giraffe, lizard )
  620. lizard
  621. giraffe
  622. ape
  623.  
  624. Output from Iterators4.class
  625. ----------------------
  626. array = Array( 4, 7, 2, 7, 1, 7 )
  627. array = Array( 2, 4, 7, 7, 1, 7 )
  628. array = Array( 2, 4, 7, 0, 1, 0 )
  629.  
  630. Output from Iterators5.class
  631. ----------------------
  632. list = DList( ape, bat, cat, dog )
  633. iterator positioned @ cat
  634. list = DList( ape, bat, dog )
  635.  
  636. Output from Iterators6.class
  637. ----------------------
  638. map = HashMap( Pair( dog, barky ), Pair( fox, paula ), Pair( cat, beauty ), Pair( cat, agatha ) )
  639. pair = Pair( cat, beauty ), key = cat, value = beauty
  640. pair = Pair( cat, agatha ), key = cat, value = agatha
  641.  
  642. Output from Iterators7.class
  643. ----------------------
  644. array = Array( ape, bat, cat, dog )
  645. dog
  646. cat
  647. bat
  648. ape
  649.  
  650. Output from Iterators8.class
  651. ----------------------
  652. array = Array( ape, giraffe, elephant )
  653. deque = Deque( 3, 7, 8 )
  654.  
  655. Output from Iterators9.class
  656. ----------------------
  657. ape bat cat 
  658. ape bat cat 
  659.  
  660. Output from Maps1.class
  661. ----------------------
  662. value from add = null
  663. value from add = null
  664. map = HashMap( Pair( Cat, Beauty ), Pair( Dog, Barky ) )
  665. value from add = Beauty
  666. map = HashMap( Pair( Cat, Beauty ), Pair( Dog, Barky ) )
  667. Cat name is Beauty
  668. Ape name is null
  669. value from put = Beauty
  670. map = HashMap( Pair( Cat, Agatha ), Pair( Dog, Barky ) )
  671. Cat name is Agatha
  672.  
  673. Output from Maps2.class
  674. ----------------------
  675. value from add = null
  676. value from add = null
  677. map = HashMap( Pair( Cat, Beauty ), Pair( Dog, Barky ) )
  678. value from add = null
  679. map = HashMap( Pair( Cat, Beauty ), Pair( Cat, Agatha ), Pair( Dog, Barky ) )
  680. Cat name is Beauty
  681. Ape name is null
  682. value from put = Beauty
  683. map = HashMap( Pair( Cat, Agatha ), Pair( Cat, Agatha ), Pair( Dog, Barky ) )
  684. Cat name is Agatha
  685.  
  686. Output from Maps3.class
  687. ----------------------
  688. map = HashMap( Pair( Cat, Beauty ), Pair( Cat, Agatha ), Pair( Dog, Barky ) )
  689. Enumerator through values...
  690.   Beauty
  691.   Agatha
  692.   Barky
  693. Enumerate through keys...
  694.   Cat
  695.   Cat
  696.   Dog
  697.  
  698. Output from Maps4.class
  699. ----------------------
  700. map1 = OrderedMap( Pair( 1, one ), Pair( 2, two ), Pair( 3, three ) )
  701. map2 = OrderedMap( Pair( 3, three ), Pair( 2, two ), Pair( 1, one ) )
  702.  
  703. Output from Maps5.class
  704. ----------------------
  705. map = OrderedMap( Pair( 5, V ), Pair( 5, five ), Pair( 10, X ), Pair( 10, ten ) )
  706. There are 2 key-value pairs with key 10
  707. Removing all occurrences of 10...
  708. There are now 0 key-value pairs with key 10
  709. map = OrderedMap( Pair( 5, V ), Pair( 5, five ) )
  710.  
  711. Output from Maps6.class
  712. ----------------------
  713. Using equals() to compare elements...
  714. map1.add( i1, two ) = null
  715. map1.add( i1, two ) = two
  716. map1.add( i2, TWO ) = two
  717. map1.get( i1 ) = two
  718. map1.get( i2 ) = two
  719. Using == to compare elements...
  720. map2.add( i1, two ) = null
  721. map2.add( i1, two ) = two
  722. map2.add( i2, TWO ) = null
  723. map2.get( i1 ) = two
  724. map2.get( i2 ) = TWO
  725.  
  726. Output from Maps7.class
  727. ----------------------
  728. map = HashMap( Pair( CAT, Agatha ), Pair( DOG, Misty ) )
  729.  
  730. Output from MinMax1.class
  731. ----------------------
  732. array = Array( cat, ape, bat )
  733. min = ape at index 1
  734. intArray = ( 3, 2, 7, 8, 1, 6 )
  735. max = 8 at index 3
  736.  
  737. Output from OrderedMap1.class
  738. ----------------------
  739. OrderedMap( Pair( 2, two ), Pair( 4, four ) )
  740.  
  741. Enumerate the OrderedMap
  742. two
  743. four
  744.  
  745. Iterate through the OrderedMap
  746. Pair( 2, two ), key = 2, value = two
  747. Pair( 4, four ), key = 4, value = four
  748.  
  749. Demonstrate access
  750. map.at( 2 ) = two
  751. map.at( 5 ) = null
  752. map = OrderedMap( Pair( 2, two ), Pair( 4, four ) )
  753.  
  754. Show that duplicates cannot be added.
  755. Added 8.
  756. map = OrderedMap( Pair( 2, two ), Pair( 4, four ), Pair( 8, eight ) )
  757. Could not add 4.
  758. map = OrderedMap( Pair( 2, two ), Pair( 4, four ), Pair( 8, eight ) )
  759.  
  760. Demonstrate modification
  761. map = OrderedMap( Pair( 2, two ), Pair( 4, FOUR ), Pair( 8, eight ) )
  762.  
  763. Output from OrderedMap2.class
  764. ----------------------
  765. OrderedMap( Pair( ape, Squeak ), Pair( bat, Squeak ), Pair( cat, Meow ), Pair( dog, Woof ) )
  766.  
  767. Enumerate the OrderedMap
  768. Squeak
  769. Squeak
  770. Meow
  771. Woof
  772.  
  773. map.keys() = ape bat cat dog 
  774. map.keys( Squeak ) = ape bat 
  775. map.values( bat ) = Squeak 
  776.  
  777. Output from OrderedMap3.class
  778. ----------------------
  779. OrderedMap( Pair( ape, Squeak ), Pair( bat, Squeak ), Pair( cat, Meow ), Pair( dog, Woof ) )
  780. map.count( dog ) = 1
  781. Found Pair( dog, Woof )
  782. map.remove( dog ) = Woof
  783. Could not find dog.
  784.  
  785. Output from OrderedMap4.class
  786. ----------------------
  787. OrderedMap( Pair( 2, two ), Pair( 3, three ), Pair( 8, eight ), Pair( 10, ten ) )
  788. First pair whose key is not before 3 = Pair( 3, three )
  789. First pair whose key is after 3 = Pair( 8, eight )
  790.  
  791. Output from OrderedMap5.class
  792. ----------------------
  793. OrderedMap( Pair( 2, two ), Pair( 4, four ) )
  794.  
  795. Enumerate the OrderedMap
  796. two
  797. four
  798.  
  799. Iterate through the OrderedMap
  800. Pair( 2, two ), key = 2, value = two
  801. Pair( 4, four ), key = 4, value = four
  802.  
  803. Show that duplicates can be added.
  804. map = OrderedMap( Pair( 2, two ), Pair( 4, four ), Pair( 8, eight ) )
  805. map = OrderedMap( Pair( 2, two ), Pair( 4, four ), Pair( 4, FOUR ), Pair( 8, eight ) )
  806.  
  807. Output from OrderedMap6.class
  808. ----------------------
  809. map = OrderedMap( Pair( ape, Squeak ), Pair( ape, Whoop ), Pair( bat, Squeak ), Pair( cat, Meow ) )
  810. Enumerate the OrderedMap
  811. Squeak
  812. Whoop
  813. Squeak
  814. Meow
  815.  
  816. map.keys() = ape ape bat cat 
  817. map.keys( Squeak ) = ape bat 
  818. map.values( ape ) = Squeak Whoop 
  819.  
  820. Output from OrderedMap7.class
  821. ----------------------
  822. OrderedMap( Pair( ape, Squeak ), Pair( ape, Whoop ), Pair( bat, Squeak ), Pair( cat, Meow ) )
  823. map.count( ape ) = 2
  824. Found Pair( ape, Squeak )
  825. Found Pair( ape, Whoop )
  826. map.remove( ape ) = Squeak
  827. Could not find ape.
  828.  
  829. Output from OrderedMap8.class
  830. ----------------------
  831. OrderedMap( Pair( 2, two ), Pair( 3, three ), Pair( 8, eight ), Pair( 10, ten ) )
  832. First pair whose key is not before 3 = Pair( 3, three )
  833. First pair whose key is after 3 = Pair( 8, eight )
  834. first of equalRange = Pair( 3, three )
  835. second of equalRange = Pair( 8, eight )
  836. Iterating values in the range...
  837. Pair( 3, three )
  838.  
  839. Output from OrderedSet1.class
  840. ----------------------
  841. OrderedSet( 1, 4, 6 )
  842.  
  843. Enumerate the OrderedSet
  844. 1
  845. 4
  846. 6
  847.  
  848. Iterate through the OrderedSet
  849. 1
  850. 4
  851. 6
  852.  
  853. Show that duplicates cannot be added.
  854. Added 8.
  855. New contents are OrderedSet( 1, 4, 6, 8 )
  856. Could not add 4.
  857.  
  858. Output from OrderedSet2.class
  859. ----------------------
  860. OrderedSet( ape, bat, cat, dog )
  861.  
  862. Output from OrderedSet3.class
  863. ----------------------
  864. set1 = OrderedSet( ape, bat, cat ), set2 = OrderedSet( ape, bat, fox )
  865. set3 = set1.union( set2 ) = OrderedSet( ape, bat, cat, fox )
  866. set4 = set1.intersection( set2 ) = OrderedSet( ape, bat )
  867. set5 = set1.difference( set2 ) = OrderedSet( cat )
  868. set6 = set1.symmetricDifference( set2 ) = OrderedSet( cat, fox )
  869. set4.subsetOf( set3 ) = true
  870. set3.subsetOf( set4 ) = false
  871.  
  872. Output from OrderedSet4.class
  873. ----------------------
  874. OrderedSet( ape, bat, cat, dog )
  875. set.count( dog ) = 1
  876. Found dog
  877. set.remove( dog ) = dog
  878. Could not find dog.
  879.  
  880. Output from OrderedSet5.class
  881. ----------------------
  882. OrderedSet( -2, 2, 3, 8, 10 )
  883. First element that is not before 3 = 3
  884. First element that is after 3 = 8
  885.  
  886. Output from OrderedSet6.class
  887. ----------------------
  888. OrderedSet( 1, 1, 4, 6 )
  889.  
  890. Enumerate the OrderedSet
  891. 1
  892. 1
  893. 4
  894. 6
  895.  
  896. Iterate through the OrderedSet
  897. 1
  898. 1
  899. 4
  900. 6
  901.  
  902. Show that duplicates can be added.
  903. set = OrderedSet( 1, 1, 4, 6, 8 )
  904. set = OrderedSet( 1, 1, 4, 4, 6, 8 )
  905.  
  906. Output from OrderedSet7.class
  907. ----------------------
  908. OrderedSet( ape, bat, bat, bat, cat, cat, dog )
  909.  
  910. Output from OrderedSet8.class
  911. ----------------------
  912. OrderedSet( ape, bat, cat, dog, dog )
  913. set.count( dog ) = 2
  914. Found dog
  915. set.remove( dog ) = dog
  916. Could not find dog.
  917.  
  918. Output from OrderedSet9.class
  919. ----------------------
  920. OrderedSet( -2, 2, 3, 3, 8, 10 )
  921. First element that is not before 3 = 3
  922. First element that is after 3 = 8
  923. equalRange.first = 3
  924. equalRange.second = 8
  925. Iterating values in the range...
  926. 3
  927. 3
  928.  
  929. Output from OrderedSetOperations1.class
  930. ----------------------
  931. set1 = OrderedSet( ape, bat, dog ), set2 = OrderedSet( ape, dog, fox )
  932. union = OrderedSet( ape, bat, dog, fox )
  933. union = OrderedSet( ape, bat, dog, fox )
  934. intersection = OrderedSet( ape, dog )
  935. intersection = OrderedSet( ape, dog )
  936. difference = Array( bat )
  937. symmetric difference = Array( bat, fox )
  938. includes1 = false
  939. includes2 = true
  940.  
  941. Output from Overview1.class
  942. ----------------------
  943. chemicals = HashMap( Pair( Au, Gold ), Pair( He, Helium ), Pair( Ca, Calcium ) )
  944. Au means Gold
  945.  
  946. Output from Overview10.class
  947. ----------------------
  948. show
  949. good
  950. jolly
  951.  
  952. Output from Overview2.class
  953. ----------------------
  954. set1 = HashSet( blue, green, red )
  955. set2 = HashSet( blue, yellow )
  956. union of set1 and set2 = HashSet( blue, green, red, yellow )
  957. intersection of set1 and set2 = HashSet( blue )
  958.  
  959. Output from Overview3.class
  960. ----------------------
  961. nemesis
  962. dig
  963. myst
  964.  
  965. agatha
  966. beauty
  967. truth
  968.  
  969. Output from Overview4.class
  970. ----------------------
  971. Unsorted Array = Array( 3, -1, 2 )
  972. Sorted = Array( -1, 2, 3 )
  973.  
  974. Output from Overview5.class
  975. ----------------------
  976. Unsorted java.util.Vector = [3, -1, 2]
  977. Sorted = [-1, 2, 3]
  978.  
  979. Output from Overview6.class
  980. ----------------------
  981. Unsorted native int array = int[]( 3, -1, 2 )
  982. Sorted native array = -1 2 3 
  983.  
  984. Output from Overview7.class
  985. ----------------------
  986. Original deque = Deque( your, mission, jim )
  987. Shuffled deque = Deque( your, mission, jim )
  988.  
  989. Output from Overview8.class
  990. ----------------------
  991. Unsorted Array = Array( 3, -1, 2 )
  992. Sorted = Array( 3, 2, -1 )
  993.  
  994. Output from Overview9.class
  995. ----------------------
  996. # of positive numbers in Array( 3, -1, 2 ) = 2
  997. Array without positive numbers = Array( -1 )
  998.  
  999. Output from Permuting1.class
  1000. ----------------------
  1001. array = Array( 0, 2, 5 )
  1002. array = Array( 0, 5, 2 )
  1003. array = Array( 2, 0, 5 )
  1004. array = Array( 2, 5, 0 )
  1005. array = Array( 5, 0, 2 )
  1006. array = Array( 5, 2, 0 )
  1007. Object[]( gnu, emu, dog )
  1008. Object[]( gnu, dog, emu )
  1009. Object[]( emu, gnu, dog )
  1010. Object[]( emu, dog, gnu )
  1011. Object[]( dog, gnu, emu )
  1012. Object[]( dog, emu, gnu )
  1013.  
  1014. Output from Printing1.class
  1015. ----------------------
  1016. strings = ( gnu, emu, dog )
  1017. strings = ( gnu, emu, dog )
  1018. ints = ( 3, 4, 7 )
  1019. ints = ( 3, 4, 7 )
  1020.  
  1021. Output from PriorityQueue1.class
  1022. ----------------------
  1023. Print the PriorityQueue.
  1024. PriorityQueue( Array( 20, 10, 5, -2, 6, -10 ) )
  1025.  
  1026. Non-destructively enumerate the PriorityQueue.
  1027. 20
  1028. 10
  1029. 5
  1030. -2
  1031. 6
  1032. -10
  1033.  
  1034. Pop and print each element.
  1035. 20
  1036. 10
  1037. 6
  1038. 5
  1039. -2
  1040. -10
  1041.  
  1042. Output from Queue1.class
  1043. ----------------------
  1044. Print the Queue.
  1045. Queue( SList( bat, cat, dog ) )
  1046.  
  1047. Non-destructively enumerate the Queue.
  1048. bat
  1049. cat
  1050. dog
  1051.  
  1052. Pop and print each element.
  1053. bat
  1054. cat
  1055. dog
  1056.  
  1057. Output from Queue2.class
  1058. ----------------------
  1059. Print the queue.
  1060. Queue( DList( bat, cat, dog ) )
  1061.  
  1062. Output from Removing1.class
  1063. ----------------------
  1064. Before = Array( ape, cat, dog, cat, emu )
  1065. After = Array( ape, dog, emu, cat, emu )
  1066. deque = Deque( 3, 8, 4, 10 ), result = DList( 8, 10 )
  1067.  
  1068. Output from Replacing1.class
  1069. ----------------------
  1070. Before: ( 3, 6, 2, 1, 9, 6, 4, 2 )
  1071. After: ( 3, 0, 2, 1, 9, 0, 4, 2 )
  1072. array = Array( ape, cat, bat, cat ), deque = Deque( ape, emu, bat, emu )
  1073.  
  1074. Output from Reversing1.class
  1075. ----------------------
  1076. array = Array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 )
  1077. after reverse = Array( 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 )
  1078. primitive array = int[]( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 )
  1079. Array of reversed array = Array( 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 )
  1080.  
  1081. Output from Rotating1.class
  1082. ----------------------
  1083. Rotate around index 0, Array( 0, 1, 2, 3, 4 ) -> Array( 0, 1, 2, 3, 4 )
  1084. Rotate around index 1, Array( 0, 1, 2, 3, 4 ) -> Array( 1, 2, 3, 4, 0 )
  1085. Rotate around index 2, Array( 0, 1, 2, 3, 4 ) -> Array( 2, 3, 4, 0, 1 )
  1086. Rotate around index 3, Array( 0, 1, 2, 3, 4 ) -> Array( 3, 4, 0, 1, 2 )
  1087. Rotate around index 4, Array( 0, 1, 2, 3, 4 ) -> Array( 4, 0, 1, 2, 3 )
  1088. Rotate around index 2, Array( 0, 1, 2, 3, 4 ) -> Deque( 1, 2, 3, 4, 0 )
  1089.  
  1090. Output from SList1.class
  1091. ----------------------
  1092. SList( ape, bat, cat )
  1093.  
  1094. Enumerate the SList
  1095. ape
  1096. bat
  1097. cat
  1098.  
  1099. Iterate through the SList
  1100. ape
  1101. bat
  1102. cat
  1103.  
  1104. Demonstrate access
  1105. list.at( 0 ) = ape
  1106. list.front() = ape
  1107. list.at( 2 ) = cat
  1108. list.back() = cat
  1109.  
  1110. Demonstrate modification
  1111. SList( ape, fox, cat )
  1112. popFront() returns: ape
  1113. After popFront() = SList( fox, cat )
  1114. popBack() returns: cat
  1115. After popBack() = SList( fox )
  1116.  
  1117. Output from SList2.class
  1118. ----------------------
  1119. SList( ape, bat, cat, bat, bat, cat )
  1120.  
  1121. list.count( bat ) = 3
  1122. object at list.find( bat ) = bat
  1123. After list.remove( iterator ) = SList( ape, cat, bat, bat, cat )
  1124. After list.replace( start, finish, bat, BAT ) = SList( ape, cat, BAT, bat, cat )
  1125. list.remove( cat ) = 2
  1126. After list.remove( cat ) = SList( ape, BAT, bat )
  1127. After list.remove( begin() ) = SList( BAT, bat )
  1128.  
  1129. Output from SList3.class
  1130. ----------------------
  1131. list = SList( bat, cat, dog )
  1132.  
  1133. After insert at begin = SList( ape, bat, cat, dog )
  1134. After insert at end = SList( ape, bat, cat, dog, emu )
  1135. After list.insert( i, 2, fox ) = SList( ape, bat, cat, fox, fox, dog, emu )
  1136.  
  1137. Output from SList4.class
  1138. ----------------------
  1139. Caught jgl.InvalidOperationException: SList is empty
  1140. Caught java.lang.IndexOutOfBoundsException: Attempt to access index 5 when valid range is 0..2
  1141.  
  1142. Output from SList5.class
  1143. ----------------------
  1144. before: list1 = SList( apple, banana ), list2 = SList( lotus, ferrari, lamborghini )
  1145. after: list1 = SList( lotus, ferrari, lamborghini, apple, banana ), list2 = SList()
  1146.  
  1147. Output from SList6.class
  1148. ----------------------
  1149. before: list1 = SList( apple, banana ), list2 = SList( lotus, ferrari, lamborghini )
  1150. after: list1 = SList( apple, lotus, ferrari, banana ), list2 = SList( lamborghini )
  1151.  
  1152. Output from SList7.class
  1153. ----------------------
  1154. list = SList( x, l, x, g, s, s )
  1155. After list.remove( x ) = SList( l, g, s, s )
  1156.  
  1157. Output from Sequences1.class
  1158. ----------------------
  1159. array = Array( ape, bat, cat )
  1160.  
  1161. Demonstrate access
  1162. array.at( 0 ) = ape
  1163. array.front() = ape
  1164. array.at( 2 ) = cat
  1165. array.back() = cat
  1166. array.put( 1, "fox" )
  1167. array = Array( ape, fox, cat )
  1168. After popFront() = Array( fox, cat )
  1169. After popBack() = Array( fox )
  1170.  
  1171. Output from Sequences2.class
  1172. ----------------------
  1173. deque = Deque( ape, bat, cat, bat, bat, cat )
  1174. deque.count( bat ) = 3
  1175. deque.indexOf( bat ) = 1
  1176. After deque.remove( 1 ) = Deque( ape, cat, bat, bat, cat )
  1177. After deque.replace( 0, 2, bat, BAT ) = Deque( ape, cat, BAT, bat, cat )
  1178. deque.remove( cat ) = 2
  1179. After deque.remove( cat ) = Deque( ape, BAT, bat )
  1180.  
  1181. Output from Sequences3.class
  1182. ----------------------
  1183. list = DList( bat, cat, dog )
  1184. After insert at begin = DList( ape, bat, cat, dog )
  1185. After insert at end = DList( ape, bat, cat, dog, emu )
  1186. After list.insert( 3, 2, fox ) = DList( ape, bat, cat, fox, fox, dog, emu )
  1187.  
  1188. Output from Sequences4.class
  1189. ----------------------
  1190. array = Array(), size = 0, capacity = 10
  1191. array = Array( x, x, x, x, x, x, x, x, x ), size = 9, capacity = 10
  1192. array = Array( x, x, x, x, x, x, x, x, x, x ), size = 10, capacity = 10
  1193. array = Array( x, x, x, x, x, x, x, x, x, x, x ), size = 11, capacity = 20
  1194. array = Array( x, x, x, x, x, x, x, x, x, x, x ), size = 11, capacity = 1000
  1195. array = Array( x, x, x, x, x, x, x, x, x, x, x ), size = 11, capacity = 11
  1196.  
  1197. Output from Sequences5.class
  1198. ----------------------
  1199. array = Array( ape, bat, cat ), size = 3, capacity = 3
  1200. array = Array( ape, bat, CAT )
  1201. Original = ape bat CAT 
  1202. array = Array( ape, bat, CAT, dog ), size = 4, capacity = 6
  1203. Original = ape bat CAT 
  1204. ape bat CAT dog 
  1205.  
  1206. Output from Sequences6.class
  1207. ----------------------
  1208. slist1 = SList( D, B ), slist2 = SList( E, A, C )
  1209. slist1 = SList( E, A, C, D, B ), slist2 = SList()
  1210. slist1 = SList( A, C, D, B, E ), slist2 = SList()
  1211. slist1 = SList( A, B, C, D, E ), slist2 = SList()
  1212.  
  1213. Output from Sequences7.class
  1214. ----------------------
  1215. list = DList( D, C, C, B, A, A )
  1216. list = DList( D, C, B, A )
  1217. list = DList( A, B, C, D )
  1218.  
  1219. Output from SetOperations1.class
  1220. ----------------------
  1221. set1 = OrderedSet( ape, bat, dog ), set2 = OrderedSet( ape, dog, fox )
  1222. union = OrderedSet( ape, bat, dog, fox )
  1223. union = OrderedSet( ape, bat, dog, fox )
  1224. intersection = OrderedSet( ape, dog )
  1225. intersection = OrderedSet( ape, dog )
  1226. difference = Array( bat )
  1227. symmetric difference = Array( bat, fox )
  1228. includes1 = false
  1229. includes2 = true
  1230.  
  1231. Output from Sets1.class
  1232. ----------------------
  1233. value from add = null
  1234. value from add = null
  1235. set = HashSet( Widget( button, 100 ), Widget( menu, 200 ) )
  1236. value from add = Widget( button, 100 )
  1237. set = HashSet( Widget( button, 100 ), Widget( menu, 200 ) )
  1238. value from put = Widget( button, 100 )
  1239. set = HashSet( Widget( button, 300 ), Widget( menu, 200 ) )
  1240.  
  1241. Output from Sets2.class
  1242. ----------------------
  1243. value from add = null
  1244. value from add = null
  1245. set = HashSet( Widget( button, 100 ), Widget( menu, 200 ) )
  1246. value from add = null
  1247. set = HashSet( Widget( button, 100 ), Widget( button, 300 ), Widget( menu, 200 ) )
  1248. value from put = Widget( button, 100 )
  1249. set = HashSet( Widget( button, 300 ), Widget( button, 300 ), Widget( menu, 200 ) )
  1250.  
  1251. Output from Sets3.class
  1252. ----------------------
  1253. set1 = OrderedSet( 1, 2, 3 )
  1254. set2 = OrderedSet( 3, 2, 1 )
  1255.  
  1256. Output from Sets4.class
  1257. ----------------------
  1258. set = OrderedSet( 5, 5, 10, 10 )
  1259. There are 2 objects that match 10
  1260. Removing all occurrences of 10...
  1261. There are now 0 objects that match 10
  1262. set = OrderedSet( 5, 5 )
  1263.  
  1264. Output from Sets5.class
  1265. ----------------------
  1266. Using equals() to compare elements...
  1267. set1.add( i1 ) = null
  1268. set1.add( i1 ) = 2
  1269. set1.add( i2 ) = 2
  1270. set1.get( i1 ) = 2
  1271. set1.get( i2 ) = 2
  1272. Using == to compare elements...
  1273. set2.add( i1 ) = null
  1274. set2.add( i1 ) = 2
  1275. set2.add( i2 ) = null
  1276. set2.get( i1 ) = 2
  1277. set2.get( i2 ) = 2
  1278.  
  1279. Output from Sets6.class
  1280. ----------------------
  1281. set1 = HashSet( ape, bat, cat ), set2 = HashSet( ape, bat, fox )
  1282. set3 = set1.union( set2 ) = HashSet( ape, bat, fox, cat )
  1283. set4 = set1.intersection( set2 ) = HashSet( ape, bat )
  1284. set5 = set1.difference( set2 ) = HashSet( cat )
  1285. set6 = set1.symmetricDifference( set2 ) = HashSet( fox, cat )
  1286. set4.subsetOf( set3 ) = true
  1287. set3.subsetOf( set4 ) = false
  1288.  
  1289. Output from Shuffling1.class
  1290. ----------------------
  1291. array = Array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 )
  1292. after shuffle = Array( 9, 2, 6, 5, 3, 7, 1, 0, 8, 4 )
  1293.  
  1294. Output from Sorting1.class
  1295. ----------------------
  1296. Sort an Array of Integers
  1297. unsorted = Array( 7, 10, 3, -4 )
  1298. ascending = Array( -4, 3, 7, 10 )
  1299. descending = Array( 10, 7, 3, -4 )
  1300.  
  1301. Sort a java.util.Vector of Strings
  1302. unsorted = [cat, ape, fox, bat]
  1303. ascending = [ape, bat, cat, fox]
  1304.  
  1305. Sort a primitive array of ints
  1306. unsorted = int[]( 3, 6, 1, 2, 9, 8, 1, 8 )
  1307. descending = int[]( 9, 8, 8, 6, 3, 2, 1, 1 )
  1308. partially ascending = int[]( 9, 8, 8, 1, 1, 2, 3, 6 )
  1309.  
  1310. Output from Sorting2.class
  1311. ----------------------
  1312. Sort a primitive array of chars
  1313. unsorted = czefgoa
  1314. sorted   = acefgoz
  1315.  
  1316. Output from Stack1.class
  1317. ----------------------
  1318. Print the Stack.
  1319. Stack( Array( bat, cat, dog ) )
  1320.  
  1321. Non-destructively enumerate the Stack.
  1322. bat
  1323. cat
  1324. dog
  1325.  
  1326. Pop and print each element.
  1327. dog
  1328. cat
  1329. bat
  1330.  
  1331. Output from Stack2.class
  1332. ----------------------
  1333. Print the Stack.
  1334. Stack( Array( bat, cat, dog ) )
  1335.  
  1336. Output from Stacks1.class
  1337. ----------------------
  1338. stack = Stack( Array( bat, cat, dog ) )
  1339.  
  1340. Non-destructively enumerate the Stack.
  1341. bat
  1342. cat
  1343. dog
  1344.  
  1345. Pop and print each element.
  1346. dog
  1347. cat
  1348. bat
  1349.  
  1350. Output from Stacks2.class
  1351. ----------------------
  1352. Print the Stack.
  1353. Stack( DList( bat, cat, dog ) )
  1354.  
  1355. Output from Stacks3.class
  1356. ----------------------
  1357. queue = Queue( SList( bat, cat, dog ) )
  1358.  
  1359. Non-destructively enumerate the Queue.
  1360. bat
  1361. cat
  1362. dog
  1363.  
  1364. Pop and print each element.
  1365. bat
  1366. cat
  1367. dog
  1368.  
  1369. Output from Stacks4.class
  1370. ----------------------
  1371. queue = PriorityQueue( Array( 20, 10, 5, -2, 6, -10 ) )
  1372.  
  1373. Non-destructively enumerate the PriorityQueue.
  1374. 20 10 5 -2 6 -10 
  1375. Pop and print each element.
  1376. 20 10 6 5 -2 -10 
  1377.  
  1378. Output from Stacks5.class
  1379. ----------------------
  1380. Pop and print each element.
  1381. ape bat cat dog emu fox 
  1382.  
  1383. Output from Swapping1.class
  1384. ----------------------
  1385. array = Array( cat, dog, emu )
  1386. After swapping first and last elements = Array( emu, dog, cat )
  1387. deque = Deque( pig, hog ), array = Array( emu, dog, cat )
  1388. deque = Deque( emu, dog ), array = Array( pig, hog, cat )
  1389.  
  1390. Output from Transforming1.class
  1391. ----------------------
  1392. before = Deque( 5, 2, -2 )
  1393. doubled = Deque( 10, 4, -4 )
  1394. original = int[]( 3, 4, 1, 2 )
  1395. negated = Array( -3, -4, -1, -2 )
  1396. list1 = DList( ape, dog ), list2 = DList( 1, 2 )
  1397. result = Array( ape1, dog2 )
  1398.  
  1399. Output from Transforming2.class
  1400. ----------------------
  1401. array = Array( cat, barking animal, walking )
  1402. dlist = DList( cat, barking animal, walking )
  1403.  
  1404. collect(array) = Array( 3, 14, 7 )
  1405. collect(dlist) = DList( 3, 14, 7 )
  1406.  
  1407. Output from Vector1.class
  1408. ----------------------
  1409. unsorted = [cat, ape, bat]
  1410. sorted = [ape, bat, cat]