01: /*
02: * Copyright (C) Chaperon. All rights reserved.
03: * -------------------------------------------------------------------------
04: * This software is published under the terms of the Apache Software License
05: * version 1.1, a copy of which has been included with this distribution in
06: * the LICENSE file.
07: */
08:
09: package net.sourceforge.chaperon.build.conflict;
10:
11: import java.util.Vector;
12:
13: /**
14: * The class represents a collection of conflicts.
15: *
16: * @author <a href="mailto:stephan@apache.org">Stephan Michels </a>
17: * @version CVS $Id: ConflictList.java,v 1.3 2003/12/09 19:55:52 benedikta Exp $
18: */
19: public class ConflictList {
20: private Vector list = new Vector();
21:
22: /**
23: * Add a conflict to this list
24: *
25: * @param conflict Conflict, which should be apped
26: */
27: public void addConflict(Conflict conflict) {
28: list.addElement(conflict);
29: }
30:
31: /**
32: * Return a conflict giving by an index
33: *
34: * @param index Index of conflict
35: *
36: * @return Conflict.
37: */
38: public Conflict getConflict(int index) {
39: return (Conflict) list.elementAt(index);
40: }
41:
42: /**
43: * Returns the count of conflicts in the list
44: *
45: * @return Count of conflict n this list
46: */
47: public int getConflictCount() {
48: return list.size();
49: }
50:
51: /**
52: * Return a string representation of this list.
53: *
54: * @return String representation of this list.
55: */
56: public String toString() {
57: StringBuffer buffer = new StringBuffer();
58:
59: for (int i = 0; i < list.size(); i++) {
60: buffer.append(getConflict(i));
61: buffer.append("\n");
62: }
63:
64: return buffer.toString();
65: }
66: }
|