aboutsummaryrefslogtreecommitdiff
path: root/target/site/jacoco/musichub.business/Song.java.html
diff options
context:
space:
mode:
Diffstat (limited to 'target/site/jacoco/musichub.business/Song.java.html')
-rw-r--r--target/site/jacoco/musichub.business/Song.java.html59
1 files changed, 59 insertions, 0 deletions
diff --git a/target/site/jacoco/musichub.business/Song.java.html b/target/site/jacoco/musichub.business/Song.java.html
new file mode 100644
index 0000000..f78cf39
--- /dev/null
+++ b/target/site/jacoco/musichub.business/Song.java.html
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="fr"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>Song.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">spoteezer</a> &gt; <a href="index.source.html" class="el_package">musichub.business</a> &gt; <span class="el_source">Song.java</span></div><h1>Song.java</h1><pre class="source lang-java linenums">package musichub.business;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+public class Song extends AudioElement {
+ private Genre genre;
+
+ public Song(String title, String artist, int length, String uid, String content, String genre) {
+<span class="fc" id="L11"> super(title, artist, length, uid, content);</span>
+<span class="fc" id="L12"> this.setGenre(genre);</span>
+<span class="fc" id="L13"> }</span>
+
+ public Song(String title, String artist, int length, String content, String genre) {
+<span class="fc" id="L16"> super(title, artist, length, content);</span>
+<span class="fc" id="L17"> this.setGenre(genre);</span>
+<span class="fc" id="L18"> }</span>
+
+ public Song(Element xmlElement) {
+<span class="fc" id="L21"> super(xmlElement);</span>
+<span class="fc" id="L22"> this.setGenre(xmlElement.getElementsByTagName(&quot;genre&quot;).item(0).getTextContent());</span>
+<span class="fc" id="L23"> }</span>
+
+ public String getGenre() {
+<span class="fc" id="L26"> return genre.getGenre();</span>
+ }
+
+ public void setGenre(String genre) {
+<span class="fc bfc" id="L30" title="All 6 branches covered."> switch (genre.toLowerCase()) {</span>
+<span class="fc" id="L31"> default -&gt; this.genre = Genre.JAZZ;</span>
+<span class="fc" id="L32"> case &quot;classic&quot; -&gt; this.genre = Genre.CLASSIC;</span>
+<span class="fc" id="L33"> case &quot;hiphop&quot; -&gt; this.genre = Genre.HIPHOP;</span>
+<span class="fc" id="L34"> case &quot;rock&quot; -&gt; this.genre = Genre.ROCK;</span>
+<span class="fc" id="L35"> case &quot;pop&quot; -&gt; this.genre = Genre.POP;</span>
+<span class="fc" id="L36"> case &quot;rap&quot; -&gt; this.genre = Genre.RAP;</span>
+ }
+<span class="fc" id="L38"> }</span>
+
+ public String toString() {
+<span class="fc" id="L41"> return super.toString() + &quot;, Genre = &quot; + getGenre() + &quot;\n&quot;;</span>
+ }
+
+ public void createXMLElement(Document document, Element parentElement) {
+ // song element
+<span class="fc" id="L46"> Element song = document.createElement(&quot;song&quot;);</span>
+
+<span class="fc" id="L48"> super.createXMLElement(document, song);</span>
+
+<span class="fc" id="L50"> Element genreElement = document.createElement(&quot;genre&quot;);</span>
+<span class="fc" id="L51"> genreElement.appendChild(document.createTextNode(genre.getGenre()));</span>
+<span class="fc" id="L52"> song.appendChild(genreElement);</span>
+
+<span class="fc" id="L54"> parentElement.appendChild(song);</span>
+<span class="fc" id="L55"> }</span>
+
+
+}
+</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.7.202105040129</span></div></body></html> \ No newline at end of file