EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.scheduler.priority.impl]

COVERAGE SUMMARY FOR SOURCE FILE [PriorityManagerImpl.java]

nameclass, %method, %block, %line, %
PriorityManagerImpl.java0%   (0/5)0%   (0/24)0%   (0/222)0%   (0/43)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PriorityManagerImpl0%   (0/1)0%   (0/10)0%   (0/132)0%   (0/28)
<static initializer> 0%   (0/1)0%   (0/8)0%   (0/1)
PriorityManagerImpl (int, int, int, int, int, int): void 0%   (0/1)0%   (0/90)0%   (0/19)
decreasing (): Iterable 0%   (0/1)0%   (0/5)0%   (0/1)
getAveragePriority (): IPriority 0%   (0/1)0%   (0/4)0%   (0/1)
getDefaultPriority (): IPriority 0%   (0/1)0%   (0/4)0%   (0/1)
getHighPriority (): IPriority 0%   (0/1)0%   (0/4)0%   (0/1)
getHighestPriority (): IPriority 0%   (0/1)0%   (0/4)0%   (0/1)
getLowPriority (): IPriority 0%   (0/1)0%   (0/4)0%   (0/1)
getLowestPriority (): IPriority 0%   (0/1)0%   (0/4)0%   (0/1)
increasing (): Iterable 0%   (0/1)0%   (0/5)0%   (0/1)
     
class PriorityManagerImpl$10%   (0/1)0%   (0/3)0%   (0/14)0%   (0/3)
PriorityManagerImpl$1 (PriorityManagerImpl): void 0%   (0/1)0%   (0/6)0%   (0/2)
access$0 (PriorityManagerImpl$1): PriorityManagerImpl 0%   (0/1)0%   (0/3)0%   (0/1)
iterator (): Iterator 0%   (0/1)0%   (0/5)0%   (0/1)
     
class PriorityManagerImpl$1$10%   (0/1)0%   (0/4)0%   (0/31)0%   (0/8)
PriorityManagerImpl$1$1 (PriorityManagerImpl$1): void 0%   (0/1)0%   (0/12)0%   (0/3)
hasNext (): boolean 0%   (0/1)0%   (0/8)0%   (0/1)
next (): IPriority 0%   (0/1)0%   (0/10)0%   (0/3)
remove (): void 0%   (0/1)0%   (0/1)0%   (0/1)
     
class PriorityManagerImpl$20%   (0/1)0%   (0/3)0%   (0/14)0%   (0/3)
PriorityManagerImpl$2 (PriorityManagerImpl): void 0%   (0/1)0%   (0/6)0%   (0/2)
access$0 (PriorityManagerImpl$2): PriorityManagerImpl 0%   (0/1)0%   (0/3)0%   (0/1)
iterator (): Iterator 0%   (0/1)0%   (0/5)0%   (0/1)
     
class PriorityManagerImpl$2$10%   (0/1)0%   (0/4)0%   (0/31)0%   (0/8)
PriorityManagerImpl$2$1 (PriorityManagerImpl$2): void 0%   (0/1)0%   (0/12)0%   (0/3)
hasNext (): boolean 0%   (0/1)0%   (0/8)0%   (0/1)
next (): IPriority 0%   (0/1)0%   (0/10)0%   (0/3)
remove (): void 0%   (0/1)0%   (0/1)0%   (0/1)

1package de.uka.ipd.sdq.scheduler.priority.impl;
2 
3import java.util.Iterator;
4 
5import de.uka.ipd.sdq.scheduler.priority.IPriority;
6import de.uka.ipd.sdq.scheduler.priority.IPriorityManager;
7 
8 
9public class PriorityManagerImpl implements IPriorityManager {
10 
11        protected IPriority highestPriority;
12        protected IPriority highPriority;
13        protected IPriority averagePriority;
14        protected IPriority lowPriority;
15        protected IPriority lowestPriority;
16        protected IPriority defaultPriority;
17        protected int direction;
18        protected int highest_value;
19        protected int lowest_value;
20        
21        public PriorityManagerImpl(int highest_value, int high_value, int average_value, int low_value, int lowest_value, int default_value){
22                assert (highest_value >= high_value && 
23                        high_value >= average_value && 
24                        average_value >= low_value && 
25                        low_value >= lowest_value) || 
26                        (highest_value <= high_value && 
27                        high_value <= average_value && 
28                        average_value <= low_value && 
29                        low_value <= lowest_value) : "Priorities must be ordered!";
30                
31                direction = highest_value > lowest_value ? 1 : -1;
32                this.highest_value = highest_value;
33                this.lowest_value = lowest_value;
34                
35                this.highestPriority = new PriorityImpl(highest_value, this);
36                this.highPriority = new PriorityImpl(high_value, this);
37                this.averagePriority = new PriorityImpl(average_value, this);
38                this.lowPriority = new PriorityImpl(low_value, this);
39                this.lowestPriority = new PriorityImpl(lowest_value, this);
40                this.defaultPriority = new PriorityImpl(default_value, this);
41        }
42        
43        
44        public Iterable<IPriority> decreasing() {
45                return new Iterable<IPriority>(){
46                        public Iterator<IPriority> iterator() {
47                                return new Iterator<IPriority>(){
48                                        IPriority current = highestPriority.clone();
49                                        public boolean hasNext() {
50                                                return lowestPriority.lessOrEqual(current);
51                                        }
52                                        public IPriority next() {
53                                                IPriority result = current;
54                                                current = current.decrease();
55                                                return result;
56                                        }
57                                        public void remove() {
58                                        }
59                                };
60                        }
61                };
62        }
63        
64        public Iterable<IPriority> increasing() {
65                return new Iterable<IPriority>(){
66                        public Iterator<IPriority> iterator() {
67                                return new Iterator<IPriority>(){
68                                        IPriority current = lowestPriority.clone(); 
69                                        public boolean hasNext() {
70                                                return current.lessOrEqual(highestPriority);
71                                        }
72                                        public IPriority next() {
73                                                IPriority result = current;
74                                                current = current.increase();
75                                                return result;
76                                        }
77                                        public void remove() {
78                                        }
79                                };
80                        }
81                };
82        }
83        
84        public IPriority getDefaultPriority() {
85                return defaultPriority.clone();
86        }
87        
88        public IPriority getHighestPriority() {
89                return highestPriority.clone();
90        }
91        
92        public IPriority getLowestPriority() {
93                return lowestPriority.clone();
94        }
95 
96        public IPriority getAveragePriority() {
97                return averagePriority.clone();
98        }
99 
100        public IPriority getHighPriority() {
101                return highPriority.clone();
102        }
103 
104        public IPriority getLowPriority() {
105                return lowPriority.clone();
106        }
107}

[all classes][de.uka.ipd.sdq.scheduler.priority.impl]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov