Commit 0acae962 authored by Carl Johan Gützkow's avatar Carl Johan Gützkow 🎮
Browse files

fix: changed arraylist to interface list where possible

parent d7cb50a1
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<title>All Classes and Interfaces</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
......@@ -66,11 +66,11 @@ loadScripts(document, 'script');</script>
<div class="block">Class that extends Application
from javafx.</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/Army.html" title="class in edu.ntnu.idatt2001.carljgu.units">Army</a></div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/army/Army.html" title="class in edu.ntnu.idatt2001.carljgu.army">Army</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">public class Army.</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/ArmyFileHandler.html" title="class in edu.ntnu.idatt2001.carljgu">ArmyFileHandler</a></div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/army/ArmyFileHandler.html" title="class in edu.ntnu.idatt2001.carljgu.army">ArmyFileHandler</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="block">Handles writing, reading and importing
armies to and from a file.</div>
......@@ -129,7 +129,7 @@ loadScripts(document, 'script');</script>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">Deprecated.
<div class="deprecation-comment">06.05.2022</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab3"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a></div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab3"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/battle/Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu.battle">Terrain</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab3">
<div class="block">An enum that represents the different terrains
that the battles can occur on.</div>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<title>All Packages</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
......@@ -57,16 +57,18 @@ loadScripts(document, 'script');</script>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/package-summary.html">edu.ntnu.idatt2001.carljgu</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/battle/package-summary.html">edu.ntnu.idatt2001.carljgu.battle</a></div>
<div class="col-first odd-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/army/package-summary.html">edu.ntnu.idatt2001.carljgu.army</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/client/package-summary.html">edu.ntnu.idatt2001.carljgu.client</a></div>
<div class="col-first even-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/battle/package-summary.html">edu.ntnu.idatt2001.carljgu.battle</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/client/dialogs/package-summary.html">edu.ntnu.idatt2001.carljgu.client.dialogs</a></div>
<div class="col-first odd-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/client/package-summary.html">edu.ntnu.idatt2001.carljgu.client</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/package-summary.html">edu.ntnu.idatt2001.carljgu.units</a></div>
<div class="col-first even-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/client/dialogs/package-summary.html">edu.ntnu.idatt2001.carljgu.client.dialogs</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/specialized/package-summary.html">edu.ntnu.idatt2001.carljgu.units.specialized</a></div>
<div class="col-first odd-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/package-summary.html">edu.ntnu.idatt2001.carljgu.units</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="edu.ntnu.idatt2001.carljgu.client/edu/ntnu/idatt2001/carljgu/units/specialized/package-summary.html">edu.ntnu.idatt2001.carljgu.units.specialized</a></div>
<div class="col-last even-row-color">&nbsp;</div>
</div>
</main>
</div>
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<title>Constant Field Values</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<title>Deprecated List</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 21:33:49 CEST 2022 -->
<title>ArmyFileHandler</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
......@@ -74,7 +74,7 @@ loadScripts(document, 'script');</script>
<h1 title="Class ArmyFileHandler" class="title">Class ArmyFileHandler</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">edu.ntnu.idatt2001.carljgu.ArmyFileHandler</div>
<div class="inheritance">edu.ntnu.idatt2001.carljgu.army.ArmyFileHandler</div>
</div>
<section class="class-description" id="class-description">
<hr>
......@@ -123,7 +123,7 @@ loadScripts(document, 'script');</script>
<div class="block">Uses the system default file explorer to get
a file path of the user's choice.</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/en/java/javase/17/docs/api/java.base/java/util/ArrayList.html" title="class or interface in java.util" class="external-link">ArrayList</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</code></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/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getReadLinesSkipped()" class="member-name-link">getReadLinesSkipped</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the amount of units
......@@ -176,7 +176,7 @@ loadScripts(document, 'script');</script>
<li>
<section class="detail" id="getReadLinesSkipped()">
<h3>getReadLinesSkipped</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ArrayList.html" title="class or interface in java.util" class="external-link">ArrayList</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</span>&nbsp;<span class="element-name">getReadLinesSkipped</span>()</div>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</span>&nbsp;<span class="element-name">getReadLinesSkipped</span>()</div>
<div class="block">Gets the amount of units
that were skipped when reading from file.</div>
<dl class="notes">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<title>FileExtensionException</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 20:01:56 CEST 2022 -->
<!-- Generated by javadoc (17) on Mon May 16 21:33:49 CEST 2022 -->
<title>Terrain</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
......@@ -75,7 +75,7 @@ loadScripts(document, 'script');</script>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link">java.lang.Enum</a>&lt;<a href="Terrain.html" title="enum class in edu.ntnu.idatt2001.carljgu">Terrain</a>&gt;
<div class="inheritance">edu.ntnu.idatt2001.carljgu.Terrain</div>
<div class="inheritance">edu.ntnu.idatt2001.carljgu.battle.Terrain</div>
</div>
</div>
<section class="class-description" id="class-description">
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<title>ArmyFileHandler</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="2022-05-16">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.army, class: ArmyFileHandler">
<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">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-3.5.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 evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
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">
<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="../../../../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</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>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</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="module-label-in-type">Module</span>&nbsp;<a href="../../../../../module-summary.html">edu.ntnu.idatt2001.carljgu.client</a></div>
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">edu.ntnu.idatt2001.carljgu.army</a></div>
<h1 title="Class ArmyFileHandler" class="title">Class ArmyFileHandler</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">edu.ntnu.idatt2001.carljgu.army.ArmyFileHandler</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">ArmyFileHandler</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
<div class="block">Handles writing, reading and importing
armies to and from a file.</div>
<dl class="notes">
<dt>Version:</dt>
<dd>1.4 1.05.2022</dd>
<dt>Author:</dt>
<dd>Carl Gützkow</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">ArmyFileHandler</a>()</code></div>
<div class="col-last even-row-color">
<div class="block">Constructor which initiates the readLinesSkipped arraylist</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></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="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/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="#getFilePath(java.lang.String)" class="member-name-link">getFilePath</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;fileChooserType)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Uses the system default file explorer to get
a file path of the user's choice.</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/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getReadLinesSkipped()" class="member-name-link">getReadLinesSkipped</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the amount of units
that were skipped when reading from file.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Army.html" title="class in edu.ntnu.idatt2001.carljgu.army">Army</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#readArmyFromFile(java.lang.String)" class="member-name-link">readArmyFromFile</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;filePath)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Finds a specified csv file
and converts it to an army if it can.</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="#writeToFile(edu.ntnu.idatt2001.carljgu.army.Army,java.lang.String)" class="member-name-link">writeToFile</a><wbr>(<a href="Army.html" title="class in edu.ntnu.idatt2001.carljgu.army">Army</a>&nbsp;army,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;filePath)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Creates a file to write on or writes to an existing file.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/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/en/java/javase/17/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/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="&lt;init&gt;()">
<h3>ArmyFileHandler</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">ArmyFileHandler</span>()</div>
<div class="block">Constructor which initiates the readLinesSkipped arraylist</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="getReadLinesSkipped()">
<h3>getReadLinesSkipped</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</span>&nbsp;<span class="element-name">getReadLinesSkipped</span>()</div>
<div class="block">Gets the amount of units
that were skipped when reading from file.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>readLinesSkipped - amount of lines skipped when
reading army from file because of invalid unit.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeToFile(edu.ntnu.idatt2001.carljgu.army.Army,java.lang.String)">
<h3>writeToFile</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">writeToFile</span><wbr><span class="parameters">(<a href="Army.html" title="class in edu.ntnu.idatt2001.carljgu.army">Army</a>&nbsp;army,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;filePath)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a>,
<a href="../FileExtensionException.html" title="class in edu.ntnu.idatt2001.carljgu">FileExtensionException</a>,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<div class="block">Creates a file to write on or writes to an existing file.
The client should handle any exception that is thrown
with an error message the client creates.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>army</code> - Army - A collection of units that is written to a file</dd>
<dd><code>filePath</code> - String - name of the file and its full path</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - thrown if the army is a null object</dd>
<dd><code><a href="../FileExtensionException.html" title="class in edu.ntnu.idatt2001.carljgu">FileExtensionException</a></code> - thrown if the file extension is not csv
because of the file name</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - thrown if an I/O error occurs</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readArmyFromFile(java.lang.String)">
<h3>readArmyFromFile</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Army.html" title="class in edu.ntnu.idatt2001.carljgu.army">Army</a></span>&nbsp;<span class="element-name">readArmyFromFile</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;filePath)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a>,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/FileNotFoundException.html" title="class or interface in java.io" class="external-link">FileNotFoundException</a>,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></span></div>
<div class="block">Finds a specified csv file
and converts it to an army if it can.
If there is a line which has an unreadable unit
it will continue on the next line
The client should handle any exception that is thrown
with an error message the client creates.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>filePath</code> - - String - name of the file path to read from</dd>
<dt>Returns:</dt>
<dd>army - Army - an army read from a csv file</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - thrown if an I/O error occurs</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/FileNotFoundException.html" title="class or interface in java.io" class="external-link">FileNotFoundException</a></code> - thrown if the filepath was not found</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - thrown if file extension is not csv or if army could not be created.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getFilePath(java.lang.String)">
<h3>getFilePath</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">getFilePath</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;fileChooserType)</span></div>
<div class="block">Uses the system default file explorer to get
a file path of the user's choice.
If a user closes the file chooser,
null is returned.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>fileChooserType</code> - String - OPEN or SAVE depending on whether
the user wants to open a file or write to a file</dd>
<dt>Returns:</dt>
<dd>filePath - String - the file path of a csv file for an army</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</div>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<title>edu.ntnu.idatt2001.carljgu.army</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="2022-05-16">
<meta name="description" content="declaration: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.army">
<meta name="generator" content="javadoc/PackageWriterImpl">
<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">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="package-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">
<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="../../../../../module-summary.html">Module</a></li>
<li class="nav-bar-cell1-rev">Package</li>
<li>Class</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#package">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Package:&nbsp;</li>
<li>Description&nbsp;|&nbsp;</li>
<li><a href="#related-package-summary">Related Packages</a>&nbsp;|&nbsp;</li>
<li><a href="#class-summary">Classes and Interfaces</a></li>
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<div class="header">
<div class="sub-title"><span class="module-label-in-package">Module</span>&nbsp;<a href="../../../../../module-summary.html">edu.ntnu.idatt2001.carljgu.client</a></div>
<h1 title="Package edu.ntnu.idatt2001.carljgu.army" class="title">Package edu.ntnu.idatt2001.carljgu.army</h1>
</div>
<hr>
<div class="package-signature">package <span class="element-name">edu.ntnu.idatt2001.carljgu.army</span></div>
<section class="summary">
<ul class="summary-list">
<li>
<div id="related-package-summary">
<div class="caption"><span>Related Packages</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Package</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><a href="../package-summary.html">edu.ntnu.idatt2001.carljgu</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="../battle/package-summary.html">edu.ntnu.idatt2001.carljgu.battle</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="../client/package-summary.html">edu.ntnu.idatt2001.carljgu.client</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="../units/package-summary.html">edu.ntnu.idatt2001.carljgu.units</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
</div>
</div>
</li>
<li>
<div id="class-summary">
<div class="caption"><span>Classes</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Class</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color class-summary class-summary-tab2"><a href="Army.html" title="class in edu.ntnu.idatt2001.carljgu.army">Army</a></div>
<div class="col-last even-row-color class-summary class-summary-tab2">
<div class="block">public class Army.</div>
</div>
<div class="col-first odd-row-color class-summary class-summary-tab2"><a href="ArmyFileHandler.html" title="class in edu.ntnu.idatt2001.carljgu.army">ArmyFileHandler</a></div>
<div class="col-last odd-row-color class-summary class-summary-tab2">
<div class="block">Handles writing, reading and importing
armies to and from a file.</div>
</div>
</div>
</div>
</li>
</ul>
</section>
</main>
</div>
</div>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Mon May 16 21:38:10 CEST 2022 -->
<title>edu.ntnu.idatt2001.carljgu.army Class Hierarchy</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="2022-05-16">
<meta name="description" content="tree: module: edu.ntnu.idatt2001.carljgu.client, package: edu.ntnu.idatt2001.carljgu.army">
<meta name="generator" content="javadoc/PackageTreeWriter">
<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">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="package-tree-page">
<script type="text/javascript">var pathtoroot = "../../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>