Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

409 Zeilen
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 Sun Jun 04 20:12:54 MST 2017 -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <title>UserFactory (LibrarySystem 1.0 API)</title>
  8. <meta name="date" content="2017-06-04">
  9. <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
  10. <script type="text/javascript" src="../script.js"></script>
  11. </head>
  12. <body>
  13. <script type="text/javascript"><!--
  14. try {
  15. if (location.href.indexOf('is-external=true') == -1) {
  16. parent.document.title="UserFactory (LibrarySystem 1.0 API)";
  17. }
  18. }
  19. catch(err) {
  20. }
  21. //-->
  22. var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10};
  23. var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
  24. var altColor = "altColor";
  25. var rowColor = "rowColor";
  26. var tableTab = "tableTab";
  27. var activeTableTab = "activeTableTab";
  28. </script>
  29. <noscript>
  30. <div>JavaScript is disabled on your browser.</div>
  31. </noscript>
  32. <!-- ========= START OF TOP NAVBAR ======= -->
  33. <div class="topNav"><a name="navbar.top">
  34. <!-- -->
  35. </a>
  36. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  37. <a name="navbar.top.firstrow">
  38. <!-- -->
  39. </a>
  40. <ul class="navList" title="Navigation">
  41. <li><a href="../libsys/package-summary.html">Package</a></li>
  42. <li class="navBarCell1Rev">Class</li>
  43. <li><a href="class-use/UserFactory.html">Use</a></li>
  44. <li><a href="package-tree.html">Tree</a></li>
  45. <li><a href="../deprecated-list.html">Deprecated</a></li>
  46. <li><a href="../index-all.html">Index</a></li>
  47. <li><a href="../help-doc.html">Help</a></li>
  48. </ul>
  49. </div>
  50. <div class="subNav">
  51. <ul class="navList">
  52. <li><a href="../libsys/User.html" title="class in libsys"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  53. <li>Next&nbsp;Class</li>
  54. </ul>
  55. <ul class="navList">
  56. <li><a href="../index.html?libsys/UserFactory.html" target="_top">Frames</a></li>
  57. <li><a href="UserFactory.html" target="_top">No&nbsp;Frames</a></li>
  58. </ul>
  59. <ul class="navList" id="allclasses_navbar_top">
  60. <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
  61. </ul>
  62. <div>
  63. <script type="text/javascript"><!--
  64. allClassesLink = document.getElementById("allclasses_navbar_top");
  65. if(window==top) {
  66. allClassesLink.style.display = "block";
  67. }
  68. else {
  69. allClassesLink.style.display = "none";
  70. }
  71. //-->
  72. </script>
  73. </div>
  74. <div>
  75. <ul class="subNavList">
  76. <li>Summary:&nbsp;</li>
  77. <li>Nested&nbsp;|&nbsp;</li>
  78. <li>Field&nbsp;|&nbsp;</li>
  79. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  80. <li><a href="#method.summary">Method</a></li>
  81. </ul>
  82. <ul class="subNavList">
  83. <li>Detail:&nbsp;</li>
  84. <li>Field&nbsp;|&nbsp;</li>
  85. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  86. <li><a href="#method.detail">Method</a></li>
  87. </ul>
  88. </div>
  89. <a name="skip.navbar.top">
  90. <!-- -->
  91. </a></div>
  92. <!-- ========= END OF TOP NAVBAR ========= -->
  93. <!-- ======== START OF CLASS DATA ======== -->
  94. <div class="header">
  95. <div class="subTitle">libsys</div>
  96. <h2 title="Class UserFactory" class="title">Class UserFactory</h2>
  97. </div>
  98. <div class="contentContainer">
  99. <ul class="inheritance">
  100. <li><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
  101. <li>
  102. <ul class="inheritance">
  103. <li>libsys.UserFactory</li>
  104. </ul>
  105. </li>
  106. </ul>
  107. <div class="description">
  108. <ul class="blockList">
  109. <li class="blockList">
  110. <hr>
  111. <br>
  112. <pre>public class <span class="typeNameLabel">UserFactory</span>
  113. extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
  114. </li>
  115. </ul>
  116. </div>
  117. <div class="summary">
  118. <ul class="blockList">
  119. <li class="blockList">
  120. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  121. <ul class="blockList">
  122. <li class="blockList"><a name="constructor.summary">
  123. <!-- -->
  124. </a>
  125. <h3>Constructor Summary</h3>
  126. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  127. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  128. <tr>
  129. <th class="colOne" scope="col">Constructor and Description</th>
  130. </tr>
  131. <tr class="altColor">
  132. <td class="colOne"><code><span class="memberNameLink"><a href="../libsys/UserFactory.html#UserFactory--">UserFactory</a></span>()</code>
  133. <div class="block">Create a new empty UserFactory</div>
  134. </td>
  135. </tr>
  136. <tr class="rowColor">
  137. <td class="colOne"><code><span class="memberNameLink"><a href="../libsys/UserFactory.html#UserFactory-java.lang.String-">UserFactory</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;userFilename)</code>
  138. <div class="block">Create a new UserFactory and fill it with information from a JSON file</div>
  139. </td>
  140. </tr>
  141. </table>
  142. </li>
  143. </ul>
  144. <!-- ========== METHOD SUMMARY =========== -->
  145. <ul class="blockList">
  146. <li class="blockList"><a name="method.summary">
  147. <!-- -->
  148. </a>
  149. <h3>Method Summary</h3>
  150. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  151. <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>
  152. <tr>
  153. <th class="colFirst" scope="col">Modifier and Type</th>
  154. <th class="colLast" scope="col">Method and Description</th>
  155. </tr>
  156. <tr id="i0" class="altColor">
  157. <td class="colFirst"><code><a href="../libsys/User.html" title="class in libsys">User</a></code></td>
  158. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/UserFactory.html#getUser-int-">getUser</a></span>(int&nbsp;index)</code>
  159. <div class="block">Looks for a User with the given id</div>
  160. </td>
  161. </tr>
  162. <tr id="i1" class="rowColor">
  163. <td class="colFirst"><code><a href="../libsys/User.html" title="class in libsys">User</a></code></td>
  164. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/UserFactory.html#getUser-java.lang.String-">getUser</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code>
  165. <div class="block">Looks for the User with the given name</div>
  166. </td>
  167. </tr>
  168. <tr id="i2" class="altColor">
  169. <td class="colFirst"><code><a href="../libsys/User.html" title="class in libsys">User</a></code></td>
  170. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/UserFactory.html#newUser-java.lang.String-int-">newUser</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
  171. int&nbsp;limit)</code>
  172. <div class="block">Adds a new User into this class</div>
  173. </td>
  174. </tr>
  175. <tr id="i3" class="rowColor">
  176. <td class="colFirst"><code>void</code></td>
  177. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/UserFactory.html#setUserFileName-java.lang.String-">setUserFileName</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;userFilename)</code>
  178. <div class="block">Update the output filename for the object</div>
  179. </td>
  180. </tr>
  181. <tr id="i4" class="altColor">
  182. <td class="colFirst"><code>void</code></td>
  183. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/UserFactory.html#toJsonFile--">toJsonFile</a></span>()</code>
  184. <div class="block">Output the data into a JSON file replacing the input file (or if filename not given, "users.json")</div>
  185. </td>
  186. </tr>
  187. <tr id="i5" class="rowColor">
  188. <td class="colFirst"><code>void</code></td>
  189. <td class="colLast"><code><span class="memberNameLink"><a href="../libsys/UserFactory.html#update-libsys.User-libsys.User-">update</a></span>(<a href="../libsys/User.html" title="class in libsys">User</a>&nbsp;oldUser,
  190. <a href="../libsys/User.html" title="class in libsys">User</a>&nbsp;newUser)</code>
  191. <div class="block">Replacing a User in the array list with a new User</div>
  192. </td>
  193. </tr>
  194. </table>
  195. <ul class="blockList">
  196. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  197. <!-- -->
  198. </a>
  199. <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
  200. <code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
  201. </ul>
  202. </li>
  203. </ul>
  204. </li>
  205. </ul>
  206. </div>
  207. <div class="details">
  208. <ul class="blockList">
  209. <li class="blockList">
  210. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  211. <ul class="blockList">
  212. <li class="blockList"><a name="constructor.detail">
  213. <!-- -->
  214. </a>
  215. <h3>Constructor Detail</h3>
  216. <a name="UserFactory--">
  217. <!-- -->
  218. </a>
  219. <ul class="blockList">
  220. <li class="blockList">
  221. <h4>UserFactory</h4>
  222. <pre>public&nbsp;UserFactory()</pre>
  223. <div class="block">Create a new empty UserFactory</div>
  224. </li>
  225. </ul>
  226. <a name="UserFactory-java.lang.String-">
  227. <!-- -->
  228. </a>
  229. <ul class="blockListLast">
  230. <li class="blockList">
  231. <h4>UserFactory</h4>
  232. <pre>public&nbsp;UserFactory(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;userFilename)</pre>
  233. <div class="block">Create a new UserFactory and fill it with information from a JSON file</div>
  234. <dl>
  235. <dt><span class="paramLabel">Parameters:</span></dt>
  236. <dd><code>userFilename</code> - Name of the input JSON file</dd>
  237. </dl>
  238. </li>
  239. </ul>
  240. </li>
  241. </ul>
  242. <!-- ============ METHOD DETAIL ========== -->
  243. <ul class="blockList">
  244. <li class="blockList"><a name="method.detail">
  245. <!-- -->
  246. </a>
  247. <h3>Method Detail</h3>
  248. <a name="toJsonFile--">
  249. <!-- -->
  250. </a>
  251. <ul class="blockList">
  252. <li class="blockList">
  253. <h4>toJsonFile</h4>
  254. <pre>public&nbsp;void&nbsp;toJsonFile()</pre>
  255. <div class="block">Output the data into a JSON file replacing the input file (or if filename not given, "users.json")</div>
  256. </li>
  257. </ul>
  258. <a name="setUserFileName-java.lang.String-">
  259. <!-- -->
  260. </a>
  261. <ul class="blockList">
  262. <li class="blockList">
  263. <h4>setUserFileName</h4>
  264. <pre>public&nbsp;void&nbsp;setUserFileName(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;userFilename)</pre>
  265. <div class="block">Update the output filename for the object</div>
  266. <dl>
  267. <dt><span class="paramLabel">Parameters:</span></dt>
  268. <dd><code>userFilename</code> - The new filename</dd>
  269. </dl>
  270. </li>
  271. </ul>
  272. <a name="newUser-java.lang.String-int-">
  273. <!-- -->
  274. </a>
  275. <ul class="blockList">
  276. <li class="blockList">
  277. <h4>newUser</h4>
  278. <pre>public&nbsp;<a href="../libsys/User.html" title="class in libsys">User</a>&nbsp;newUser(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
  279. int&nbsp;limit)</pre>
  280. <div class="block">Adds a new User into this class</div>
  281. <dl>
  282. <dt><span class="paramLabel">Parameters:</span></dt>
  283. <dd><code>name</code> - Name of the User</dd>
  284. <dd><code>limit</code> - Limit of Book the User can borrow</dd>
  285. <dt><span class="returnLabel">Returns:</span></dt>
  286. <dd>The new User that is just created</dd>
  287. </dl>
  288. </li>
  289. </ul>
  290. <a name="getUser-java.lang.String-">
  291. <!-- -->
  292. </a>
  293. <ul class="blockList">
  294. <li class="blockList">
  295. <h4>getUser</h4>
  296. <pre>public&nbsp;<a href="../libsys/User.html" title="class in libsys">User</a>&nbsp;getUser(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
  297. <div class="block">Looks for the User with the given name</div>
  298. <dl>
  299. <dt><span class="paramLabel">Parameters:</span></dt>
  300. <dd><code>name</code> - Name of the User to be found</dd>
  301. <dt><span class="returnLabel">Returns:</span></dt>
  302. <dd>User with the given name</dd>
  303. </dl>
  304. </li>
  305. </ul>
  306. <a name="getUser-int-">
  307. <!-- -->
  308. </a>
  309. <ul class="blockList">
  310. <li class="blockList">
  311. <h4>getUser</h4>
  312. <pre>public&nbsp;<a href="../libsys/User.html" title="class in libsys">User</a>&nbsp;getUser(int&nbsp;index)</pre>
  313. <div class="block">Looks for a User with the given id</div>
  314. <dl>
  315. <dt><span class="paramLabel">Parameters:</span></dt>
  316. <dd><code>index</code> - id of the User to be found</dd>
  317. <dt><span class="returnLabel">Returns:</span></dt>
  318. <dd>User with the given id</dd>
  319. </dl>
  320. </li>
  321. </ul>
  322. <a name="update-libsys.User-libsys.User-">
  323. <!-- -->
  324. </a>
  325. <ul class="blockListLast">
  326. <li class="blockList">
  327. <h4>update</h4>
  328. <pre>public&nbsp;void&nbsp;update(<a href="../libsys/User.html" title="class in libsys">User</a>&nbsp;oldUser,
  329. <a href="../libsys/User.html" title="class in libsys">User</a>&nbsp;newUser)</pre>
  330. <div class="block">Replacing a User in the array list with a new User</div>
  331. <dl>
  332. <dt><span class="paramLabel">Parameters:</span></dt>
  333. <dd><code>oldUser</code> - User to be replaced</dd>
  334. <dd><code>newUser</code> - User replacing it</dd>
  335. </dl>
  336. </li>
  337. </ul>
  338. </li>
  339. </ul>
  340. </li>
  341. </ul>
  342. </div>
  343. </div>
  344. <!-- ========= END OF CLASS DATA ========= -->
  345. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  346. <div class="bottomNav"><a name="navbar.bottom">
  347. <!-- -->
  348. </a>
  349. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  350. <a name="navbar.bottom.firstrow">
  351. <!-- -->
  352. </a>
  353. <ul class="navList" title="Navigation">
  354. <li><a href="../libsys/package-summary.html">Package</a></li>
  355. <li class="navBarCell1Rev">Class</li>
  356. <li><a href="class-use/UserFactory.html">Use</a></li>
  357. <li><a href="package-tree.html">Tree</a></li>
  358. <li><a href="../deprecated-list.html">Deprecated</a></li>
  359. <li><a href="../index-all.html">Index</a></li>
  360. <li><a href="../help-doc.html">Help</a></li>
  361. </ul>
  362. </div>
  363. <div class="subNav">
  364. <ul class="navList">
  365. <li><a href="../libsys/User.html" title="class in libsys"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  366. <li>Next&nbsp;Class</li>
  367. </ul>
  368. <ul class="navList">
  369. <li><a href="../index.html?libsys/UserFactory.html" target="_top">Frames</a></li>
  370. <li><a href="UserFactory.html" target="_top">No&nbsp;Frames</a></li>
  371. </ul>
  372. <ul class="navList" id="allclasses_navbar_bottom">
  373. <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
  374. </ul>
  375. <div>
  376. <script type="text/javascript"><!--
  377. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  378. if(window==top) {
  379. allClassesLink.style.display = "block";
  380. }
  381. else {
  382. allClassesLink.style.display = "none";
  383. }
  384. //-->
  385. </script>
  386. </div>
  387. <div>
  388. <ul class="subNavList">
  389. <li>Summary:&nbsp;</li>
  390. <li>Nested&nbsp;|&nbsp;</li>
  391. <li>Field&nbsp;|&nbsp;</li>
  392. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  393. <li><a href="#method.summary">Method</a></li>
  394. </ul>
  395. <ul class="subNavList">
  396. <li>Detail:&nbsp;</li>
  397. <li>Field&nbsp;|&nbsp;</li>
  398. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  399. <li><a href="#method.detail">Method</a></li>
  400. </ul>
  401. </div>
  402. <a name="skip.navbar.bottom">
  403. <!-- -->
  404. </a></div>
  405. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  406. <p class="legalCopy"><small>Copyright &#169; 2017. All rights reserved.</small></p>
  407. </body>
  408. </html>