All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.marc4j.marc.Record Maven / Gradle / Ivy

Go to download

An easy to use Application Programming Interface (API) for working with MARC and MARCXML in Java.

There is a newer version: 2.6.12
Show newest version
/**
 * 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.io.Serializable;
import java.util.List;

/**
 * Represents a MARC record.
 * 
 * @author Bas Peters
 */
public interface Record extends Serializable {

    /**
     * Sets the identifier. The purpose of this identifier is to provide an
     * identifier for persistency.
     * 
     * @param id the identifier
     */
    public void setId(Long id);

    /**
     * Returns the identifier.
     * 
     * @return Long - the identifier
     */
    public Long getId();

    /**
     * Sets the type of record.
     * 
     * @param type the type of record
     */
    public void setType(String type);

    /**
     * Returns the type of record.
     * 
     * @return String - the type of record
     */
    public String getType();

    /**
     * Adds a VariableField.
     * 
     * @param field the VariableField
     */
    public void addVariableField(VariableField field);

    /**
     * Removes a variable field from the collection.
     * 
     * @param field the variable field
     */
    public void removeVariableField(VariableField field);

    /**
     * Returns a list of variable fields
     * 
     * @return List - the variable fields
     */
    public List getVariableFields();

    /**
     * Returns a list of control fields
     * 
     * @return List - the control fields
     */
    public List getControlFields();

    /**
     * Returns a list of data fields
     * 
     * @return List - the data fields
     */
    public List getDataFields();

    /**
     * Returns the control number field or null if no control
     * number field is available.
     * 
     * @return ControlField - the control number field
     */
    public ControlField getControlNumberField();

    /**
     * Returns the control number or null if no control number is
     * available. This method returns the data for a ControlField
     * with tag 001.
     * 
     * @return String - the control number
     */
    public String getControlNumber();

    /**
     * Returns the first instance of the variable field with the given tag.
     * 
     * @return VariableField - the variable field
     */
    public VariableField getVariableField(String tag);

    /**
     * Returns a list of variable fields with the given tag.
     * 
     * @return List - the variable fields
     */
    public List getVariableFields(String tag);

    /**
     * Returns a list of variable fields for the given tags.
     * 

* For example: * *

     * String tags = { "100", "245", "260", "300" };
     * 
     * List fields = record.getVariableFields(tags);
     * 
* * @return List - the variable fields */ public List getVariableFields(String[] tag); /** * Returns the Leader. * * @return Leader - the Leader */ public Leader getLeader(); /** * Sets the Leader. * * @param leader the Leader */ public void setLeader(Leader leader); /** * Returns a List of VariableField objects that have a data element that * matches the given regular expression. *

* See {@link java.util.regex.Pattern} for more information about Java * regular expressions. *

* * @param pattern the regular expression * @return List - the result list */ public List find(String pattern); /** * Returns a List of VariableField objects with the given tag that have a * data element that matches the given regular expression. *

* See {@link java.util.regex.Pattern} for more information about Java * regular expressions. *

* * @param tag the tag value * @param pattern the regular expression * @return List - the result list */ public List find(String tag, String pattern); /** * Returns a List of VariableField objects with the given tags that have a * data element that matches the given regular expression. *

* See {@link java.util.regex.Pattern} for more information about Java * regular expressions. *

* * @param tag the tag values * @param pattern the regular expression * @return List - the result list */ public List find(String[] tag, String pattern); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy