Y1S2-ROFAApp/dist/javadoc/rofaapp/ItemOrder.html
2020-06-07 21:53:40 +01:00

555 lines
20 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_141) on Tue May 08 15:40:50 BST 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ItemOrder</title>
<meta name="date" content="2018-05-08">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
<script type="text/javascript" src="../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ItemOrder";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../rofaapp/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ItemOrder.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-files/index-1.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../rofaapp/ItemIcon.html" title="class in rofaapp"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../rofaapp/ItemTable.html" title="class in rofaapp"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?rofaapp/ItemOrder.html" target="_top">Frames</a></li>
<li><a href="ItemOrder.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">rofaapp</div>
<h2 title="Class ItemOrder" class="title">Class ItemOrder</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>rofaapp.ItemOrder</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable</dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">ItemOrder</span>
extends java.lang.Object
implements java.io.Serializable</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../serialized-form.html#rofaapp.ItemOrder">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#arraySize">arraySize</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#currentSize">currentSize</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../rofaapp/Furniture.html" title="class in rofaapp">Furniture</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#orderList">orderList</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#ItemOrder--">ItemOrder</a></span>()</code>
<div class="block">Creates an empty item order of <a href="../rofaapp/ItemOrder.html#arraySize"><code>arraySize</code></a> items.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<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>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#add-rofaapp.Furniture-int-boolean-">add</a></span>(<a href="../rofaapp/Furniture.html" title="class in rofaapp">Furniture</a>&nbsp;f,
int&nbsp;index,
boolean&nbsp;force)</code>
<div class="block">Adds an item furniture to the <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a> at the given index.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#del-int-">del</a></span>(int&nbsp;index)</code>
<div class="block">Deletes (nulls) a furniture object in <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a> where the given index is.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#deleteAll--">deleteAll</a></span>()</code>
<div class="block">Deletes (nulls) everything in the list.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../rofaapp/Furniture.html" title="class in rofaapp">Furniture</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#get-int-">get</a></span>(int&nbsp;index)</code>
<div class="block">Gets the furniture object of the given index in the <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a> if valid.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#getCurrentSize--">getCurrentSize</a></span>()</code>
<div class="block">Current array size.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#getFirstAvailable--">getFirstAvailable</a></span>()</code>
<div class="block">Gets the index of the first available space within <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a>.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#getFreeSpace--">getFreeSpace</a></span>()</code>
<div class="block">Gets the number of free spaces within the <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a>.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#getMaxSize--">getMaxSize</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#getPrice--">getPrice</a></span>()</code>
<div class="block">Gets the price of all the items within <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a>.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#isValidIndex-int-">isValidIndex</a></span>(int&nbsp;i)</code>
<div class="block">Checks if the given number is a valid index (0 to <a href="../rofaapp/ItemOrder.html#arraySize"><code>arraySize</code></a>).</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../rofaapp/ItemOrder.html#normalise--">normalise</a></span>()</code>
<div class="block">Shifts all objects within <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a> so that there are no gaps in between items in the array.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="arraySize">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>arraySize</h4>
<pre>private final transient&nbsp;int arraySize</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../constant-values.html#rofaapp.ItemOrder.arraySize">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="currentSize">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>currentSize</h4>
<pre>private&nbsp;int currentSize</pre>
</li>
</ul>
<a name="orderList">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>orderList</h4>
<pre>private&nbsp;<a href="../rofaapp/Furniture.html" title="class in rofaapp">Furniture</a>[] orderList</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="ItemOrder--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ItemOrder</h4>
<pre>ItemOrder()</pre>
<div class="block">Creates an empty item order of <a href="../rofaapp/ItemOrder.html#arraySize"><code>arraySize</code></a> items.</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getFirstAvailable--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFirstAvailable</h4>
<pre>public&nbsp;int&nbsp;getFirstAvailable()</pre>
<div class="block">Gets the index of the first available space within <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a>. (-1 if full).</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Integer of the first empty index. (-1 if full)</dd>
</dl>
</li>
</ul>
<a name="get-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre>public&nbsp;<a href="../rofaapp/Furniture.html" title="class in rofaapp">Furniture</a>&nbsp;get(int&nbsp;index)</pre>
<div class="block">Gets the furniture object of the given index in the <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a> if valid. (Else, returns null).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - Index of the item within the array.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Furniture item of the given index.</dd>
</dl>
</li>
</ul>
<a name="add-rofaapp.Furniture-int-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public&nbsp;void&nbsp;add(<a href="../rofaapp/Furniture.html" title="class in rofaapp">Furniture</a>&nbsp;f,
int&nbsp;index,
boolean&nbsp;force)</pre>
<div class="block">Adds an item furniture to the <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a> at the given index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - Furniture object to add.</dd>
<dd><code>index</code> - Index within the <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a> array.</dd>
<dd><code>force</code> - If a furniture object already exists there, passing this as true will overwrite it. If this is false, will just skip.</dd>
</dl>
</li>
</ul>
<a name="del-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>del</h4>
<pre>public&nbsp;void&nbsp;del(int&nbsp;index)</pre>
<div class="block">Deletes (nulls) a furniture object in <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a> where the given index is. Then shifts everything in the array into order again.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - Index of item in the list that gets deleted.</dd>
</dl>
</li>
</ul>
<a name="deleteAll--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deleteAll</h4>
<pre>public&nbsp;void&nbsp;deleteAll()</pre>
<div class="block">Deletes (nulls) everything in the list.</div>
</li>
</ul>
<a name="getMaxSize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxSize</h4>
<pre>public&nbsp;int&nbsp;getMaxSize()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Max array size.</dd>
</dl>
</li>
</ul>
<a name="getCurrentSize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCurrentSize</h4>
<pre>public&nbsp;int&nbsp;getCurrentSize()</pre>
<div class="block">Current array size. (Will always be <a href="../rofaapp/ItemOrder.html#arraySize"><code>arraySize</code></a>).</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Int of the size of the array.</dd>
</dl>
</li>
</ul>
<a name="getFreeSpace--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFreeSpace</h4>
<pre>public&nbsp;int&nbsp;getFreeSpace()</pre>
<div class="block">Gets the number of free spaces within the <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Int of the number of spaces in the array available.</dd>
</dl>
</li>
</ul>
<a name="getPrice--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPrice</h4>
<pre>public&nbsp;double&nbsp;getPrice()</pre>
<div class="block">Gets the price of all the items within <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A double of the price of all the items.</dd>
</dl>
</li>
</ul>
<a name="isValidIndex-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isValidIndex</h4>
<pre>public&nbsp;boolean&nbsp;isValidIndex(int&nbsp;i)</pre>
<div class="block">Checks if the given number is a valid index (0 to <a href="../rofaapp/ItemOrder.html#arraySize"><code>arraySize</code></a>).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>i</code> - Index to check if it's valid.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>True/False based on if it's valid or not.</dd>
</dl>
</li>
</ul>
<a name="normalise--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>normalise</h4>
<pre>public&nbsp;void&nbsp;normalise()</pre>
<div class="block">Shifts all objects within <a href="../rofaapp/ItemOrder.html#orderList"><code>orderList</code></a> so that there are no gaps in between items in the array.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../rofaapp/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ItemOrder.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-files/index-1.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../rofaapp/ItemIcon.html" title="class in rofaapp"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../rofaapp/ItemTable.html" title="class in rofaapp"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?rofaapp/ItemOrder.html" target="_top">Frames</a></li>
<li><a href="ItemOrder.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>