diff options
author | Clyhtsuriva <61652557+clyhtsuriva@users.noreply.github.com> | 2021-06-28 21:40:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-28 21:40:03 +0000 |
commit | 1504d0255279133668b85f5c092f040a14fbc35f (patch) | |
tree | 0c9b9e927aa4d5f35ccc07e45e8abd973b2bad08 /target/site/jacoco/musichub.business/Song.java.html | |
parent | 48d56d9db8fe93f1e1799674fefabdfc677d2eb7 (diff) | |
parent | 49196ae84aea338dbc6cd10f4d135e4b717cdd1f (diff) |
Merging develop to master.
Diffstat (limited to 'target/site/jacoco/musichub.business/Song.java.html')
-rw-r--r-- | target/site/jacoco/musichub.business/Song.java.html | 59 |
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> > <a href="index.source.html" class="el_package">musichub.business</a> > <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("genre").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 -> this.genre = Genre.JAZZ;</span> +<span class="fc" id="L32"> case "classic" -> this.genre = Genre.CLASSIC;</span> +<span class="fc" id="L33"> case "hiphop" -> this.genre = Genre.HIPHOP;</span> +<span class="fc" id="L34"> case "rock" -> this.genre = Genre.ROCK;</span> +<span class="fc" id="L35"> case "pop" -> this.genre = Genre.POP;</span> +<span class="fc" id="L36"> case "rap" -> this.genre = Genre.RAP;</span> + } +<span class="fc" id="L38"> }</span> + + public String toString() { +<span class="fc" id="L41"> return super.toString() + ", Genre = " + getGenre() + "\n";</span> + } + + public void createXMLElement(Document document, Element parentElement) { + // song element +<span class="fc" id="L46"> Element song = document.createElement("song");</span> + +<span class="fc" id="L48"> super.createXMLElement(document, song);</span> + +<span class="fc" id="L50"> Element genreElement = document.createElement("genre");</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 |