Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

448 linhas
15 KiB

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="en">
  4. <head>
  5. <!-- Generated by javadoc (1.8.0_131) on Mon Jun 05 21:49:33 MST 2017 -->
  6. <title>Handler (LibrarySystem - BinHong Lee)</title>
  7. <meta name="date" content="2017-06-05">
  8. <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
  9. <script type="text/javascript" src="../script.js"></script>
  10. </head>
  11. <body>
  12. <script type="text/javascript"><!--
  13. try {
  14. if (location.href.indexOf('is-external=true') == -1) {
  15. parent.document.title="Handler (LibrarySystem - BinHong Lee)";
  16. }
  17. }
  18. catch(err) {
  19. }
  20. //-->
  21. var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10};
  22. var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
  23. var altColor = "altColor";
  24. var rowColor = "rowColor";
  25. var tableTab = "tableTab";
  26. var activeTableTab = "activeTableTab";
  27. </script>
  28. <noscript>
  29. <div>JavaScript is disabled on your browser.</div>
  30. </noscript>
  31. <!-- ========= START OF TOP NAVBAR ======= -->
  32. <div class="topNav"><a name="navbar.top">
  33. <!-- -->
  34. </a>
  35. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  36. <a name="navbar.top.firstrow">
  37. <!-- -->
  38. </a>
  39. <ul class="navList" title="Navigation">
  40. <li><a href="../libsys/package-summary.html">Package</a></li>
  41. <li class="navBarCell1Rev">Class</li>
  42. <li><a href="package-tree.html">Tree</a></li>
  43. <li><a href="../index-files/index-1.html">Index</a></li>
  44. <li><a href="../help-doc.html">Help</a></li>
  45. </ul>
  46. </div>
  47. <div class="subNav">
  48. <ul class="navList">
  49. <li><a href="../libsys/EditUserDialog.html" title="class in libsys"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  50. <li><a href="../libsys/HandlerTest.html" title="class in libsys"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  51. </ul>
  52. <ul class="navList">
  53. <li><a href="../index.html?libsys/Handler.html" target="_top">Frames</a></li>
  54. <li><a href="Handler.html" target="_top">No&nbsp;Frames</a></li>
  55. </ul>
  56. <ul class="navList" id="allclasses_navbar_top">
  57. <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
  58. </ul>
  59. <div>
  60. <script type="text/javascript"><!--
  61. allClassesLink = document.getElementById("allclasses_navbar_top");
  62. if(window==top) {
  63. allClassesLink.style.display = "block";
  64. }
  65. else {
  66. allClassesLink.style.display = "none";
  67. }
  68. //-->
  69. </script>
  70. </div>
  71. <div>
  72. <ul class="subNavList">
  73. <li>Summary:&nbsp;</li>
  74. <li>Nested&nbsp;|&nbsp;</li>
  75. <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
  76. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  77. <li><a href="#method.summary">Method</a></li>
  78. </ul>
  79. <ul class="subNavList">
  80. <li>Detail:&nbsp;</li>
  81. <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
  82. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  83. <li><a href="#method.detail">Method</a></li>
  84. </ul>
  85. </div>
  86. <a name="skip.navbar.top">
  87. <!-- -->
  88. </a></div>
  89. <!-- ========= END OF TOP NAVBAR ========= -->
  90. <!-- ======== START OF CLASS DATA ======== -->
  91. <div class="header">
  92. <div class="subTitle">libsys</div>
  93. <h2 title="Class Handler" class="title">Class Handler</h2>
  94. </div>
  95. <div class="contentContainer">
  96. <ul class="inheritance">
  97. <li>java.lang.Object</li>
  98. <li>
  99. <ul class="inheritance">
  100. <li>libsys.Handler</li>
  101. </ul>
  102. </li>
  103. </ul>
  104. <div class="description">
  105. <ul class="blockList">
  106. <li class="blockList">
  107. <hr>
  108. <br>
  109. <pre>class <span class="typeNameLabel">Handler</span>
  110. extends java.lang.Object</pre>
  111. <div class="block">Handles all the background operations of MainGUI, also contains both UserFactory and BookFactory</div>
  112. </li>
  113. </ul>
  114. </div>
  115. <div class="summary">
  116. <ul class="blockList">
  117. <li class="blockList">
  118. <!-- =========== FIELD SUMMARY =========== -->
  119. <ul class="blockList">
  120. <li class="blockList"><a name="field.summary">
  121. <!-- -->
  122. </a>
  123. <h3>Field Summary</h3>
  124. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
  125. <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
  126. <tr>
  127. <th class="colFirst" scope="col">Modifier and Type</th>
  128. <th class="colLast" scope="col">Field and Description</th>
  129. </tr>
  130. <tr class="altColor">
  131. <td class="colFirst"><code>(package private) <a href="../libsys/BookFactory.html" title="class in libsys">BookFactory</a></code></td>
  132. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/Handler.html#books">books</a></span></code>&nbsp;</td>
  133. </tr>
  134. <tr class="rowColor">
  135. <td class="colFirst"><code>private java.util.Calendar</code></td>
  136. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/Handler.html#cal">cal</a></span></code>&nbsp;</td>
  137. </tr>
  138. <tr class="altColor">
  139. <td class="colFirst"><code>(package private) <a href="../libsys/UserFactory.html" title="class in libsys">UserFactory</a></code></td>
  140. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/Handler.html#users">users</a></span></code>&nbsp;</td>
  141. </tr>
  142. </table>
  143. </li>
  144. </ul>
  145. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  146. <ul class="blockList">
  147. <li class="blockList"><a name="constructor.summary">
  148. <!-- -->
  149. </a>
  150. <h3>Constructor Summary</h3>
  151. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  152. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  153. <tr>
  154. <th class="colOne" scope="col">Constructor and Description</th>
  155. </tr>
  156. <tr class="altColor">
  157. <td class="colOne"><code><span class="memberNameLink"><a href="../libsys/Handler.html#Handler--">Handler</a></span>()</code>
  158. <div class="block">Creates new empty Handler</div>
  159. </td>
  160. </tr>
  161. </table>
  162. </li>
  163. </ul>
  164. <!-- ========== METHOD SUMMARY =========== -->
  165. <ul class="blockList">
  166. <li class="blockList"><a name="method.summary">
  167. <!-- -->
  168. </a>
  169. <h3>Method Summary</h3>
  170. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  171. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
  172. <tr>
  173. <th class="colFirst" scope="col">Modifier and Type</th>
  174. <th class="colLast" scope="col">Method and Description</th>
  175. </tr>
  176. <tr id="i0" class="altColor">
  177. <td class="colFirst"><code>(package private) java.lang.String</code></td>
  178. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/Handler.html#bookIdsToTitlesString-int:A-">bookIdsToTitlesString</a></span>(int[]&nbsp;bookIDs)</code>
  179. <div class="block">Create a String of all book titles with the given Book ids</div>
  180. </td>
  181. </tr>
  182. <tr id="i1" class="rowColor">
  183. <td class="colFirst"><code>(package private) boolean</code></td>
  184. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/Handler.html#borrowBook-libsys.User-libsys.Book-">borrowBook</a></span>(<a href="../libsys/User.html" title="class in libsys">User</a>&nbsp;user,
  185. <a href="../libsys/Book.html" title="class in libsys">Book</a>&nbsp;book)</code>
  186. <div class="block">Given User borrows the given Book</div>
  187. </td>
  188. </tr>
  189. <tr id="i2" class="altColor">
  190. <td class="colFirst"><code>private int[]</code></td>
  191. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/Handler.html#calDueDate-int-">calDueDate</a></span>(int&nbsp;days)</code>
  192. <div class="block">Calculating the due date</div>
  193. </td>
  194. </tr>
  195. <tr id="i3" class="rowColor">
  196. <td class="colFirst"><code>(package private) int[]</code></td>
  197. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/Handler.html#calDueDate-int-int:A-">calDueDate</a></span>(int&nbsp;days,
  198. int[]&nbsp;date)</code>&nbsp;</td>
  199. </tr>
  200. <tr id="i4" class="altColor">
  201. <td class="colFirst"><code>private int[]</code></td>
  202. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/Handler.html#currentDay--">currentDay</a></span>()</code>
  203. <div class="block">Returns the current date in an int array</div>
  204. </td>
  205. </tr>
  206. <tr id="i5" class="rowColor">
  207. <td class="colFirst"><code>(package private) boolean</code></td>
  208. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/Handler.html#returnBook-libsys.User-libsys.Book-">returnBook</a></span>(<a href="../libsys/User.html" title="class in libsys">User</a>&nbsp;user,
  209. <a href="../libsys/Book.html" title="class in libsys">Book</a>&nbsp;book)</code>
  210. <div class="block">Given User returns the given Book</div>
  211. </td>
  212. </tr>
  213. </table>
  214. <ul class="blockList">
  215. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  216. <!-- -->
  217. </a>
  218. <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
  219. <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
  220. </ul>
  221. </li>
  222. </ul>
  223. </li>
  224. </ul>
  225. </div>
  226. <div class="details">
  227. <ul class="blockList">
  228. <li class="blockList">
  229. <!-- ============ FIELD DETAIL =========== -->
  230. <ul class="blockList">
  231. <li class="blockList"><a name="field.detail">
  232. <!-- -->
  233. </a>
  234. <h3>Field Detail</h3>
  235. <a name="books">
  236. <!-- -->
  237. </a>
  238. <ul class="blockList">
  239. <li class="blockList">
  240. <h4>books</h4>
  241. <pre><a href="../libsys/BookFactory.html" title="class in libsys">BookFactory</a> books</pre>
  242. </li>
  243. </ul>
  244. <a name="cal">
  245. <!-- -->
  246. </a>
  247. <ul class="blockList">
  248. <li class="blockList">
  249. <h4>cal</h4>
  250. <pre>private&nbsp;java.util.Calendar cal</pre>
  251. </li>
  252. </ul>
  253. <a name="users">
  254. <!-- -->
  255. </a>
  256. <ul class="blockListLast">
  257. <li class="blockList">
  258. <h4>users</h4>
  259. <pre><a href="../libsys/UserFactory.html" title="class in libsys">UserFactory</a> users</pre>
  260. </li>
  261. </ul>
  262. </li>
  263. </ul>
  264. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  265. <ul class="blockList">
  266. <li class="blockList"><a name="constructor.detail">
  267. <!-- -->
  268. </a>
  269. <h3>Constructor Detail</h3>
  270. <a name="Handler--">
  271. <!-- -->
  272. </a>
  273. <ul class="blockListLast">
  274. <li class="blockList">
  275. <h4>Handler</h4>
  276. <pre>public&nbsp;Handler()</pre>
  277. <div class="block">Creates new empty Handler</div>
  278. </li>
  279. </ul>
  280. </li>
  281. </ul>
  282. <!-- ============ METHOD DETAIL ========== -->
  283. <ul class="blockList">
  284. <li class="blockList"><a name="method.detail">
  285. <!-- -->
  286. </a>
  287. <h3>Method Detail</h3>
  288. <a name="bookIdsToTitlesString-int:A-">
  289. <!-- -->
  290. </a>
  291. <ul class="blockList">
  292. <li class="blockList">
  293. <h4>bookIdsToTitlesString</h4>
  294. <pre>java.lang.String&nbsp;bookIdsToTitlesString(int[]&nbsp;bookIDs)</pre>
  295. <div class="block">Create a String of all book titles with the given Book ids</div>
  296. <dl>
  297. <dt><span class="paramLabel">Parameters:</span></dt>
  298. <dd><code>bookIDs</code> - Array of Book ids</dd>
  299. <dt><span class="returnLabel">Returns:</span></dt>
  300. <dd>String of book titles separated with "; "</dd>
  301. </dl>
  302. </li>
  303. </ul>
  304. <a name="borrowBook-libsys.User-libsys.Book-">
  305. <!-- -->
  306. </a>
  307. <ul class="blockList">
  308. <li class="blockList">
  309. <h4>borrowBook</h4>
  310. <pre>boolean&nbsp;borrowBook(<a href="../libsys/User.html" title="class in libsys">User</a>&nbsp;user,
  311. <a href="../libsys/Book.html" title="class in libsys">Book</a>&nbsp;book)</pre>
  312. <div class="block">Given User borrows the given Book</div>
  313. <dl>
  314. <dt><span class="paramLabel">Parameters:</span></dt>
  315. <dd><code>user</code> - User borrowing the Book</dd>
  316. <dd><code>book</code> - Book to be borrowed</dd>
  317. <dt><span class="returnLabel">Returns:</span></dt>
  318. <dd>If the borrow operation is successful</dd>
  319. </dl>
  320. </li>
  321. </ul>
  322. <a name="calDueDate-int-">
  323. <!-- -->
  324. </a>
  325. <ul class="blockList">
  326. <li class="blockList">
  327. <h4>calDueDate</h4>
  328. <pre>private&nbsp;int[]&nbsp;calDueDate(int&nbsp;days)</pre>
  329. <div class="block">Calculating the due date</div>
  330. <dl>
  331. <dt><span class="paramLabel">Parameters:</span></dt>
  332. <dd><code>days</code> - Amount of days to be borrowed</dd>
  333. <dt><span class="returnLabel">Returns:</span></dt>
  334. <dd>Amount of days added to the current day</dd>
  335. </dl>
  336. </li>
  337. </ul>
  338. <a name="calDueDate-int-int:A-">
  339. <!-- -->
  340. </a>
  341. <ul class="blockList">
  342. <li class="blockList">
  343. <h4>calDueDate</h4>
  344. <pre>int[]&nbsp;calDueDate(int&nbsp;days,
  345. int[]&nbsp;date)</pre>
  346. </li>
  347. </ul>
  348. <a name="currentDay--">
  349. <!-- -->
  350. </a>
  351. <ul class="blockList">
  352. <li class="blockList">
  353. <h4>currentDay</h4>
  354. <pre>private&nbsp;int[]&nbsp;currentDay()</pre>
  355. <div class="block">Returns the current date in an int array</div>
  356. <dl>
  357. <dt><span class="returnLabel">Returns:</span></dt>
  358. <dd>date in ([YYYY][MM][DD]) format</dd>
  359. </dl>
  360. </li>
  361. </ul>
  362. <a name="returnBook-libsys.User-libsys.Book-">
  363. <!-- -->
  364. </a>
  365. <ul class="blockListLast">
  366. <li class="blockList">
  367. <h4>returnBook</h4>
  368. <pre>boolean&nbsp;returnBook(<a href="../libsys/User.html" title="class in libsys">User</a>&nbsp;user,
  369. <a href="../libsys/Book.html" title="class in libsys">Book</a>&nbsp;book)</pre>
  370. <div class="block">Given User returns the given Book</div>
  371. <dl>
  372. <dt><span class="paramLabel">Parameters:</span></dt>
  373. <dd><code>user</code> - User returning the Book</dd>
  374. <dd><code>book</code> - Book to be returned</dd>
  375. <dt><span class="returnLabel">Returns:</span></dt>
  376. <dd>If the return operation is successful</dd>
  377. </dl>
  378. </li>
  379. </ul>
  380. </li>
  381. </ul>
  382. </li>
  383. </ul>
  384. </div>
  385. </div>
  386. <!-- ========= END OF CLASS DATA ========= -->
  387. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  388. <div class="bottomNav"><a name="navbar.bottom">
  389. <!-- -->
  390. </a>
  391. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  392. <a name="navbar.bottom.firstrow">
  393. <!-- -->
  394. </a>
  395. <ul class="navList" title="Navigation">
  396. <li><a href="../libsys/package-summary.html">Package</a></li>
  397. <li class="navBarCell1Rev">Class</li>
  398. <li><a href="package-tree.html">Tree</a></li>
  399. <li><a href="../index-files/index-1.html">Index</a></li>
  400. <li><a href="../help-doc.html">Help</a></li>
  401. </ul>
  402. </div>
  403. <div class="subNav">
  404. <ul class="navList">
  405. <li><a href="../libsys/EditUserDialog.html" title="class in libsys"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  406. <li><a href="../libsys/HandlerTest.html" title="class in libsys"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  407. </ul>
  408. <ul class="navList">
  409. <li><a href="../index.html?libsys/Handler.html" target="_top">Frames</a></li>
  410. <li><a href="Handler.html" target="_top">No&nbsp;Frames</a></li>
  411. </ul>
  412. <ul class="navList" id="allclasses_navbar_bottom">
  413. <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
  414. </ul>
  415. <div>
  416. <script type="text/javascript"><!--
  417. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  418. if(window==top) {
  419. allClassesLink.style.display = "block";
  420. }
  421. else {
  422. allClassesLink.style.display = "none";
  423. }
  424. //-->
  425. </script>
  426. </div>
  427. <div>
  428. <ul class="subNavList">
  429. <li>Summary:&nbsp;</li>
  430. <li>Nested&nbsp;|&nbsp;</li>
  431. <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
  432. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  433. <li><a href="#method.summary">Method</a></li>
  434. </ul>
  435. <ul class="subNavList">
  436. <li>Detail:&nbsp;</li>
  437. <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
  438. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  439. <li><a href="#method.detail">Method</a></li>
  440. </ul>
  441. </div>
  442. <a name="skip.navbar.bottom">
  443. <!-- -->
  444. </a></div>
  445. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  446. </body>
  447. </html>