librejack/docs/model/Person.html (22820B)
<!DOCTYPE HTML> <html lang="en"> <head> <!-- Generated by javadoc (20) on Sun May 21 12:02:46 SAST 2023 --> <title>Person (librejack)</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="dc.created" content="2023-05-21"> <meta name="description" content="declaration: package: model, class: Person"> <meta name="generator" content="javadoc/ClassWriterImpl"> <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style"> <script type="text/javascript" src="../script.js"></script> <script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script> <script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script> </head> <body class="class-declaration-page"> <script type="text/javascript">var pathtoroot = "../"; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="flex-box"> <header role="banner" class="flex-header"> <nav role="navigation"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button> <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> <li><a href="../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="nav-bar-cell1-rev">Class</li> <li><a href="class-use/Person.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#class">Help</a></li> </ul> <ul class="sub-nav-list-small"> <li> <p>Summary:</p> <ul> <li>Nested</li> <li>Field</li> <li><a href="#constructor-summary">Constr</a></li> <li><a href="#method-summary">Method</a></li> </ul> </li> <li> <p>Detail:</p> <ul> <li>Field</li> <li><a href="#constructor-detail">Constr</a></li> <li><a href="#method-detail">Method</a></li> </ul> </li> </ul> </div> <div class="sub-nav"> <div id="navbar-sub-list"> <ul class="sub-nav-list"> <li>Summary: </li> <li>Nested | </li> <li>Field | </li> <li><a href="#constructor-summary">Constr</a> | </li> <li><a href="#method-summary">Method</a></li> </ul> <ul class="sub-nav-list"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor-detail">Constr</a> | </li> <li><a href="#method-detail">Method</a></li> </ul> </div> <div class="nav-list-search"><a href="../search.html">SEARCH</a> <input type="text" id="search-input" disabled placeholder="Search"> <input type="reset" id="reset-button" disabled value="reset"> </div> </div> <!-- ========= END OF TOP NAVBAR ========= --> <span class="skip-nav" id="skip-navbar-top"></span></nav> </header> <div class="flex-content"> <main role="main"> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">model</a></div> <h1 title="Class Person" class="title">Class Person</h1> </div> <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a> <div class="inheritance">model.Person</div> </div> <section class="class-description" id="class-description"> <dl class="notes"> <dt>Direct Known Subclasses:</dt> <dd><code><a href="Dealer.html" title="class in model">Dealer</a></code>, <code><a href="Player.html" title="class in model">Player</a></code></dd> </dl> <hr> <div class="type-signature"><span class="modifiers">public abstract class </span><span class="element-name type-name-label">Person</span> <span class="extends-implements">extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div> <div class="block"><p> Parent class of the Player and Dealer Objects.</p> <p> Contains information about a person in a blackjack game, such as their name and hand.</p></div> <dl class="notes"> <dt>Author:</dt> <dd>Michael Neuper <a href="mailto:michael@michaelneuper.com">michael@michaelneuper.com</a></dd> <dt>See Also:</dt> <dd> <ul class="tag-list"> <li><a href="Player.html" title="class in model"><code>Player</code></a></li> <li><a href="Dealer.html" title="class in model"><code>Dealer</code></a></li> </ul> </dd> </dl> </section> <section class="summary"> <ul class="summary-list"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <li> <section class="constructor-summary" id="constructor-summary"> <h2>Constructor Summary</h2> <div class="caption"><span>Constructors</span></div> <div class="summary-table two-column-summary"> <div class="table-header col-first">Constructor</div> <div class="table-header col-last">Description</div> <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">Person</a>()</code></div> <div class="col-last even-row-color"> <div class="block">Constructs a <a href="Person.html" title="class in model"><code>Person</code></a> object with an empty <a href="../controller/Hand.html" title="class in controller"><code>Hand</code></a> and no name.</div> </div> </div> </section> </li> <!-- ========== METHOD SUMMARY =========== --> <li> <section class="method-summary" id="method-summary"> <h2>Method Summary</h2> <div id="method-summary-table"> <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button><button id="method-summary-table-tab6" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab6', 3)" class="table-tab">Deprecated Methods</button></div> <div id="method-summary-table.tabpanel" role="tabpanel"> <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> <div class="table-header col-first">Modifier and Type</div> <div class="table-header col-second">Method</div> <div class="table-header col-last">Description</div> <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../controller/Hand.html" title="class in controller">Hand</a></code></div> <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getHand()" class="member-name-link">getHand</a>()</code></div> <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> <div class="block">Returns the <a href="../controller/Hand.html" title="class in controller"><code>Hand</code></a> of the <a href="Person.html" title="class in model"><code>Person</code></a>.</div> </div> <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getName()" class="member-name-link">getName</a>()</code></div> <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> <div class="block">Returns the name of the <a href="Person.html" title="class in model"><code>Person</code></a>.</div> </div> <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#hasBlackjack()" class="member-name-link">hasBlackjack</a>()</code></div> <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> <div class="block">Checks if a <a href="Person.html" title="class in model"><code>Person</code></a> has blackjack.</div> </div> <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#hit(model.Deck,model.Deck)" class="member-name-link">hit</a><wbr>(<a href="Deck.html" title="class in model">Deck</a> deck, <a href="Deck.html" title="class in model">Deck</a> discard)</code></div> <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> <div class="block">Draws a <a href="Card.html" title="class in model"><code>Card</code></a> from the <a href="Deck.html" title="class in model"><code>Deck</code></a> and adds it to the person's <a href="../controller/Hand.html" title="class in controller"><code>Hand</code></a>.</div> </div> <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#printFilePath(int)" class="member-name-link">printFilePath</a><wbr>(int i)</code></div> <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> <div class="block">Prints the file path of a <a href="Card.html" title="class in model"><code>Card</code></a> at a given index</div> </div> <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#printHand()" class="member-name-link">printHand</a>()</code></div> <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> <div class="block">Prints a formatted version of the person's <a href="../controller/Hand.html" title="class in controller"><code>Hand</code></a>.</div> </div> <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code>void</code></div> <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#setHand(controller.Hand)" class="member-name-link">setHand</a><wbr>(<a href="../controller/Hand.html" title="class in controller">Hand</a> hand)</code></div> <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"> <div class="block"><span class="deprecated-label">Deprecated.</span></div> </div> <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setName(java.lang.String)" class="member-name-link">setName</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</code></div> <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> <div class="block">Sets the name of the <a href="Person.html" title="class in model"><code>Person</code></a>.</div> </div> </div> </div> </div> <div class="inherited-list"> <h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div> </section> </li> </ul> </section> <section class="details"> <ul class="details-list"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <li> <section class="constructor-details" id="constructor-detail"> <h2>Constructor Details</h2> <ul class="member-list"> <li> <section class="detail" id="<init>()"> <h3>Person</h3> <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">Person</span>()</div> <div class="block">Constructs a <a href="Person.html" title="class in model"><code>Person</code></a> object with an empty <a href="../controller/Hand.html" title="class in controller"><code>Hand</code></a> and no name.</div> </section> </li> </ul> </section> </li> <!-- ============ METHOD DETAIL ========== --> <li> <section class="method-details" id="method-detail"> <h2>Method Details</h2> <ul class="member-list"> <li> <section class="detail" id="getHand()"> <h3>getHand</h3> <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="../controller/Hand.html" title="class in controller">Hand</a></span> <span class="element-name">getHand</span>()</div> <div class="block">Returns the <a href="../controller/Hand.html" title="class in controller"><code>Hand</code></a> of the <a href="Person.html" title="class in model"><code>Person</code></a>.</div> <dl class="notes"> <dt>Returns:</dt> <dd>the <a href="../controller/Hand.html" title="class in controller"><code>Hand</code></a> of the <a href="Person.html" title="class in model"><code>Person</code></a></dd> </dl> </section> </li> <li> <section class="detail" id="setHand(controller.Hand)"> <h3>setHand</h3> <div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a> </span><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setHand</span><wbr><span class="parameters">(<a href="../controller/Hand.html" title="class in controller">Hand</a> hand)</span></div> <div class="deprecation-block"><span class="deprecated-label">Deprecated.</span></div> <div class="block">Sets the <a href="../controller/Hand.html" title="class in controller"><code>Hand</code></a> of the <a href="Person.html" title="class in model"><code>Person</code></a>.</div> <dl class="notes"> <dt>Parameters:</dt> <dd><code>hand</code> - the <a href="../controller/Hand.html" title="class in controller"><code>Hand</code></a> to set</dd> </dl> </section> </li> <li> <section class="detail" id="getName()"> <h3>getName</h3> <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getName</span>()</div> <div class="block">Returns the name of the <a href="Person.html" title="class in model"><code>Person</code></a>.</div> <dl class="notes"> <dt>Returns:</dt> <dd>the name of the <a href="Person.html" title="class in model"><code>Person</code></a></dd> </dl> </section> </li> <li> <section class="detail" id="setName(java.lang.String)"> <h3>setName</h3> <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setName</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</span></div> <div class="block">Sets the name of the <a href="Person.html" title="class in model"><code>Person</code></a>.</div> <dl class="notes"> <dt>Parameters:</dt> <dd><code>name</code> - the name to set</dd> </dl> </section> </li> <li> <section class="detail" id="hasBlackjack()"> <h3>hasBlackjack</h3> <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">hasBlackjack</span>()</div> <div class="block">Checks if a <a href="Person.html" title="class in model"><code>Person</code></a> has blackjack.</div> <dl class="notes"> <dt>Returns:</dt> <dd><code>true</code> if the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html" title="class or interface in java.util" class="external-link"><code>ArrayList</code></a> has a blackjack, <code>false</code> otherwise</dd> </dl> </section> </li> <li> <section class="detail" id="printHand()"> <h3>printHand</h3> <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">printHand</span>()</div> <div class="block">Prints a formatted version of the person's <a href="../controller/Hand.html" title="class in controller"><code>Hand</code></a>.</div> <dl class="notes"> <dt>Returns:</dt> <dd>a formatted <code>String</code> representing the person's <a href="../controller/Hand.html" title="class in controller"><code>Hand</code></a></dd> </dl> </section> </li> <li> <section class="detail" id="printFilePath(int)"> <h3>printFilePath</h3> <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">printFilePath</span><wbr><span class="parameters">(int i)</span></div> <div class="block">Prints the file path of a <a href="Card.html" title="class in model"><code>Card</code></a> at a given index</div> <dl class="notes"> <dt>Parameters:</dt> <dd><code>i</code> - index of the <a href="Card.html" title="class in model"><code>Card</code></a></dd> <dt>Returns:</dt> <dd>file path of the <a href="Card.html" title="class in model"><code>Card</code></a> at index <code>i</code></dd> </dl> </section> </li> <li> <section class="detail" id="hit(model.Deck,model.Deck)"> <h3>hit</h3> <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">hit</span><wbr><span class="parameters">(<a href="Deck.html" title="class in model">Deck</a> deck, <a href="Deck.html" title="class in model">Deck</a> discard)</span></div> <div class="block">Draws a <a href="Card.html" title="class in model"><code>Card</code></a> from the <a href="Deck.html" title="class in model"><code>Deck</code></a> and adds it to the person's <a href="../controller/Hand.html" title="class in controller"><code>Hand</code></a>. If the <a href="Deck.html" title="class in model"><code>Deck</code></a> has no cards, the <a href="Deck.html" title="class in model"><code>Deck</code></a> is reloaded from the discard pile.</div> <dl class="notes"> <dt>Parameters:</dt> <dd><code>deck</code> - the <a href="Deck.html" title="class in model"><code>Deck</code></a> to draw from</dd> <dd><code>discard</code> - the discard pile to reload from if the <a href="Deck.html" title="class in model"><code>Deck</code></a> is empty</dd> </dl> </section> </li> </ul> </section> </li> </ul> </section> <!-- ========= END OF CLASS DATA ========= --> </main> </div> </div> </body> </html>