All Packages Class Hierarchy This Package Previous Next Index
Class edu.vt.marian.Document.MarcVarField
java.lang.Object
|
+----edu.vt.marian.Document.MarcVarField
- public class MarcVarField
- extends Object
A "variable field" in a US MARC record. The user can assume a variable
field is composed of an integer id, two one-character
indicators and at least one subfield.
-
debug
- just used for debugging
-
id
- The USMARC field id.
-
indicator1
- Indicator characters: see MARC documentation.
-
indicator2
-
-
subfield_separator
- the USMARC tape format subfield separator character.
-
subfields
- all the subfields of this variable field
-
xmlMap
- Device for mapping ANSEL (and some ASCII) characters to XML entities.
-
MarcVarField(int, EntityMap, Debug)
- Create a MarcVarField object from a field ID and a segment
of a MARC tape format record.
-
getID()
- return the id of this object
-
getIndicators()
- return the indicators of this object
-
getNumberSubfields()
- return the number of subfields in this object
-
getSubfieldByIndex(int)
- return the indexth subfield of this object
-
getSubfieldsByLabel(char)
- return all the subfields in this object with the specified label
-
presentAsTapeFormat(BufferedWriter)
- Send this to an output stream in the form of OAI XML.
-
presentAsXml(BufferedWriter)
- Send this to an output stream in the form of OAI XML.
-
setFromTapeFormat(String)
- Set this object from a segment of a MARC tape format record.
-
setFromXml(BufferedReader)
- Set this object from an OA XML MARC string.
-
setIndicators(char, char)
-
id
protected int id
- The USMARC field id.
indicator1
protected char indicator1
- Indicator characters: see MARC documentation.
indicator2
protected char indicator2
subfield_separator
protected static final String subfield_separator
- the USMARC tape format subfield separator character.
subfields
protected Vector subfields
- all the subfields of this variable field
debug
protected Debug debug
- just used for debugging
xmlMap
protected EntityMap xmlMap
- Device for mapping ANSEL (and some ASCII) characters to XML entities.
MarcVarField
public MarcVarField(int fieldId,
EntityMap xMap,
Debug dbg)
- Create a MarcVarField object from a field ID and a segment
of a MARC tape format record.
- Parameters:
- id - --- this will be the id of this object
- tapeFormat - -- this string contains the indicators and
all the subfields in US MARC tape format.
- debug - -- used for debugging
setIndicators
public void setIndicators(char ind1,
char ind2)
setFromTapeFormat
public int setFromTapeFormat(String tapeFormat)
- Set this object from a segment of a MARC tape format record.
- Parameters:
- tapeFormat - -- this string contains
all the subfields in US MARC tape format.
- debug - -- used for debugging
setFromXml
public int setFromXml(BufferedReader in) throws IOException
- Set this object from an OA XML MARC string.
- Parameters:
- in - -- a BufferedReader containing the contents
of a VarField (i.e., all the subfields but
not the initial tag) in OA XML format.
- Returns:
- OK -- everything jake.
IO_ERROR or PARSE_ERROR -- problems.
NOTE: Expects opening tag to already be read; eats closing tag.
presentAsTapeFormat
public int presentAsTapeFormat(BufferedWriter out) throws IOException
- Send this to an output stream in the form of OAI XML.
- Parameters:
- out - -- a BufferedWriter (String or InputStream, presumably) to which
to write the next record in OA_MARC XML format.
- Returns:
- OK -- everything jake.
INVALID_INPUT or PARSE_ERROR -- problems.
presentAsXml
public int presentAsXml(BufferedWriter out) throws IOException
- Send this to an output stream in the form of OAI XML.
- Parameters:
- out - -- a BufferedWriter (String or InputStream, presumably) to which
to write the next record in OA_MARC XML format.
- Returns:
- OK -- everything jake.
INVALID_INPUT or PARSE_ERROR -- problems.
getID
public int getID()
- return the id of this object
- Returns:
- the id of this object as an integer
getNumberSubfields
public int getNumberSubfields()
- return the number of subfields in this object
- Returns:
- the number of subfields in this object as an integer
getSubfieldByIndex
public MarcSubField getSubfieldByIndex(int index)
- return the indexth subfield of this object
- Parameters:
- index - -- used to search the subfields vector
- Returns:
- a MarcSubField object or null if the index is not invalid
getSubfieldsByLabel
public Vector getSubfieldsByLabel(char label)
- return all the subfields in this object with the specified label
- Parameters:
- label - -- used to search the subfields vector
- Returns:
- a vector containing all the subfields in this object
that have the specified label.
getIndicators
public String getIndicators()
- return the indicators of this object
- Returns:
- the indicators of this object as a string
All Packages Class Hierarchy This Package Previous Next Index