![JAR search and dependency download from the Maven repository](/logo.png)
org.marc4j.marc.DataField Maven / Gradle / Ivy
Show all versions of freelib-marc4j Show documentation
/**
* Copyright (C) 2004 Bas Peters
*
* This file is part of MARC4J
*
* MARC4J is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* MARC4J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with MARC4J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.marc4j.marc;
import java.util.List;
/**
* DataField defines behavior for a data field (tag 010-999).
*
* Data fields are variable fields identified by tags beginning with ASCII
* numeric values other than two zero's. Data fields contain indicators,
* subfield codes, data and a field terminator.
*
* @author Bas Peters
* @author Kevin S. Clarke
*/
public interface DataField extends VariableField {
/**
* Returns the first indicator of the DataField
*
* @return The first indicator of the DataField
*/
public char getIndicator1();
/**
* Sets the first indicator of the DataField
.
*
* @param aFirstInd The first indicator of the DataField
*/
public void setIndicator1(char aFirstInd);
/**
* Returns the second indicator of the DataField
.
*
* @return The second indicator character of the DataField
*/
public char getIndicator2();
/**
* Sets the second indicator of the DataField
.
*
* @param aSecondInd The second indicator of the DataField
*/
public void setIndicator2(char aSecondInd);
/**
* Returns the {@link List} of {@link Subfield}.
*
* @return The {@link List} of {@link Subfield}s
*/
public List getSubfields();
/**
* Returns the {@link List} of {@link Subfield}s for the given subfield code.
*
* @param aCode The code of the subfields to return
* @return The {@link List} of {@link Subfield}s in the DataField
*/
public List getSubfields(char aCode);
/**
* Returns the first Subfield
with the given code.
*
* @param aCode The subfield code of the Subfield
to return
* @return The Subfield
or null if no subfield is found
*/
public Subfield getSubfield(char aCode);
/**
* Adds the supplied Subfield
to the DataField
.
*
* @param aSubfield The Subfield
object
* @throws IllegalAddException when the parameter is not a
* Subfield
instance
*/
public void addSubfield(Subfield aSubfield);
/**
* Inserts a Subfield
at the specified position.
*
* @param aIndex The position at which to add the Subfield
* @param aSubfield The Subfield
to add to the
* DataField
* @throws IllegalAddException when the supplied Subfield
is of
* the wrong type
*/
public void addSubfield(int aIndex, Subfield aSubfield);
/**
* Removes a Subfield
.
*
* @param aSubfield The Subfield
to remove
*/
public void removeSubfield(Subfield aSubfield);
/**
* Returns the number of subfields in this DataField
.
*
* @return The number of subfields in this DataField
*/
public int countSubfields();
}