Biblioteca Java - Blame information for rev 32

Subversion Repositories:
Rev:
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>Controller.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 &quot;ElevatorCurs&quot; (powered by JaCoCo from EclEmma)</a> &gt; <a href="index.source.html" class="el_package">elevatorcurs.model</a> &gt; <span class="el_source">Controller.java</span></div><h1>Controller.java</h1><pre class="source lang-java linenums">
2 package elevatorcurs.model;
3 import java.util.LinkedList;
4 import java.util.NoSuchElementException;
5 /**
6  *
7  * @author Mihai Hulea mihai.hulea@aut.utcluj.ro
8  */
9 public class Controller {
10     private Elevator e;
11     private Job currentJob;
12     private LinkedList&lt;Job&gt; jobs;
13  
14 <span class="nc" id="L14">    public Controller(Elevator e) {</span>
15 <span class="nc" id="L15">        this.e = e;</span>
16 <span class="nc" id="L16">        jobs = new LinkedList&lt;&gt;();</span>
17 <span class="nc" id="L17">    }</span>
18  
19     public void step(){
20 <span class="nc bnc" id="L20" title="All 2 branches missed.">        if(currentJob!=null){</span>
21             //...
22 <span class="nc" id="L22">            int targetPosition = currentJob.getDestinationFloor() * 10;</span>
23 <span class="nc bnc" id="L23" title="All 2 branches missed.">            if(targetPosition &lt; e.getPosition()){</span>
24 <span class="nc" id="L24">                e.setCurrentDir(Direction.DOWN);</span>
25 <span class="nc bnc" id="L25" title="All 2 branches missed.">            }else if(targetPosition &gt; e.getPosition()){</span>
26 <span class="nc" id="L26">                e.setCurrentDir(Direction.UP);</span>
27             }else{
28 <span class="nc" id="L28">                e.setCurrentDir(Direction.HOLD);</span>
29 <span class="nc" id="L29">                System.out.println(&quot;ARRIVED!&quot;);</span>
30 <span class="nc" id="L30">                currentJob = null;</span>
31             }                        
32 <span class="nc" id="L32">        }else{</span>
33             //...
34 <span class="nc" id="L34">            currentJob = jobs.poll();</span>
35             /*try{
36                 currentJob = jobs.removeFirst();
37             }catch(NoSuchElementException e){
38  
39             }*/
40         }
41 <span class="nc" id="L41">    }</span>
42  
43     public void addJob(Job j){
44 <span class="nc" id="L44">        jobs.addLast(j);</span>
45 <span class="nc" id="L45">    }</span>
46  
47 }
48 </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>