Maker.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  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 -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <title>Maker (squidlib-util 3.0.0-SNAPSHOT)</title>
  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="Maker (squidlib-util 3.0.0-SNAPSHOT)";
  16. }
  17. }
  18. catch(err) {
  19. }
  20. //-->
  21. var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9};
  22. var tabs = {65535:["t0","All Methods"],1:["t1","Static 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="../overview-summary.html">Overview</a></li>
  41. <li><a href="package-summary.html">Package</a></li>
  42. <li class="navBarCell1Rev">Class</li>
  43. <li><a href="class-use/Maker.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-files/index-1.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="../squidpony/LanguageCipher.html" title="class in squidpony"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  53. <li><a href="../squidpony/Messaging.html" title="class in squidpony"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  54. </ul>
  55. <ul class="navList">
  56. <li><a href="../index.html?squidpony/Maker.html" target="_top">Frames</a></li>
  57. <li><a href="Maker.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><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&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">squidpony</div>
  96. <h2 title="Class Maker" class="title">Class Maker</h2>
  97. </div>
  98. <div class="contentContainer">
  99. <ul class="inheritance">
  100. <li><a href="http://docs.oracle.com/javase/8/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>squidpony.Maker</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 <a href="../src-html/squidpony/Maker.html#line.16">Maker</a>
  113. extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
  114. <div class="block">Utility methods for more easily constructing data structures, particularly those in Java's standard library.
  115. All static methods and inner classes; meant to be imported with <code>import static squidpony.Maker.*</code>.
  116. Created by Tommy Ettinger on 5/19/2016.</div>
  117. </li>
  118. </ul>
  119. </div>
  120. <div class="summary">
  121. <ul class="blockList">
  122. <li class="blockList">
  123. <!-- =========== FIELD SUMMARY =========== -->
  124. <ul class="blockList">
  125. <li class="blockList"><a name="field.summary">
  126. <!-- -->
  127. </a>
  128. <h3>Field Summary</h3>
  129. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
  130. <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
  131. <tr>
  132. <th class="colFirst" scope="col">Modifier and Type</th>
  133. <th class="colLast" scope="col">Field and Description</th>
  134. </tr>
  135. <tr class="altColor">
  136. <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a></code></td>
  137. <td class="colLast"><code><span class="memberNameLink"><a href="../squidpony/Maker.html#issueLog">issueLog</a></span></code>
  138. <div class="block">Stores any information relating to non-fatal issues, such as caught and handled Exceptions that still change the
  139. behavior of methods.</div>
  140. </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="../squidpony/Maker.html#Maker--">Maker</a></span>()</code>&nbsp;</td>
  158. </tr>
  159. </table>
  160. </li>
  161. </ul>
  162. <!-- ========== METHOD SUMMARY =========== -->
  163. <ul class="blockList">
  164. <li class="blockList"><a name="method.summary">
  165. <!-- -->
  166. </a>
  167. <h3>Method Summary</h3>
  168. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  169. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static 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>
  170. <tr>
  171. <th class="colFirst" scope="col">Modifier and Type</th>
  172. <th class="colLast" scope="col">Method and Description</th>
  173. </tr>
  174. <tr id="i0" class="altColor">
  175. <td class="colFirst"><code>static &lt;K,V&gt;&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html?is-external=true" title="class or interface in java.util">LinkedHashMap</a>&lt;K,V&gt;</code></td>
  176. <td class="colLast"><code><span class="memberNameLink"><a href="../squidpony/Maker.html#makeLHM--">makeLHM</a></span>()</code>
  177. <div class="block">Makes an empty LinkedHashMap (LHM); needs key and value types to be specified in order to work.</div>
  178. </td>
  179. </tr>
  180. <tr id="i1" class="rowColor">
  181. <td class="colFirst"><code>static &lt;K,V&gt;&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html?is-external=true" title="class or interface in java.util">LinkedHashMap</a>&lt;K,V&gt;</code></td>
  182. <td class="colLast"><code><span class="memberNameLink"><a href="../squidpony/Maker.html#makeLHM-K-V-java.lang.Object...-">makeLHM</a></span>(K&nbsp;k0,
  183. V&nbsp;v0,
  184. <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>...&nbsp;rest)</code>
  185. <div class="block">Makes a LinkedHashMap (LHM) with key and value types inferred from the types of k0 and v0, and considers all
  186. parameters key-value pairs, casting the Objects at positions 0, 2, 4...</div>
  187. </td>
  188. </tr>
  189. <tr id="i2" class="altColor">
  190. <td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashSet.html?is-external=true" title="class or interface in java.util">LinkedHashSet</a>&lt;T&gt;</code></td>
  191. <td class="colLast"><code><span class="memberNameLink"><a href="../squidpony/Maker.html#makeLHS-T...-">makeLHS</a></span>(T...&nbsp;elements)</code>
  192. <div class="block">Makes a LinkedHashSet (LHS) of T given an array or vararg of T elements.</div>
  193. </td>
  194. </tr>
  195. <tr id="i3" class="rowColor">
  196. <td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;T&gt;</code></td>
  197. <td class="colLast"><code><span class="memberNameLink"><a href="../squidpony/Maker.html#makeList-T...-">makeList</a></span>(T...&nbsp;elements)</code>
  198. <div class="block">Makes an ArrayList of T given an array or vararg of T elements.</div>
  199. </td>
  200. </tr>
  201. <tr id="i4" class="altColor">
  202. <td class="colFirst"><code>static &lt;K,V&gt;&nbsp;<a href="../squidpony/squidmath/OrderedMap.html" title="class in squidpony.squidmath">OrderedMap</a>&lt;K,V&gt;</code></td>
  203. <td class="colLast"><code><span class="memberNameLink"><a href="../squidpony/Maker.html#makeOM--">makeOM</a></span>()</code>
  204. <div class="block">Makes an empty OrderedMap (OM); needs key and value types to be specified in order to work.</div>
  205. </td>
  206. </tr>
  207. <tr id="i5" class="rowColor">
  208. <td class="colFirst"><code>static &lt;K,V&gt;&nbsp;<a href="../squidpony/squidmath/OrderedMap.html" title="class in squidpony.squidmath">OrderedMap</a>&lt;K,V&gt;</code></td>
  209. <td class="colLast"><code><span class="memberNameLink"><a href="../squidpony/Maker.html#makeOM-K-V-java.lang.Object...-">makeOM</a></span>(K&nbsp;k0,
  210. V&nbsp;v0,
  211. <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>...&nbsp;rest)</code>
  212. <div class="block">Makes an OrderedMap (OM) with key and value types inferred from the types of k0 and v0, and considers all
  213. parameters key-value pairs, casting the Objects at positions 0, 2, 4...</div>
  214. </td>
  215. </tr>
  216. <tr id="i6" class="altColor">
  217. <td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../squidpony/squidmath/OrderedSet.html" title="class in squidpony.squidmath">OrderedSet</a>&lt;T&gt;</code></td>
  218. <td class="colLast"><code><span class="memberNameLink"><a href="../squidpony/Maker.html#makeOS-T...-">makeOS</a></span>(T...&nbsp;elements)</code>
  219. <div class="block">Makes a OrderedSet (OS) of T given an array or vararg of T elements.</div>
  220. </td>
  221. </tr>
  222. </table>
  223. <ul class="blockList">
  224. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  225. <!-- -->
  226. </a>
  227. <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
  228. <code><a href="http://docs.oracle.com/javase/8/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/8/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/8/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/8/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/8/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/8/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/8/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/8/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/8/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/8/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/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
  229. </ul>
  230. </li>
  231. </ul>
  232. </li>
  233. </ul>
  234. </div>
  235. <div class="details">
  236. <ul class="blockList">
  237. <li class="blockList">
  238. <!-- ============ FIELD DETAIL =========== -->
  239. <ul class="blockList">
  240. <li class="blockList"><a name="field.detail">
  241. <!-- -->
  242. </a>
  243. <h3>Field Detail</h3>
  244. <a name="issueLog">
  245. <!-- -->
  246. </a>
  247. <ul class="blockListLast">
  248. <li class="blockList">
  249. <h4>issueLog</h4>
  250. <pre>public static final&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang">StringBuilder</a> <a href="../src-html/squidpony/Maker.html#line.23">issueLog</a></pre>
  251. <div class="block">Stores any information relating to non-fatal issues, such as caught and handled Exceptions that still change the
  252. behavior of methods. Typically shouldn't be cleared while debugging, since it could be useful later on, and
  253. hopefully won't need to be written to in a release build.</div>
  254. </li>
  255. </ul>
  256. </li>
  257. </ul>
  258. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  259. <ul class="blockList">
  260. <li class="blockList"><a name="constructor.detail">
  261. <!-- -->
  262. </a>
  263. <h3>Constructor Detail</h3>
  264. <a name="Maker--">
  265. <!-- -->
  266. </a>
  267. <ul class="blockListLast">
  268. <li class="blockList">
  269. <h4>Maker</h4>
  270. <pre>public&nbsp;<a href="../src-html/squidpony/Maker.html#line.16">Maker</a>()</pre>
  271. </li>
  272. </ul>
  273. </li>
  274. </ul>
  275. <!-- ============ METHOD DETAIL ========== -->
  276. <ul class="blockList">
  277. <li class="blockList"><a name="method.detail">
  278. <!-- -->
  279. </a>
  280. <h3>Method Detail</h3>
  281. <a name="makeLHM-java.lang.Object-java.lang.Object-java.lang.Object:A-">
  282. <!-- -->
  283. </a><a name="makeLHM-K-V-java.lang.Object...-">
  284. <!-- -->
  285. </a>
  286. <ul class="blockList">
  287. <li class="blockList">
  288. <h4>makeLHM</h4>
  289. <pre>public static&nbsp;&lt;K,V&gt;&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html?is-external=true" title="class or interface in java.util">LinkedHashMap</a>&lt;K,V&gt;&nbsp;<a href="../src-html/squidpony/Maker.html#line.38">makeLHM</a>(K&nbsp;k0,
  290. V&nbsp;v0,
  291. <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>...&nbsp;rest)</pre>
  292. <div class="block">Makes a LinkedHashMap (LHM) with key and value types inferred from the types of k0 and v0, and considers all
  293. parameters key-value pairs, casting the Objects at positions 0, 2, 4... etc. to K and the objects at positions
  294. 1, 3, 5... etc. to V. If rest has an odd-number length, then it discards the last item. If any pair of items in
  295. rest cannot be cast to the correct type of K or V, then this inserts nothing for that pair and logs information
  296. on the problematic pair to the static Maker.issueLog field.</div>
  297. <dl>
  298. <dt><span class="paramLabel">Type Parameters:</span></dt>
  299. <dd><code>K</code> - the type of keys in the returned LinkedHashMap; if not specified, will be inferred from k0</dd>
  300. <dd><code>V</code> - the type of values in the returned LinkedHashMap; if not specified, will be inferred from v0</dd>
  301. <dt><span class="paramLabel">Parameters:</span></dt>
  302. <dd><code>k0</code> - the first key; used to infer the types of other keys if generic parameters aren't specified.</dd>
  303. <dd><code>v0</code> - the first value; used to infer the types of other values if generic parameters aren't specified.</dd>
  304. <dd><code>rest</code> - an array or vararg of keys and values in pairs; should contain alternating K, V, K, V... elements</dd>
  305. <dt><span class="returnLabel">Returns:</span></dt>
  306. <dd>a freshly-made LinkedHashMap with K keys and V values, using k0, v0, and the contents of rest to fill it</dd>
  307. </dl>
  308. </li>
  309. </ul>
  310. <a name="makeLHM--">
  311. <!-- -->
  312. </a>
  313. <ul class="blockList">
  314. <li class="blockList">
  315. <h4>makeLHM</h4>
  316. <pre>public static&nbsp;&lt;K,V&gt;&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html?is-external=true" title="class or interface in java.util">LinkedHashMap</a>&lt;K,V&gt;&nbsp;<a href="../src-html/squidpony/Maker.html#line.79">makeLHM</a>()</pre>
  317. <div class="block">Makes an empty LinkedHashMap (LHM); needs key and value types to be specified in order to work. For an empty
  318. LinkedHashMap with String keys and Coord values, you could use <code>Maker.&lt;String, Coord&gt;makeLHM();</code>. Using
  319. the new keyword is probably just as easy in this case; this method is provided for completeness relative to
  320. makeLHM() with 2 or more parameters.</div>
  321. <dl>
  322. <dt><span class="paramLabel">Type Parameters:</span></dt>
  323. <dd><code>K</code> - the type of keys in the returned LinkedHashMap; cannot be inferred and must be specified</dd>
  324. <dd><code>V</code> - the type of values in the returned LinkedHashMap; cannot be inferred and must be specified</dd>
  325. <dt><span class="returnLabel">Returns:</span></dt>
  326. <dd>an empty LinkedHashMap with the given key and value types.</dd>
  327. </dl>
  328. </li>
  329. </ul>
  330. <a name="makeList-java.lang.Object:A-">
  331. <!-- -->
  332. </a><a name="makeList-T...-">
  333. <!-- -->
  334. </a>
  335. <ul class="blockList">
  336. <li class="blockList">
  337. <h4>makeList</h4>
  338. <pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;T&gt;&nbsp;<a href="../src-html/squidpony/Maker.html#line.90">makeList</a>(T...&nbsp;elements)</pre>
  339. <div class="block">Makes an ArrayList of T given an array or vararg of T elements.</div>
  340. <dl>
  341. <dt><span class="paramLabel">Type Parameters:</span></dt>
  342. <dd><code>T</code> - just about any non-primitive type</dd>
  343. <dt><span class="paramLabel">Parameters:</span></dt>
  344. <dd><code>elements</code> - an array or vararg of T</dd>
  345. <dt><span class="returnLabel">Returns:</span></dt>
  346. <dd>a newly-allocated ArrayList containing all of elements, in order</dd>
  347. </dl>
  348. </li>
  349. </ul>
  350. <a name="makeLHS-java.lang.Object:A-">
  351. <!-- -->
  352. </a><a name="makeLHS-T...-">
  353. <!-- -->
  354. </a>
  355. <ul class="blockList">
  356. <li class="blockList">
  357. <h4>makeLHS</h4>
  358. <pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashSet.html?is-external=true" title="class or interface in java.util">LinkedHashSet</a>&lt;T&gt;&nbsp;<a href="../src-html/squidpony/Maker.html#line.104">makeLHS</a>(T...&nbsp;elements)</pre>
  359. <div class="block">Makes a LinkedHashSet (LHS) of T given an array or vararg of T elements. Duplicate items in elements will have
  360. all but one item discarded, using the later item in elements.</div>
  361. <dl>
  362. <dt><span class="paramLabel">Type Parameters:</span></dt>
  363. <dd><code>T</code> - just about any non-primitive type</dd>
  364. <dt><span class="paramLabel">Parameters:</span></dt>
  365. <dd><code>elements</code> - an array or vararg of T</dd>
  366. <dt><span class="returnLabel">Returns:</span></dt>
  367. <dd>a newly-allocated LinkedHashSet containing all of the non-duplicate items in elements, in order</dd>
  368. </dl>
  369. </li>
  370. </ul>
  371. <a name="makeOM-java.lang.Object-java.lang.Object-java.lang.Object:A-">
  372. <!-- -->
  373. </a><a name="makeOM-K-V-java.lang.Object...-">
  374. <!-- -->
  375. </a>
  376. <ul class="blockList">
  377. <li class="blockList">
  378. <h4>makeOM</h4>
  379. <pre>public static&nbsp;&lt;K,V&gt;&nbsp;<a href="../squidpony/squidmath/OrderedMap.html" title="class in squidpony.squidmath">OrderedMap</a>&lt;K,V&gt;&nbsp;<a href="../src-html/squidpony/Maker.html#line.125">makeOM</a>(K&nbsp;k0,
  380. V&nbsp;v0,
  381. <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>...&nbsp;rest)</pre>
  382. <div class="block">Makes an OrderedMap (OM) with key and value types inferred from the types of k0 and v0, and considers all
  383. parameters key-value pairs, casting the Objects at positions 0, 2, 4... etc. to K and the objects at positions
  384. 1, 3, 5... etc. to V. If rest has an odd-number length, then it discards the last item. If any pair of items in
  385. rest cannot be cast to the correct type of K or V, then this inserts nothing for that pair and logs information
  386. on the problematic pair to the static Maker.issueLog field.</div>
  387. <dl>
  388. <dt><span class="paramLabel">Type Parameters:</span></dt>
  389. <dd><code>K</code> - the type of keys in the returned LinkedHashMap; if not specified, will be inferred from k0</dd>
  390. <dd><code>V</code> - the type of values in the returned LinkedHashMap; if not specified, will be inferred from v0</dd>
  391. <dt><span class="paramLabel">Parameters:</span></dt>
  392. <dd><code>k0</code> - the first key; used to infer the types of other keys if generic parameters aren't specified.</dd>
  393. <dd><code>v0</code> - the first value; used to infer the types of other values if generic parameters aren't specified.</dd>
  394. <dd><code>rest</code> - an array or vararg of keys and values in pairs; should contain alternating K, V, K, V... elements</dd>
  395. <dt><span class="returnLabel">Returns:</span></dt>
  396. <dd>a freshly-made OrderedMap with K keys and V values, using k0, v0, and the contents of rest to fill it</dd>
  397. </dl>
  398. </li>
  399. </ul>
  400. <a name="makeOM--">
  401. <!-- -->
  402. </a>
  403. <ul class="blockList">
  404. <li class="blockList">
  405. <h4>makeOM</h4>
  406. <pre>public static&nbsp;&lt;K,V&gt;&nbsp;<a href="../squidpony/squidmath/OrderedMap.html" title="class in squidpony.squidmath">OrderedMap</a>&lt;K,V&gt;&nbsp;<a href="../src-html/squidpony/Maker.html#line.166">makeOM</a>()</pre>
  407. <div class="block">Makes an empty OrderedMap (OM); needs key and value types to be specified in order to work. For an empty
  408. OrderedMap with String keys and Coord values, you could use <code>Maker.&lt;String, Coord&gt;makeOM();</code>. Using
  409. the new keyword is probably just as easy in this case; this method is provided for completeness relative to
  410. makeOM() with 2 or more parameters.</div>
  411. <dl>
  412. <dt><span class="paramLabel">Type Parameters:</span></dt>
  413. <dd><code>K</code> - the type of keys in the returned OrderedMap; cannot be inferred and must be specified</dd>
  414. <dd><code>V</code> - the type of values in the returned OrderedMap; cannot be inferred and must be specified</dd>
  415. <dt><span class="returnLabel">Returns:</span></dt>
  416. <dd>an empty OrderedMap with the given key and value types.</dd>
  417. </dl>
  418. </li>
  419. </ul>
  420. <a name="makeOS-java.lang.Object:A-">
  421. <!-- -->
  422. </a><a name="makeOS-T...-">
  423. <!-- -->
  424. </a>
  425. <ul class="blockListLast">
  426. <li class="blockList">
  427. <h4>makeOS</h4>
  428. <pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../squidpony/squidmath/OrderedSet.html" title="class in squidpony.squidmath">OrderedSet</a>&lt;T&gt;&nbsp;<a href="../src-html/squidpony/Maker.html#line.178">makeOS</a>(T...&nbsp;elements)</pre>
  429. <div class="block">Makes a OrderedSet (OS) of T given an array or vararg of T elements. Duplicate items in elements will have
  430. all but one item discarded, using the later item in elements.</div>
  431. <dl>
  432. <dt><span class="paramLabel">Type Parameters:</span></dt>
  433. <dd><code>T</code> - just about any non-primitive type</dd>
  434. <dt><span class="paramLabel">Parameters:</span></dt>
  435. <dd><code>elements</code> - an array or vararg of T</dd>
  436. <dt><span class="returnLabel">Returns:</span></dt>
  437. <dd>a newly-allocated OrderedSet containing all of the non-duplicate items in elements, in order</dd>
  438. </dl>
  439. </li>
  440. </ul>
  441. </li>
  442. </ul>
  443. </li>
  444. </ul>
  445. </div>
  446. </div>
  447. <!-- ========= END OF CLASS DATA ========= -->
  448. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  449. <div class="bottomNav"><a name="navbar.bottom">
  450. <!-- -->
  451. </a>
  452. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  453. <a name="navbar.bottom.firstrow">
  454. <!-- -->
  455. </a>
  456. <ul class="navList" title="Navigation">
  457. <li><a href="../overview-summary.html">Overview</a></li>
  458. <li><a href="package-summary.html">Package</a></li>
  459. <li class="navBarCell1Rev">Class</li>
  460. <li><a href="class-use/Maker.html">Use</a></li>
  461. <li><a href="package-tree.html">Tree</a></li>
  462. <li><a href="../deprecated-list.html">Deprecated</a></li>
  463. <li><a href="../index-files/index-1.html">Index</a></li>
  464. <li><a href="../help-doc.html">Help</a></li>
  465. </ul>
  466. </div>
  467. <div class="subNav">
  468. <ul class="navList">
  469. <li><a href="../squidpony/LanguageCipher.html" title="class in squidpony"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  470. <li><a href="../squidpony/Messaging.html" title="class in squidpony"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  471. </ul>
  472. <ul class="navList">
  473. <li><a href="../index.html?squidpony/Maker.html" target="_top">Frames</a></li>
  474. <li><a href="Maker.html" target="_top">No&nbsp;Frames</a></li>
  475. </ul>
  476. <ul class="navList" id="allclasses_navbar_bottom">
  477. <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
  478. </ul>
  479. <div>
  480. <script type="text/javascript"><!--
  481. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  482. if(window==top) {
  483. allClassesLink.style.display = "block";
  484. }
  485. else {
  486. allClassesLink.style.display = "none";
  487. }
  488. //-->
  489. </script>
  490. </div>
  491. <div>
  492. <ul class="subNavList">
  493. <li>Summary:&nbsp;</li>
  494. <li>Nested&nbsp;|&nbsp;</li>
  495. <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
  496. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  497. <li><a href="#method.summary">Method</a></li>
  498. </ul>
  499. <ul class="subNavList">
  500. <li>Detail:&nbsp;</li>
  501. <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
  502. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  503. <li><a href="#method.detail">Method</a></li>
  504. </ul>
  505. </div>
  506. <a name="skip.navbar.bottom">
  507. <!-- -->
  508. </a></div>
  509. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  510. <p class="legalCopy"><small>Copyright &#169; 2012&#x2013;2016. All rights reserved.</small></p>
  511. </body>
  512. </html>