1 //$Id: DataField.java,v 1.9 2005/08/03 18:55:46 bpeters Exp $
\r
3 * Copyright (C) 2004 Bas Peters
\r
5 * This file is part of MARC4J
\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
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
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
21 package org.marc4j.marc;
\r
23 import java.util.List;
\r
26 * Represents a data field in a MARC record.
\r
28 * @author Bas Peters
\r
29 * @version $Revision: 1.9 $
\r
31 public interface DataField extends VariableField {
\r
34 * Returns the first indicator
\r
36 * @return char - the first indicator
\r
38 public char getIndicator1();
\r
41 * Sets the first indicator.
\r
44 * the first indicator
\r
46 public void setIndicator1(char ind1);
\r
49 * Returns the second indicator
\r
51 * @return char - the second indicator
\r
53 public char getIndicator2();
\r
56 * Sets the second indicator.
\r
59 * the second indicator
\r
61 public void setIndicator2(char ind2);
\r
64 * Returns the list of <code>Subfield</code> objects.
\r
66 * @return List - the list of <code>Subfield</code> objects
\r
68 public List<Subfield> getSubfields();
\r
71 * Returns the list of <code>Subfield</code> objects for the goven
\r
76 * @return List - the list of <code>Subfield</code> objects
\r
78 public List<Subfield> getSubfields(char code);
\r
81 * Returns the first <code>Subfield</code> with the given code.
\r
85 * @return Subfield - the subfield object or null if no subfield is found
\r
87 public Subfield getSubfield(char code);
\r
90 * Adds a <code>Subfield</code>.
\r
93 * the <code>Subfield</code> object
\r
94 * @throws IllegalAddException
\r
95 * when the parameter is not a <code>Subfield</code> instance
\r
97 public void addSubfield(Subfield subfield);
\r
100 * Inserts a <code>Subfield</code> at the specified position.
\r
103 * the position within the list
\r
105 * the <code>Subfield</code> object
\r
106 * @throws IllegalAddException
\r
107 * when the parameter is not a <code>Subfield</code> instance
\r
109 public void addSubfield(int index, Subfield subfield);
\r
112 * Removes a <code>Subfield</code>.
\r
114 public void removeSubfield(Subfield subfield);
\r