|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
ViewEvent.java | 100% | 100% | 100% | 100% |
|
1 |
/*
|
|
2 |
* Replica is published under the terms
|
|
3 |
* of the Apache Software License.
|
|
4 |
*/
|
|
5 |
package replica.group.event;
|
|
6 |
|
|
7 |
import java.util.Iterator;
|
|
8 |
import java.util.List;
|
|
9 |
|
|
10 |
import replica.group.Address;
|
|
11 |
|
|
12 |
/**
|
|
13 |
* Event class for view changed events.
|
|
14 |
*
|
|
15 |
* @author Pedro Costa
|
|
16 |
* @author Helder Silva
|
|
17 |
* @since 19/Jan/2004
|
|
18 |
*/
|
|
19 |
public class ViewEvent extends GroupEvent { |
|
20 |
|
|
21 |
private List view;
|
|
22 |
|
|
23 |
/**
|
|
24 |
* @param source
|
|
25 |
*/
|
|
26 | 32 |
public ViewEvent(Object source, List view) {
|
27 | 32 |
super(source);
|
28 | 32 |
setView( view); |
29 |
} |
|
30 |
|
|
31 |
/**
|
|
32 |
* @return
|
|
33 |
*/
|
|
34 | 2 |
public List getView() {
|
35 | 2 |
return view;
|
36 |
} |
|
37 |
|
|
38 |
/**
|
|
39 |
* @param list
|
|
40 |
*/
|
|
41 | 32 |
private void setView(List list) { |
42 | 32 |
view = list; |
43 |
} |
|
44 |
|
|
45 | 2 |
public String toString(){
|
46 | 2 |
StringBuffer result = new StringBuffer();
|
47 | 2 |
result.append("ViewEvent: {");
|
48 |
|
|
49 | 2 |
List view = getView(); |
50 | 2 |
for (Iterator iter = view.iterator(); iter.hasNext();) {
|
51 | 3 |
Address element = (Address) iter.next(); |
52 | 3 |
result.append("["+element+"] "); |
53 |
} |
|
54 | 2 |
result.append("}.");
|
55 |
|
|
56 | 2 |
return result.toString();
|
57 |
} |
|
58 |
|
|
59 |
} |
|
60 |
|
|