All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.vt.marian.Document.MarcDocument

java.lang.Object
   |
   +----edu.vt.marian.Document.MarcRecord
           |
           +----edu.vt.marian.Document.MarcDocument

public class MarcDocument
extends MarcRecord
implements Document
A USMARC record interpreted as a MARIAN Document.


Constructor Index

 o MarcDocument(Debug)
Create a null MarcDocument.
 o MarcDocument(EntityMap, Debug)
Create a MarcDocuemnt object using an explicit EntityMap.
 o MarcDocument(int, Debug)
Create a null MarcRecord, with a minimal xmlMap (one with only & and < in it).
 o MarcDocument(int, EntityMap, Debug)
Create a MarcDocuemnt object using an explicit EntityMap.

Method Index

 o attributes()
return a Vector of metadata attributes for this document.
 o copy()
Make a new MarcDocument just like this one.
 o equals(MarcDocument)
Does this object represent the same document as parameter object?

NOTE: At this point we are using String compare on the raw strings to determine equality.

 o hasSectionType(MarcVarField, int)
 o init()
Set instance variables to default values.
 o newVarField(int)
Create the correct sort of field object.
 o presentAttribute(int, int)
Return an Object (almost certainly a String) in some markupType for the given attribute.
 o presentAttributes(int)
return a Vector of metadata attributes for this document.
 o presentCallNumber(int, BufferedWriter)
 o presentFull(int)
Return a full description of the document this object represents.
 o presentFull(int, BufferedWriter)
 o presentLong(int)
return a long description of the document this object represents
 o presentLong(int, BufferedWriter)
 o presentNotesSection(int, BufferedWriter)
Prsent the notes information of this object.
 o presentPublishingInfoSection(int, BufferedWriter)
format the publishing information of this MarcRecord
 o presentSection(int, int, BufferedWriter)
format the specified variable fields of this object from the MarcRecord
 o presentShort(int)
Return a short description (probably only one sentence) of the document this represents.
 o presentShort(int, BufferedWriter)

Constructors

 o MarcDocument
 public MarcDocument(Debug dbg)
Create a null MarcDocument.

Parameters:
debug - -- used for debugging
 o MarcDocument
 public MarcDocument(int clID,
                     Debug dbg)
Create a null MarcRecord, with a minimal xmlMap (one with only & and < in it).

Parameters:
clID - -- class ID of this record.
debug - -- used for debugging
 o MarcDocument
 public MarcDocument(EntityMap xMap,
                     Debug dbg)
Create a MarcDocuemnt object using an explicit EntityMap.

Parameters:
xMap - -- an EntityMap used when reading or writing the record in XML.
debug - -- used for debugging
 o MarcDocument
 public MarcDocument(int clID,
                     EntityMap xMap,
                     Debug dbg)
Create a MarcDocuemnt object using an explicit EntityMap.

Parameters:
xMap - -- an EntityMap used when reading or writing the record in XML.
debug - -- used for debugging

Methods

 o init
 protected void init()
Set instance variables to default values.

NOTE: Called in constructors and in setFrom*(). Note call to superclass to initialize MarcRecord variables.

Overrides:
init in class MarcRecord
 o hasSectionType
 protected boolean hasSectionType(MarcVarField mvf,
                                  int section)
 o newVarField
 protected MarcVarField newVarField(int id)
Create the correct sort of field object.

NOTE: This may not seem very sensible at this level, but in the MarcDocument subclass, where variable fields with different semantics get created as different subclasses of MarcVarField, it will become indispensable.

Overrides:
newVarField in class MarcRecord
 o presentCallNumber
 protected int presentCallNumber(int markupType,
                                 BufferedWriter out) throws IOException
 o presentPublishingInfoSection
 protected int presentPublishingInfoSection(int markupType,
                                            BufferedWriter out) throws IOException
format the publishing information of this MarcRecord

Parameters:
markupType - specifies which markup type the result should be only ASCII is supported now
Returns:
the formated publish information of this object as a string
 o presentNotesSection
 protected int presentNotesSection(int markupType,
                                   BufferedWriter out) throws IOException
Prsent the notes information of this object.

Parameters:
markupType - specifies which markup type the result should be
Returns:
the formated notes information of this object as a string
 o presentSection
 protected int presentSection(int fieldType,
                              int markupType,
                              BufferedWriter out) throws IOException
format the specified variable fields of this object from the MarcRecord

Parameters:
markupType - see edu.vt.marian.common.DigInfObj
Returns:
the formated information of this object from the specified variable fields as a string
 o equals
 public boolean equals(MarcDocument d)
Does this object represent the same document as parameter object?

NOTE: At this point we are using String compare on the raw strings to determine equality. This obviously leaves something to be desired.

Parameters:
d - the document used to compare with this object
Returns:
true / false
 o copy
 public DigInfObj copy()
Make a new MarcDocument just like this one.
(Substitutes for public Object clone() until we straighten things out.)

Returns:
another MarcDocument object just like this one.
 o presentShort
 public String presentShort(int markupType)
Return a short description (probably only one sentence) of the document this represents.

Parameters:
markupType - -- specifies the charater set type need to be returned
Returns:
the short description of this object as a string
 o presentShort
 public int presentShort(int markupType,
                         BufferedWriter out) throws IOException
 o presentLong
 public String presentLong(int markupType)
return a long description of the document this object represents

Returns:
the long description of this document as a string
 o presentLong
 public int presentLong(int markupType,
                        BufferedWriter out) throws IOException
 o presentFull
 public String presentFull(int markupType)
Return a full description of the document this object represents.
NOTE: At the risk of conflating two uses -- presentaion of the complete object for tranport to another system and presentation to a sophisticated data administrator (e.g., a library cataloger) -- we are using the transport methods defined in MarcRecord to implement this.

Parameters:
markupType - specifies the character set type need to be returned
Returns:
the full description of this document as a string
 o presentFull
 public int presentFull(int markupType,
                        BufferedWriter out) throws IOException
 o presentAttributes
 public Vector presentAttributes(int markupType)
return a Vector of metadata attributes for this document.

Parameters:
markupType - how to mark up the string returned (e.g., HTML or ASCII).
Returns:
a Vector of triples [attrName, attrType, attrValue].
 o presentAttribute
 public Object presentAttribute(int attrID,
                                int markupType)
Return an Object (almost certainly a String) in some markupType for the given attribute.

Parameters:
markupType - how to mark up the string returned (e.g., HTML or ASCII).
Returns:
a Vector of triples [attrName, attrType, attrValue].
 o attributes
 public Vector attributes()
return a Vector of metadata attributes for this document.

Parameters:
markupType - how to mark up the string returned (e.g., HTML or ASCII).
Returns:
a Vector of triples [attrName, attrType, attrValue].

All Packages  Class Hierarchy  This Package  Previous  Next  Index