Make List type safe. Remove/suppress all warnings.
[marc4j.git] / src / org / marc4j / marc / Record.java
1 //$Id: Record.java,v 1.12 2006/08/04 12:25:57 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.io.Serializable;\r
24 import java.util.List;\r
25 \r
26 import org.marc4j.marc.Leader;\r
27 \r
28 /**\r
29  * Represents a MARC record.\r
30  * \r
31  * @author Bas Peters\r
32  * @version $Revision: 1.12 $\r
33  */\r
34 public interface Record extends Serializable {\r
35 \r
36     /**\r
37      * Sets the identifier.\r
38      * \r
39      * <p>\r
40      * The purpose of this identifier is to provide an identifier for\r
41      * persistency.\r
42      * \r
43      * @param id the identifier\r
44      */\r
45     public void setId(Long id);\r
46 \r
47     /**\r
48      * Returns the identifier.\r
49      * \r
50      * @return Long - the identifier\r
51      */\r
52     public Long getId();\r
53 \r
54     /**\r
55      * Sets the type of record.\r
56      * \r
57      * @param type\r
58      *            the type of record\r
59      */\r
60     public void setType(String type);\r
61 \r
62     /**\r
63      * Returns the type of record.\r
64      * \r
65      * @return String - the type of record\r
66      */\r
67     public String getType();\r
68 \r
69     /**\r
70      * Adds a <code>VariableField</code>.\r
71      * \r
72      * @param field\r
73      *            the <code>VariableField</code>\r
74      * @throws IllegalAddException\r
75      *             when the parameter is not a <code>VariableField</code>\r
76      *             instance\r
77      */\r
78     public void addVariableField(VariableField field);\r
79 \r
80     /**\r
81      * Removes a variable field from the collection.\r
82      * \r
83      * @param field\r
84      *            the variable field\r
85      */\r
86     public void removeVariableField(VariableField field);\r
87 \r
88     /**\r
89      * Returns a list of variable fields\r
90      * \r
91      * @return List - the variable fields\r
92      */\r
93     public List<VariableField> getVariableFields();\r
94 \r
95     /**\r
96      * Returns a list of control fields\r
97      * \r
98      * @return List - the control fields\r
99      */\r
100     public List<ControlField> getControlFields();\r
101 \r
102     /**\r
103      * Returns a list of data fields\r
104      * \r
105      * @return List - the data fields\r
106      */\r
107     public List<DataField> getDataFields();\r
108 \r
109     /**\r
110      * Returns the control number field or <code>null</code> if no control\r
111      * number field is available.\r
112      * \r
113      * @return ControlField - the control number field\r
114      */\r
115     public ControlField getControlNumberField();\r
116 \r
117     /**\r
118      * Returns the control number or <code>null</code> if no control number is\r
119      * available.\r
120      * \r
121      * This method returns the data for a <code>ControlField</code> with tag\r
122      * 001.\r
123      * \r
124      * @return String - the control number\r
125      */\r
126     public String getControlNumber();\r
127 \r
128     /**\r
129      * Returns the first instance of the variable field with the given tag.\r
130      * \r
131      * @return VariableField - the variable field\r
132      */\r
133     public VariableField getVariableField(String tag);\r
134 \r
135     /**\r
136      * Returns a list of variable fields with the given tag.\r
137      * \r
138      * @return List - the variable fields\r
139      */\r
140     public List<VariableField> getVariableFields(String tag);\r
141 \r
142     /**\r
143      * Returns a list of variable fields for the given tags.\r
144      * \r
145      * <p>\r
146      * For example:\r
147      * \r
148      * <pre>\r
149      * String tags = { &quot;100&quot;, &quot;245&quot;, &quot;260&quot;, &quot;300&quot; };\r
150      * \r
151      * List fields = record.getVariableFields(tags);\r
152      * </pre>\r
153      * \r
154      * @return List - the variable fields\r
155      */\r
156     public List<VariableField> getVariableFields(String[] tag);\r
157 \r
158     /**\r
159      * Returns the <code>Leader</code>.\r
160      * \r
161      * @return Leader - the <code>Leader</code>\r
162      */\r
163     public Leader getLeader();\r
164 \r
165     /**\r
166      * Sets the <code>Leader</code>.\r
167      * \r
168      * @param leader\r
169      *            the <code>Leader</code>\r
170      */\r
171     public void setLeader(Leader leader);\r
172 \r
173     /**\r
174      * Returns a List of VariableField objects that have a data element that\r
175      * matches the given regular expression.\r
176      * \r
177      * <p>\r
178      * See {@link java.util.regex.Pattern} for more information about Java\r
179      * regular expressions.\r
180      * </p>\r
181      * \r
182      * @param pattern\r
183      *            the regular expression\r
184      * @return List - the result list\r
185      */\r
186     public List<VariableField> find(String pattern);\r
187 \r
188     /**\r
189      * Returns a List of VariableField objects with the given tag that have a\r
190      * data element that matches the given regular expression.\r
191      * \r
192      * <p>\r
193      * See {@link java.util.regex.Pattern} for more information about Java\r
194      * regular expressions.\r
195      * </p>\r
196      * \r
197      * @param tag\r
198      *            the tag value\r
199      * @param pattern\r
200      *            the regular expression\r
201      * @return List - the result list\r
202      */\r
203     public List<VariableField> find(String tag, String pattern);\r
204 \r
205     /**\r
206      * Returns a List of VariableField objects with the given tags that have a\r
207      * data element that matches the given regular expression.\r
208      * \r
209      * <p>\r
210      * See {@link java.util.regex.Pattern} for more information about Java\r
211      * regular expressions.\r
212      * </p>\r
213      * \r
214      * @param tag\r
215      *            the tag values\r
216      * @param pattern\r
217      *            the regular expression\r
218      * @return List - the result list\r
219      */\r
220     public List<VariableField> find(String[] tag, String pattern);\r
221 \r
222 }