Original 2.4
[marc4j.git] / src / org / marc4j / marc / DataField.java
1 //$Id: DataField.java,v 1.9 2005/08/03 18:55:46 bpeters Exp $\r
2 /**\r
3  * Copyright (C) 2004 Bas Peters\r
4  *\r
5  * This file is part of MARC4J\r
6  *\r
7  * MARC4J is free software; you can redistribute it and/or\r
8  * modify it under the terms of the GNU Lesser General Public \r
9  * License as published by the Free Software Foundation; either \r
10  * version 2.1 of the License, or (at your option) any later version.\r
11  *\r
12  * MARC4J is distributed in the hope that it will be useful,\r
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
15  * Lesser General Public License for more details.\r
16  *\r
17  * You should have received a copy of the GNU Lesser General Public \r
18  * License along with MARC4J; if not, write to the Free Software\r
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
20  */\r
21 package org.marc4j.marc;\r
22 \r
23 import java.util.List;\r
24 \r
25 /**\r
26  * Represents a data field in a MARC record.\r
27  * \r
28  * @author Bas Peters\r
29  * @version $Revision: 1.9 $\r
30  */\r
31 public interface DataField extends VariableField {\r
32 \r
33         /**\r
34          * Returns the first indicator\r
35          * \r
36          * @return char - the first indicator\r
37          */\r
38         public char getIndicator1();\r
39 \r
40         /**\r
41          * Sets the first indicator.\r
42          * \r
43          * @param ind1\r
44          *            the first indicator\r
45          */\r
46         public void setIndicator1(char ind1);\r
47 \r
48         /**\r
49          * Returns the second indicator\r
50          * \r
51          * @return char - the second indicator\r
52          */\r
53         public char getIndicator2();\r
54 \r
55         /**\r
56          * Sets the second indicator.\r
57          * \r
58          * @param ind2\r
59          *            the second indicator\r
60          */\r
61         public void setIndicator2(char ind2);\r
62 \r
63         /**\r
64          * Returns the list of <code>Subfield</code> objects.\r
65          * \r
66          * @return List - the list of <code>Subfield</code> objects\r
67          */\r
68         public List getSubfields();\r
69 \r
70         /**\r
71          * Returns the list of <code>Subfield</code> objects for the goven\r
72          * subfield code.\r
73          * \r
74          * @param code\r
75          *            the subfield code\r
76          * @return List - the list of <code>Subfield</code> objects\r
77          */\r
78         public List getSubfields(char code);\r
79 \r
80         /**\r
81          * Returns the first <code>Subfield</code> with the given code.\r
82          * \r
83          * @param code\r
84          *            the subfield code\r
85          * @return Subfield - the subfield object or null if no subfield is found\r
86          */\r
87         public Subfield getSubfield(char code);\r
88 \r
89         /**\r
90          * Adds a <code>Subfield</code>.\r
91          * \r
92          * @param subfield\r
93          *            the <code>Subfield</code> object\r
94          * @throws IllegalAddException\r
95          *             when the parameter is not a <code>Subfield</code> instance\r
96          */\r
97         public void addSubfield(Subfield subfield);\r
98 \r
99         /**\r
100          * Inserts a <code>Subfield</code> at the specified position.\r
101          * \r
102          * @param index\r
103          *            the position within the list\r
104          * @param subfield\r
105          *            the <code>Subfield</code> object\r
106          * @throws IllegalAddException\r
107          *             when the parameter is not a <code>Subfield</code> instance\r
108          */\r
109         public void addSubfield(int index, Subfield subfield);\r
110 \r
111         /**\r
112          * Removes a <code>Subfield</code>.\r
113          */\r
114         public void removeSubfield(Subfield subfield);\r
115 \r
116 }