01: /*
02: ** Java cvs client library package.
03: ** Copyright (c) 1997-2002 by Timothy Gerard Endres
04: **
05: ** This program is free software.
06: **
07: ** You may redistribute it and/or modify it under the terms of the GNU
08: ** Library General Public License (LGPL) as published by the Free Software
09: ** Foundation.
10: **
11: ** Version 2 of the license should be included with this distribution in
12: ** the file LICENSE.txt, as well as License.html. If the license is not
13: ** included with this distribution, you may find a copy at the FSF web
14: ** site at 'www.gnu.org' or 'www.fsf.org', or you may write to the Free
15: ** Software Foundation at 59 Temple Place - Suite 330, Boston, MA 02111 USA.
16: **
17: ** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
18: ** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
19: ** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
20: ** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
21: ** REDISTRIBUTION OF THIS SOFTWARE.
22: **
23: */
24:
25: package com.ice.cvsc;
26:
27: import java.lang.*;
28: import java.io.*;
29: import java.util.*;
30:
31: /**
32: * Implements a Vector subclass that handles CVSResonseItems
33: * from CVSRequest objects.
34: *
35: * @version $Revision: 2.2 $
36: * @author Timothy Gerard Endres, <a href="mailto:time@ice.com">time@ice.com</a>.
37: * @see CVSClient
38: * @see CVSProject
39: * @see CVSRequest
40: * @see CVSResponse
41: * @see CVSResponseItem
42: */
43:
44: public class CVSRespItemVector extends Vector {
45: static public final String RCS_ID = "$Id: CVSRespItemVector.java,v 2.2 2003/07/27 01:08:32 time Exp $";
46: static public final String RCS_REV = "$Revision: 2.2 $";
47:
48: public CVSRespItemVector() {
49: super ();
50: }
51:
52: public CVSRespItemVector(int initCap) {
53: super (initCap);
54: }
55:
56: public CVSRespItemVector(int initCap, int capIncr) {
57: super (initCap, capIncr);
58: }
59:
60: public CVSResponseItem itemAt(int index) {
61: return (CVSResponseItem) this .elementAt(index);
62: }
63:
64: public void appendItem(CVSResponseItem item) {
65: this .addElement(item);
66: }
67:
68: public void printResponseItemList(PrintStream out, String prefix) {
69: for (int i = 0; i < this .size(); ++i) {
70: CVSResponseItem item = this .itemAt(i);
71:
72: out.print(prefix + "ITEM ");
73: out.print("type '" + item.getType() + "' ");
74: out.println("");
75: }
76: }
77:
78: }
|