org.marc4j.marc
Interface Record

All Superinterfaces:
Serializable
All Known Implementing Classes:
RecordImpl

public interface Record
extends Serializable

Represents a MARC record.

Version:
$Revision: 1.12 $
Author:
Bas Peters

Method Summary
 void addVariableField(VariableField field)
          Adds a VariableField.
 List find(String pattern)
          Returns a List of VariableField objects that have a data element that matches the given regular expression.
 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.
 List find(String tag, String pattern)
          Returns a List of VariableField objects with the given tag that have a data element that matches the given regular expression.
 List getControlFields()
          Returns a list of control fields
 String getControlNumber()
          Returns the control number or null if no control number is available.
 ControlField getControlNumberField()
          Returns the control number field or null if no control number field is available.
 List getDataFields()
          Returns a list of data fields
 Long getId()
          Returns the identifier.
 Leader getLeader()
          Returns the Leader.
 String getType()
          Returns the type of record.
 VariableField getVariableField(String tag)
          Returns the first instance of the variable field with the given tag.
 List getVariableFields()
          Returns a list of variable fields
 List getVariableFields(String tag)
          Returns a list of variable fields with the given tag.
 List getVariableFields(String[] tag)
          Returns a list of variable fields for the given tags.
 void removeVariableField(VariableField field)
          Removes a variable field from the collection.
 void setId(Long id)
          Sets the identifier.
 void setLeader(Leader leader)
          Sets the Leader.
 void setType(String type)
          Sets the type of record.
 

Method Detail

setId

void setId(Long id)
Sets the identifier.

The purpose of this identifier is to provide an identifier for persistency.

Parameters:
id - the identifier

getId

Long getId()
Returns the identifier.

Returns:
Long - the identifier

setType

void setType(String type)
Sets the type of record.

Parameters:
type - the type of record

getType

String getType()
Returns the type of record.

Returns:
String - the type of record

addVariableField

void addVariableField(VariableField field)
Adds a VariableField.

Parameters:
field - the VariableField
Throws:
IllegalAddException - when the parameter is not a VariableField instance

removeVariableField

void removeVariableField(VariableField field)
Removes a variable field from the collection.

Parameters:
field - the variable field

getVariableFields

List getVariableFields()
Returns a list of variable fields

Returns:
List - the variable fields

getControlFields

List getControlFields()
Returns a list of control fields

Returns:
List - the control fields

getDataFields

List getDataFields()
Returns a list of data fields

Returns:
List - the data fields

getControlNumberField

ControlField getControlNumberField()
Returns the control number field or null if no control number field is available.

Returns:
ControlField - the control number field

getControlNumber

String getControlNumber()
Returns the control number or null if no control number is available. This method returns the data for a ControlField with tag 001.

Returns:
String - the control number

getVariableField

VariableField getVariableField(String tag)
Returns the first instance of the variable field with the given tag.

Returns:
VariableField - the variable field

getVariableFields

List getVariableFields(String tag)
Returns a list of variable fields with the given tag.

Returns:
List - the variable fields

getVariableFields

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);
 

Returns:
List - the variable fields

getLeader

Leader getLeader()
Returns the Leader.

Returns:
Leader - the Leader

setLeader

void setLeader(Leader leader)
Sets the Leader.

Parameters:
leader - the Leader

find

List find(String pattern)
Returns a List of VariableField objects that have a data element that matches the given regular expression.

See Pattern for more information about Java regular expressions.

Parameters:
pattern - the regular expression
Returns:
List - the result list

find

List find(String tag,
          String pattern)
Returns a List of VariableField objects with the given tag that have a data element that matches the given regular expression.

See Pattern for more information about Java regular expressions.

Parameters:
tag - the tag value
pattern - the regular expression
Returns:
List - the result list

find

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 Pattern for more information about Java regular expressions.

Parameters:
tag - the tag values
pattern - the regular expression
Returns:
List - the result list


Copyright © 2002-2006 Bas Peters. All Rights Reserved.