Biblioteca Java - Blame information for rev 32
Subversion Repositories:
(root)/Courses and labs samples/ISP/Exemple_ISP_Cluj_2015/ElevatorCurs/.jacocoverage/report.html/elevatorcurs.model/Elevator.java.html
Rev | Author | Line No. | Line |
---|---|---|---|
32 | mihai | 1 | <?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="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>Elevator.java</title><link rel="stylesheet" href="../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">JaCoCoverage analysis of project "ElevatorCurs" (powered by JaCoCo from EclEmma)</a> > <a href="index.source.html" class="el_package">elevatorcurs.model</a> > <span class="el_source">Elevator.java</span></div><h1>Elevator.java</h1><pre class="source lang-java linenums"> |
2 | package elevatorcurs.model; | ||
3 | |||
4 | import java.util.Observable; | ||
5 | |||
6 | /** | ||
7 | * | ||
8 | * @author Mihai Hulea mihai.hulea@aut.utcluj.ro | ||
9 | */ | ||
10 | public class Elevator extends Observable{ | ||
11 | private int position; | ||
12 | private Direction currentDir; | ||
13 | |||
14 | <span class="fc" id="L14"> public Elevator() {</span> | ||
15 | <span class="fc" id="L15"> currentDir = Direction.HOLD;</span> | ||
16 | <span class="fc" id="L16"> }</span> | ||
17 | |||
18 | public void move(){ | ||
19 | <span class="pc bpc" id="L19" title="2 of 3 branches missed."> switch(currentDir){</span> | ||
20 | case UP:{ | ||
21 | <span class="nc" id="L21"> position = position + 1; </span> | ||
22 | <span class="nc" id="L22"> setChanged();</span> | ||
23 | <span class="nc" id="L23"> notifyObservers(this);</span> | ||
24 | <span class="nc" id="L24"> break;</span> | ||
25 | } | ||
26 | case DOWN:{ | ||
27 | <span class="nc" id="L27"> position = position - 1; </span> | ||
28 | <span class="nc" id="L28"> setChanged();</span> | ||
29 | <span class="nc" id="L29"> notifyObservers(this);</span> | ||
30 | <span class="nc" id="L30"> break;</span> | ||
31 | } | ||
32 | case HOLD: {} | ||
33 | } | ||
34 | <span class="fc" id="L34"> }</span> | ||
35 | |||
36 | public void setCurrentDir(Direction dir){ | ||
37 | <span class="fc" id="L37"> this.currentDir = dir;</span> | ||
38 | <span class="fc" id="L38"> }</span> | ||
39 | |||
40 | public Direction getCurrentDir(){ | ||
41 | <span class="fc" id="L41"> return currentDir;</span> | ||
42 | } | ||
43 | |||
44 | public int getPosition(){ | ||
45 | <span class="fc" id="L45"> return position;</span> | ||
46 | } | ||
47 | |||
48 | public String toString(){ | ||
49 | <span class="fc" id="L49"> return "Elevator: pos="+position+": dir="+currentDir;</span> | ||
50 | } | ||
51 | } | ||
52 | </pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.4.201502262128</span></div></body></html> |