25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

554 satır
17 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:34 MST 2017 -->
  6. <title>User (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="User (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,"i6":10,"i7":10,"i8":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/SettingsTest.html" title="class in libsys"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  50. <li><a href="../libsys/UserFactory.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/User.html" target="_top">Frames</a></li>
  54. <li><a href="User.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 User" class="title">Class User</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.User</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>public class <span class="typeNameLabel">User</span>
  110. extends java.lang.Object</pre>
  111. <div class="block">User object</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>private java.util.List&lt;java.lang.Integer&gt;</code></td>
  132. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#books">books</a></span></code>&nbsp;</td>
  133. </tr>
  134. <tr class="rowColor">
  135. <td class="colFirst"><code>private int</code></td>
  136. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#id">id</a></span></code>&nbsp;</td>
  137. </tr>
  138. <tr class="altColor">
  139. <td class="colFirst"><code>private int</code></td>
  140. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#limit">limit</a></span></code>&nbsp;</td>
  141. </tr>
  142. <tr class="rowColor">
  143. <td class="colFirst"><code>private java.lang.String</code></td>
  144. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#name">name</a></span></code>&nbsp;</td>
  145. </tr>
  146. </table>
  147. </li>
  148. </ul>
  149. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  150. <ul class="blockList">
  151. <li class="blockList"><a name="constructor.summary">
  152. <!-- -->
  153. </a>
  154. <h3>Constructor Summary</h3>
  155. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  156. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  157. <tr>
  158. <th class="colOne" scope="col">Constructor and Description</th>
  159. </tr>
  160. <tr class="altColor">
  161. <td class="colOne"><code><span class="memberNameLink"><a href="../libsys/User.html#User-java.lang.String-int-int-">User</a></span>(java.lang.String&nbsp;name,
  162. int&nbsp;id,
  163. int&nbsp;limit)</code>
  164. <div class="block">Creates a new User with name, id and limit (usually used to add new User)</div>
  165. </td>
  166. </tr>
  167. <tr class="rowColor">
  168. <td class="colOne"><code><span class="memberNameLink"><a href="../libsys/User.html#User-java.lang.String-int-int-java.util.ArrayList-">User</a></span>(java.lang.String&nbsp;name,
  169. int&nbsp;id,
  170. int&nbsp;limit,
  171. java.util.ArrayList&lt;java.lang.Integer&gt;&nbsp;books)</code>
  172. <div class="block">Creates a new User with name, id, limit and books (usually used to initialize from database)</div>
  173. </td>
  174. </tr>
  175. </table>
  176. </li>
  177. </ul>
  178. <!-- ========== METHOD SUMMARY =========== -->
  179. <ul class="blockList">
  180. <li class="blockList"><a name="method.summary">
  181. <!-- -->
  182. </a>
  183. <h3>Method Summary</h3>
  184. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  185. <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>
  186. <tr>
  187. <th class="colFirst" scope="col">Modifier and Type</th>
  188. <th class="colLast" scope="col">Method and Description</th>
  189. </tr>
  190. <tr id="i0" class="altColor">
  191. <td class="colFirst"><code>int[]</code></td>
  192. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#bookStatus--">bookStatus</a></span>()</code>
  193. <div class="block">Get Book ids of the books</div>
  194. </td>
  195. </tr>
  196. <tr id="i1" class="rowColor">
  197. <td class="colFirst"><code>(package private) boolean</code></td>
  198. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#borrowNewBook-int-">borrowNewBook</a></span>(int&nbsp;id)</code>
  199. <div class="block">User borrows a Book</div>
  200. </td>
  201. </tr>
  202. <tr id="i2" class="altColor">
  203. <td class="colFirst"><code>int</code></td>
  204. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#getId--">getId</a></span>()</code>
  205. <div class="block">Gets id of this User</div>
  206. </td>
  207. </tr>
  208. <tr id="i3" class="rowColor">
  209. <td class="colFirst"><code>int</code></td>
  210. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#getLimit--">getLimit</a></span>()</code>
  211. <div class="block">Gets limit of Book this User can borrow</div>
  212. </td>
  213. </tr>
  214. <tr id="i4" class="altColor">
  215. <td class="colFirst"><code>java.lang.String</code></td>
  216. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#getName--">getName</a></span>()</code>
  217. <div class="block">Gets name of this User</div>
  218. </td>
  219. </tr>
  220. <tr id="i5" class="rowColor">
  221. <td class="colFirst"><code>(package private) boolean</code></td>
  222. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#returnBook-int-">returnBook</a></span>(int&nbsp;id)</code>
  223. <div class="block">User returns a Book</div>
  224. </td>
  225. </tr>
  226. <tr id="i6" class="altColor">
  227. <td class="colFirst"><code>void</code></td>
  228. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#setLimit-int-">setLimit</a></span>(int&nbsp;limit)</code>
  229. <div class="block">Change limit of this User</div>
  230. </td>
  231. </tr>
  232. <tr id="i7" class="rowColor">
  233. <td class="colFirst"><code>void</code></td>
  234. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#setName-java.lang.String-">setName</a></span>(java.lang.String&nbsp;name)</code>
  235. <div class="block">Change name of this User</div>
  236. </td>
  237. </tr>
  238. <tr id="i8" class="altColor">
  239. <td class="colFirst"><code>boolean</code></td>
  240. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/User.html#status--">status</a></span>()</code>
  241. <div class="block">Check status of the User</div>
  242. </td>
  243. </tr>
  244. </table>
  245. <ul class="blockList">
  246. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  247. <!-- -->
  248. </a>
  249. <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
  250. <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
  251. </ul>
  252. </li>
  253. </ul>
  254. </li>
  255. </ul>
  256. </div>
  257. <div class="details">
  258. <ul class="blockList">
  259. <li class="blockList">
  260. <!-- ============ FIELD DETAIL =========== -->
  261. <ul class="blockList">
  262. <li class="blockList"><a name="field.detail">
  263. <!-- -->
  264. </a>
  265. <h3>Field Detail</h3>
  266. <a name="books">
  267. <!-- -->
  268. </a>
  269. <ul class="blockList">
  270. <li class="blockList">
  271. <h4>books</h4>
  272. <pre>private&nbsp;java.util.List&lt;java.lang.Integer&gt; books</pre>
  273. </li>
  274. </ul>
  275. <a name="id">
  276. <!-- -->
  277. </a>
  278. <ul class="blockList">
  279. <li class="blockList">
  280. <h4>id</h4>
  281. <pre>private&nbsp;int id</pre>
  282. </li>
  283. </ul>
  284. <a name="limit">
  285. <!-- -->
  286. </a>
  287. <ul class="blockList">
  288. <li class="blockList">
  289. <h4>limit</h4>
  290. <pre>private&nbsp;int limit</pre>
  291. </li>
  292. </ul>
  293. <a name="name">
  294. <!-- -->
  295. </a>
  296. <ul class="blockListLast">
  297. <li class="blockList">
  298. <h4>name</h4>
  299. <pre>private&nbsp;java.lang.String name</pre>
  300. </li>
  301. </ul>
  302. </li>
  303. </ul>
  304. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  305. <ul class="blockList">
  306. <li class="blockList"><a name="constructor.detail">
  307. <!-- -->
  308. </a>
  309. <h3>Constructor Detail</h3>
  310. <a name="User-java.lang.String-int-int-">
  311. <!-- -->
  312. </a>
  313. <ul class="blockList">
  314. <li class="blockList">
  315. <h4>User</h4>
  316. <pre>public&nbsp;User(java.lang.String&nbsp;name,
  317. int&nbsp;id,
  318. int&nbsp;limit)</pre>
  319. <div class="block">Creates a new User with name, id and limit (usually used to add new User)</div>
  320. <dl>
  321. <dt><span class="paramLabel">Parameters:</span></dt>
  322. <dd><code>name</code> - Name of this User</dd>
  323. <dd><code>id</code> - id of this User</dd>
  324. <dd><code>limit</code> - Limit of Book this User can borrow</dd>
  325. </dl>
  326. </li>
  327. </ul>
  328. <a name="User-java.lang.String-int-int-java.util.ArrayList-">
  329. <!-- -->
  330. </a>
  331. <ul class="blockListLast">
  332. <li class="blockList">
  333. <h4>User</h4>
  334. <pre>public&nbsp;User(java.lang.String&nbsp;name,
  335. int&nbsp;id,
  336. int&nbsp;limit,
  337. java.util.ArrayList&lt;java.lang.Integer&gt;&nbsp;books)</pre>
  338. <div class="block">Creates a new User with name, id, limit and books (usually used to initialize from database)</div>
  339. <dl>
  340. <dt><span class="paramLabel">Parameters:</span></dt>
  341. <dd><code>name</code> - Name of this User</dd>
  342. <dd><code>id</code> - id of this User</dd>
  343. <dd><code>limit</code> - Limit of Book this User can borrow</dd>
  344. <dd><code>books</code> - ArrayList of Book ids borrowed by the User</dd>
  345. </dl>
  346. </li>
  347. </ul>
  348. </li>
  349. </ul>
  350. <!-- ============ METHOD DETAIL ========== -->
  351. <ul class="blockList">
  352. <li class="blockList"><a name="method.detail">
  353. <!-- -->
  354. </a>
  355. <h3>Method Detail</h3>
  356. <a name="bookStatus--">
  357. <!-- -->
  358. </a>
  359. <ul class="blockList">
  360. <li class="blockList">
  361. <h4>bookStatus</h4>
  362. <pre>public&nbsp;int[]&nbsp;bookStatus()</pre>
  363. <div class="block">Get Book ids of the books</div>
  364. <dl>
  365. <dt><span class="returnLabel">Returns:</span></dt>
  366. <dd>Array of Book ids borrowed by this User</dd>
  367. </dl>
  368. </li>
  369. </ul>
  370. <a name="borrowNewBook-int-">
  371. <!-- -->
  372. </a>
  373. <ul class="blockList">
  374. <li class="blockList">
  375. <h4>borrowNewBook</h4>
  376. <pre>boolean&nbsp;borrowNewBook(int&nbsp;id)</pre>
  377. <div class="block">User borrows a Book</div>
  378. <dl>
  379. <dt><span class="paramLabel">Parameters:</span></dt>
  380. <dd><code>id</code> - id of the Book to tbe borrowed</dd>
  381. <dt><span class="returnLabel">Returns:</span></dt>
  382. <dd>If the borrowing operation is successful</dd>
  383. </dl>
  384. </li>
  385. </ul>
  386. <a name="getId--">
  387. <!-- -->
  388. </a>
  389. <ul class="blockList">
  390. <li class="blockList">
  391. <h4>getId</h4>
  392. <pre>public&nbsp;int&nbsp;getId()</pre>
  393. <div class="block">Gets id of this User</div>
  394. <dl>
  395. <dt><span class="returnLabel">Returns:</span></dt>
  396. <dd>id</dd>
  397. </dl>
  398. </li>
  399. </ul>
  400. <a name="getLimit--">
  401. <!-- -->
  402. </a>
  403. <ul class="blockList">
  404. <li class="blockList">
  405. <h4>getLimit</h4>
  406. <pre>public&nbsp;int&nbsp;getLimit()</pre>
  407. <div class="block">Gets limit of Book this User can borrow</div>
  408. <dl>
  409. <dt><span class="returnLabel">Returns:</span></dt>
  410. <dd>Book borrowing limit</dd>
  411. </dl>
  412. </li>
  413. </ul>
  414. <a name="getName--">
  415. <!-- -->
  416. </a>
  417. <ul class="blockList">
  418. <li class="blockList">
  419. <h4>getName</h4>
  420. <pre>public&nbsp;java.lang.String&nbsp;getName()</pre>
  421. <div class="block">Gets name of this User</div>
  422. <dl>
  423. <dt><span class="returnLabel">Returns:</span></dt>
  424. <dd>Name</dd>
  425. </dl>
  426. </li>
  427. </ul>
  428. <a name="returnBook-int-">
  429. <!-- -->
  430. </a>
  431. <ul class="blockList">
  432. <li class="blockList">
  433. <h4>returnBook</h4>
  434. <pre>boolean&nbsp;returnBook(int&nbsp;id)</pre>
  435. <div class="block">User returns a Book</div>
  436. <dl>
  437. <dt><span class="paramLabel">Parameters:</span></dt>
  438. <dd><code>id</code> - id of the Book to be returned</dd>
  439. <dt><span class="returnLabel">Returns:</span></dt>
  440. <dd>If the returning operation is successful</dd>
  441. </dl>
  442. </li>
  443. </ul>
  444. <a name="setLimit-int-">
  445. <!-- -->
  446. </a>
  447. <ul class="blockList">
  448. <li class="blockList">
  449. <h4>setLimit</h4>
  450. <pre>public&nbsp;void&nbsp;setLimit(int&nbsp;limit)</pre>
  451. <div class="block">Change limit of this User</div>
  452. <dl>
  453. <dt><span class="paramLabel">Parameters:</span></dt>
  454. <dd><code>limit</code> - New limit of the User</dd>
  455. </dl>
  456. </li>
  457. </ul>
  458. <a name="setName-java.lang.String-">
  459. <!-- -->
  460. </a>
  461. <ul class="blockList">
  462. <li class="blockList">
  463. <h4>setName</h4>
  464. <pre>public&nbsp;void&nbsp;setName(java.lang.String&nbsp;name)</pre>
  465. <div class="block">Change name of this User</div>
  466. <dl>
  467. <dt><span class="paramLabel">Parameters:</span></dt>
  468. <dd><code>name</code> - New name of the User</dd>
  469. </dl>
  470. </li>
  471. </ul>
  472. <a name="status--">
  473. <!-- -->
  474. </a>
  475. <ul class="blockListLast">
  476. <li class="blockList">
  477. <h4>status</h4>
  478. <pre>public&nbsp;boolean&nbsp;status()</pre>
  479. <div class="block">Check status of the User</div>
  480. <dl>
  481. <dt><span class="returnLabel">Returns:</span></dt>
  482. <dd>If the User is already at the borrowing limit</dd>
  483. </dl>
  484. </li>
  485. </ul>
  486. </li>
  487. </ul>
  488. </li>
  489. </ul>
  490. </div>
  491. </div>
  492. <!-- ========= END OF CLASS DATA ========= -->
  493. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  494. <div class="bottomNav"><a name="navbar.bottom">
  495. <!-- -->
  496. </a>
  497. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  498. <a name="navbar.bottom.firstrow">
  499. <!-- -->
  500. </a>
  501. <ul class="navList" title="Navigation">
  502. <li><a href="../libsys/package-summary.html">Package</a></li>
  503. <li class="navBarCell1Rev">Class</li>
  504. <li><a href="package-tree.html">Tree</a></li>
  505. <li><a href="../index-files/index-1.html">Index</a></li>
  506. <li><a href="../help-doc.html">Help</a></li>
  507. </ul>
  508. </div>
  509. <div class="subNav">
  510. <ul class="navList">
  511. <li><a href="../libsys/SettingsTest.html" title="class in libsys"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  512. <li><a href="../libsys/UserFactory.html" title="class in libsys"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  513. </ul>
  514. <ul class="navList">
  515. <li><a href="../index.html?libsys/User.html" target="_top">Frames</a></li>
  516. <li><a href="User.html" target="_top">No&nbsp;Frames</a></li>
  517. </ul>
  518. <ul class="navList" id="allclasses_navbar_bottom">
  519. <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
  520. </ul>
  521. <div>
  522. <script type="text/javascript"><!--
  523. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  524. if(window==top) {
  525. allClassesLink.style.display = "block";
  526. }
  527. else {
  528. allClassesLink.style.display = "none";
  529. }
  530. //-->
  531. </script>
  532. </div>
  533. <div>
  534. <ul class="subNavList">
  535. <li>Summary:&nbsp;</li>
  536. <li>Nested&nbsp;|&nbsp;</li>
  537. <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
  538. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  539. <li><a href="#method.summary">Method</a></li>
  540. </ul>
  541. <ul class="subNavList">
  542. <li>Detail:&nbsp;</li>
  543. <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
  544. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  545. <li><a href="#method.detail">Method</a></li>
  546. </ul>
  547. </div>
  548. <a name="skip.navbar.bottom">
  549. <!-- -->
  550. </a></div>
  551. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  552. </body>
  553. </html>