|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.marc4j.marc.impl.RecordImpl
public class RecordImpl
Represents a MARC record.
Constructor Summary | |
---|---|
RecordImpl()
Creates a new Record . |
Method Summary | |
---|---|
void |
addVariableField(VariableField field)
Adds a VariableField being a ControlField
or DataField . |
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[] tags)
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. |
String |
toString()
Returns a string representation of this record. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RecordImpl()
Record
.
Method Detail |
---|
public void setType(String type)
Record
setType
in interface Record
type
- the type of recordpublic String getType()
Record
getType
in interface Record
public void setLeader(Leader leader)
Record
Leader
.
setLeader
in interface Record
leader
- the Leader
public Leader getLeader()
Record
Leader
.
getLeader
in interface Record
Leader
public void addVariableField(VariableField field)
VariableField
being a ControlField
or DataField
.
If the VariableField
is a control number field (001) and
the record already has a control number field, the field is replaced with
the new instance.
addVariableField
in interface Record
field
- the VariableField
IllegalAddException
- when the parameter is not a VariableField
instancepublic void removeVariableField(VariableField field)
Record
removeVariableField
in interface Record
field
- the variable fieldpublic ControlField getControlNumberField()
null
if no control
number field is available.
getControlNumberField
in interface Record
public List getControlFields()
Record
getControlFields
in interface Record
public List getDataFields()
Record
getDataFields
in interface Record
public VariableField getVariableField(String tag)
Record
getVariableField
in interface Record
public List getVariableFields(String tag)
Record
getVariableFields
in interface Record
public List getVariableFields()
Record
getVariableFields
in interface Record
public String getControlNumber()
Record
null
if no control number is
available.
This method returns the data for a ControlField
with tag
001.
getControlNumber
in interface Record
public List getVariableFields(String[] tags)
Record
For example:
String tags = { "100", "245", "260", "300" }; List fields = record.getVariableFields(tags);
getVariableFields
in interface Record
public String toString()
Example:
LEADER 00714cam a2200205 a 4500 001 12883376 005 20030616111422.0 008 020805s2002 nyu j 000 1 eng 020 $a0786808772 020 $a0786816155 (pbk.) 040 $aDLC$cDLC$dDLC 100 1 $aChabon, Michael. 245 10$aSummerland /$cMichael Chabon. 250 $a1st ed. 260 $aNew York :$bMiramax Books/Hyperion Books for Children,$cc2002. 300 $a500 p. ;$c22 cm. 650 1$aFantasy. 650 1$aBaseball$vFiction. 650 1$aMagic$vFiction.
toString
in class Object
public List find(String pattern)
Record
See Pattern
for more information about Java
regular expressions.
find
in interface Record
pattern
- the regular expression
public List find(String tag, String pattern)
Record
See Pattern
for more information about Java
regular expressions.
find
in interface Record
tag
- the tag valuepattern
- the regular expression
public List find(String[] tag, String pattern)
Record
See Pattern
for more information about Java
regular expressions.
find
in interface Record
tag
- the tag valuespattern
- the regular expression
public void setId(Long id)
Record
The purpose of this identifier is to provide an identifier for persistency.
setId
in interface Record
id
- the identifierpublic Long getId()
Record
getId
in interface Record
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |