All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.vt.marian.Document.MarcFixField

java.lang.Object
   |
   +----edu.vt.marian.Document.MarcFixField

public class MarcFixField
extends Object
A fixed field in us marc record. User can assume a fix field is composed of an integer id and a string data.


Variable Index

 o xmlMap
Device for mapping ANSEL (and some ASCII) characters to XML entities.

Constructor Index

 o MarcFixField(int, EntityMap, Debug)
Create a MarcFixField object with no data.
 o MarcFixField(int, String, EntityMap, Debug)
Create a MarcFixField object from the parameters id and data .

Method Index

 o getData()
Return the field string itself.
 o getID()
Return the id of this object.
 o presentAsXml(BufferedWriter)
Send this field to an output stream in the form of OAI XML.
 o setFromXml(BufferedReader)
Instantiate this object from an XML stream.

Variables

 o xmlMap
 protected EntityMap xmlMap
Device for mapping ANSEL (and some ASCII) characters to XML entities.

Constructors

 o MarcFixField
 public MarcFixField(int fieldID,
                     EntityMap xMap,
                     Debug d)
Create a MarcFixField object with no data.

Parameters:
id - --- this will be the id of this object
debug - -- used for debugging
 o MarcFixField
 public MarcFixField(int fieldID,
                     String dataStr,
                     EntityMap xMap,
                     Debug d)
Create a MarcFixField object from the parameters id and data .

Parameters:
fieldID - -- the MARC field id of this object
dataStr - -- the data of this object, ASSUMED to be in ASCII/ANSEL encoding.
debug - -- used for debugging

Methods

 o setFromXml
 public int setFromXml(BufferedReader in)
Instantiate this object from an XML stream.

Parameters:
in - -- a BufferedReader (String or InputStream, presumably) from which to read the field in OAI MARC XML format.
Returns:
OK -- everything jake.
IO_ERROR or PARSE_ERROR -- problems.

NOTE: Expects opening tag to already be read; eats closing tag.

 o presentAsXml
 public int presentAsXml(BufferedWriter out) throws IOException
Send this field 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 OAI MARC XML format.
Returns:
OK -- everything jake.
INVALID_INPUT or PARSE_ERROR -- problems.
 o getID
 public int getID()
Return the id of this object.

Returns:
the id of this object as an integer
 o getData
 public String getData()
Return the field string itself.

Returns:
the data of this object as a string

All Packages  Class Hierarchy  This Package  Previous  Next  Index