|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.marc4j.marc.impl.VariableFieldImpl
org.marc4j.marc.impl.DataFieldImpl
public class DataFieldImpl
Represents a data field in a MARC record.
Constructor Summary | |
---|---|
DataFieldImpl()
Creates a new DataField . |
|
DataFieldImpl(String tag,
char ind1,
char ind2)
Creates a new DataField and sets the tag name and the
first and second indicator. |
Method Summary | |
---|---|
void |
addSubfield(int index,
Subfield subfield)
Inserts a Subfield at the specified position. |
void |
addSubfield(Subfield subfield)
Adds a Subfield . |
boolean |
find(String pattern)
Returns true if the given regular expression matches a subsequence of a data element within the variable field. |
Long |
getId()
Returns the identifier. |
char |
getIndicator1()
Returns the first indicator |
char |
getIndicator2()
Returns the second indicator |
Subfield |
getSubfield(char code)
Returns the first Subfield with the given code. |
List |
getSubfields()
Returns the list of Subfield objects. |
List |
getSubfields(char code)
Returns the list of Subfield objects for the goven
subfield code. |
void |
removeSubfield(Subfield subfield)
Removes a Subfield . |
void |
setId(Long id)
Sets the identifier. |
void |
setIndicator1(char ind1)
Sets the first indicator. |
void |
setIndicator2(char ind2)
Sets the second indicator. |
String |
toString()
Returns a string representation of this data field. |
Methods inherited from class org.marc4j.marc.impl.VariableFieldImpl |
---|
compareTo, getTag, setTag |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.marc4j.marc.VariableField |
---|
getTag, setTag |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Constructor Detail |
---|
public DataFieldImpl()
DataField
.
public DataFieldImpl(String tag, char ind1, char ind2)
DataField
and sets the tag name and the
first and second indicator.
tag
- the tag nameind1
- the first indicatorind2
- the second indicatorMethod Detail |
---|
public void setIndicator1(char ind1)
setIndicator1
in interface DataField
ind1
- the first indicatorpublic char getIndicator1()
getIndicator1
in interface DataField
public void setIndicator2(char ind2)
setIndicator2
in interface DataField
ind2
- the second indicatorpublic char getIndicator2()
getIndicator2
in interface DataField
public void addSubfield(Subfield subfield)
Subfield
.
addSubfield
in interface DataField
subfield
- the Subfield
object
IllegalAddException
- when the parameter is not a Subfield
instancepublic void addSubfield(int index, Subfield subfield)
Subfield
at the specified position.
addSubfield
in interface DataField
index
- the position within the listsubfield
- the Subfield
object
IllegalAddException
- when the parameter is not a Subfield
instancepublic void removeSubfield(Subfield subfield)
Subfield
.
removeSubfield
in interface DataField
public List getSubfields()
Subfield
objects.
getSubfields
in interface DataField
Subfield
objectspublic List getSubfields(char code)
DataField
Subfield
objects for the goven
subfield code.
getSubfields
in interface DataField
code
- the subfield code
Subfield
objectspublic Subfield getSubfield(char code)
DataField
Subfield
with the given code.
getSubfield
in interface DataField
code
- the subfield code
public boolean find(String pattern)
VariableField
See Pattern
for more information about Java
regular expressions.
find
in interface VariableField
pattern
- the regular expression
public String toString()
Example:
245 10$aSummerland /$cMichael Chabon.
toString
in class VariableFieldImpl
public void setId(Long id)
VariableField
The purpose of this identifier is to provide an identifier for persistency.
setId
in interface VariableField
id
- the identifierpublic Long getId()
VariableField
getId
in interface VariableField
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |