public class DataFieldImpl extends VariableFieldImpl implements DataField
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.
| Modifier and Type | Method and Description |
|---|---|
void |
addSubfield(int aIndex,
Subfield aSubfield)
Inserts a
Subfield at the specified position. |
void |
addSubfield(Subfield aSubfield)
Adds a
Subfield. |
int |
countSubfields()
Returns the number of subfields in this
DataField. |
boolean |
find(String aPattern)
Returns
true if a match is found for the supplied regular
expression pattern; else, false. |
char |
getIndicator1()
Returns the field's first indicator.
|
char |
getIndicator2()
Returns the field's second indicator
|
Subfield |
getSubfield(char aCode)
Returns the first
Subfield matching the supplied
char code. |
List<Subfield> |
getSubfields()
Returns the list of
Subfield objects. |
List<Subfield> |
getSubfields(char aCode)
Returns the
Subfields with the supplied char code. |
void |
removeSubfield(Subfield aSubfield)
Removes a
Subfield from the field. |
void |
setIndicator1(char aFirstInd)
Sets the field's first indicator.
|
void |
setIndicator2(char aSecondInd)
Sets the field's second indicator.
|
void |
setTag(String aTag)
Sets the tag of a
DataField. |
String |
toString()
Returns a string representation of this data field.
|
compareTo, getId, getTag, setIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetId, getTag, setIdcompareTopublic void setTag(String aTag)
DataField.setTag in interface VariableFieldsetTag in class VariableFieldImplaTag - The tag of a DataFieldpublic void setIndicator1(char aFirstInd)
setIndicator1 in interface DataFieldaFirstInd - The first indicatorpublic char getIndicator1()
getIndicator1 in interface DataFieldpublic void setIndicator2(char aSecondInd)
setIndicator2 in interface DataFieldaSecondInd - The field's second indicatorpublic char getIndicator2()
getIndicator2 in interface DataFieldpublic void addSubfield(Subfield aSubfield)
Subfield.addSubfield in interface DataFieldaSubfield - The Subfield of a DataFieldIllegalAddException - when the parameter is not an instance of
SubfieldImplpublic void addSubfield(int aIndex,
Subfield aSubfield)
Subfield at the specified position.addSubfield in interface DataFieldaIndex - The subfield's position within the listaSubfield - The Subfield objectIllegalAddException - when supplied Subfield isn't an instance of
SubfieldImplpublic void removeSubfield(Subfield aSubfield)
Subfield from the field.removeSubfield in interface DataFieldaSubfield - The subfield to remove from the field.public List<Subfield> getSubfields()
Subfield objects.getSubfields in interface DataFieldSubfield objectspublic List<Subfield> getSubfields(char aCode)
Subfields with the supplied char code.getSubfields in interface DataFieldaCode - A subfield codeList of Subfieldspublic int countSubfields()
DataField.countSubfields in interface DataFieldDataFieldpublic Subfield getSubfield(char aCode)
Subfield matching the supplied
char code.getSubfield in interface DataFieldaCode - A code for the subfield to be returnedSubfield or null if no subfield is foundpublic boolean find(String aPattern)
true if a match is found for the supplied regular
expression pattern; else, false.find in interface VariableFieldaPattern - A regular expression pattern to find in the subfieldspublic String toString()
Example:
245 10$aSummerland /$cMichael Chabon.
toString in class VariableFieldImplCopyright © 2014 FreeLibrary. All Rights Reserved.