1 | /**
|
---|
2 | *#########################################################################
|
---|
3 | *
|
---|
4 | * A component of the Gatherer application, part of the Greenstone digital
|
---|
5 | * library suite from the New Zealand Digital Library Project at the
|
---|
6 | * University of Waikato, New Zealand.
|
---|
7 | *
|
---|
8 | * <BR><BR>
|
---|
9 | *
|
---|
10 | * Author: John Thompson, Greenstone Digital Library, University of Waikato
|
---|
11 | *
|
---|
12 | * <BR><BR>
|
---|
13 | *
|
---|
14 | * Copyright (C) 1999 New Zealand Digital Library Project
|
---|
15 | *
|
---|
16 | * <BR><BR>
|
---|
17 | *
|
---|
18 | * This program is free software; you can redistribute it and/or modify
|
---|
19 | * it under the terms of the GNU General Public License as published by
|
---|
20 | * the Free Software Foundation; either version 2 of the License, or
|
---|
21 | * (at your option) any later version.
|
---|
22 | *
|
---|
23 | * <BR><BR>
|
---|
24 | *
|
---|
25 | * This program is distributed in the hope that it will be useful,
|
---|
26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
28 | * GNU General Public License for more details.
|
---|
29 | *
|
---|
30 | * <BR><BR>
|
---|
31 | *
|
---|
32 | * You should have received a copy of the GNU General Public License
|
---|
33 | * along with this program; if not, write to the Free Software
|
---|
34 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
35 | *########################################################################
|
---|
36 | */
|
---|
37 |
|
---|
38 |
|
---|
39 |
|
---|
40 |
|
---|
41 |
|
---|
42 |
|
---|
43 | package org.greenstone.gatherer.cdm;
|
---|
44 | /**************************************************************************************
|
---|
45 | * Title: Gatherer
|
---|
46 | * Description: The Gatherer: a tool for gathering and enriching a digital collection.
|
---|
47 | * Copyright: Copyright (c) 2001
|
---|
48 | * Company: The University of Waikato
|
---|
49 | * Written: 03/05/02
|
---|
50 | * Revised: 17/11/02 - Commented
|
---|
51 | **************************************************************************************/
|
---|
52 | import java.util.Vector;
|
---|
53 | import javax.swing.DefaultListModel;
|
---|
54 | import org.greenstone.gatherer.cdm.SubIndex;
|
---|
55 | /** Not to be confused with the SubIndex class, SubIndexes holds a Vector of SubIndex objects.
|
---|
56 | * @author John Thompson, Greenstone Digital Library, University of Waikato
|
---|
57 | * @version 2.2
|
---|
58 | */
|
---|
59 | public class SubIndexes
|
---|
60 | extends DefaultListModel {
|
---|
61 | public void changed() {
|
---|
62 | fireContentsChanged(this, 0, getSize() - 1);
|
---|
63 | }
|
---|
64 | /** Method to display the contents of this class as an entry in the collection configuration file. The line contains the key word, then a space separated series of index entries.
|
---|
65 | * @return A <strong>String</strong> representing this collection of indexes.
|
---|
66 | */
|
---|
67 | public String toString() {
|
---|
68 | String text = "indexsubcollections ";
|
---|
69 | for(int i = 0; i < size(); i++) {
|
---|
70 | text = text + ((SubIndex)get(i)).toString();
|
---|
71 | if(i < size() - 1) {
|
---|
72 | text = text + " ";
|
---|
73 | }
|
---|
74 | }
|
---|
75 | text = text + "\n";
|
---|
76 | return text;
|
---|
77 | }
|
---|
78 | }
|
---|