org.marc4j.marc
Class Leader

java.lang.Object
  |
  +--org.marc4j.marc.Leader
All Implemented Interfaces:
Serializable

public class Leader
extends Object
implements Serializable

Leader defines behaviour for the record label (record position 00-23).

The leader is a fixed field that occurs at the beginning of a MARC record and provides information for the processing of the record. The structure of the leader according to the MARC standard is as follows:

 RECORD_LENGTH RECORD_STATUS TYPE_OF_RECORD IMPLEMENTATION-DEFINED
 00-04         05            06             07-08
   CHARACTER_CODING_SCHEME  INDICATOR_COUNT SUBFIELD_CODE_LENGTH
   09                       10              11
     BASE_ADDRESS_OF_DATA  IMPLEMENTATION-DEFINED  ENTRY_MAP
     12-16                 17-19                   20-23
 

This structure is returned by the marshal() method.

Version:
$Revision: 1.10 $
Author:
Bas Peters
See Also:
Serialized Form

Constructor Summary
Leader()
           
Leader(String ldr)
           
 
Method Summary
 int getBaseAddressOfData()
          Returns the base address of data (positions 12-16).
 char getCharCodingScheme()
          Returns the character coding scheme (position 09).
 char[] getEntryMap()
          Returns the entry map (positions 20-23).
 char[] getImplDefined1()
          Returns implementation defined values (positions 07-08).
 char[] getImplDefined2()
          Returns implementation defined values (positions 17-19).
 int getIndicatorCount()
          Returns the indicator count (positions 10).
 int getRecordLength()
          Returns the logical record length (positions 00-04).
 char getRecordStatus()
          Returns the record status (positions 05).
 int getSubfieldCodeLength()
          Returns the subfield code length (position 11).
 char getTypeOfRecord()
          Returns the record type (position 06).
 String marshal()
          Returns a String representation of the record label following the MARC structure.
 void setBaseAddressOfData(int baseAddressOfData)
          Registers the base address of data (positions 12-16).
 void setCharCodingScheme(char charCodingScheme)
          Registers the character encoding scheme (position 09).
 void setEntryMap(char[] entryMap)
          Registers the entry map (positions 20-23).
 void setImplDefined1(char[] implDefined1)
          Registers implementation defined values (position 07-08).
 void setImplDefined2(char[] implDefined2)
          Registers implementation defined values (positions 17-19).
 void setIndicatorCount(int indicatorCount)
          Registers the indicator count (position 10).
 void setRecordLength(int recordLength)
          Registers the logical record length (positions 00-04).
 void setRecordStatus(char recordStatus)
          Registers the record status (position 05).
 void setSubfieldCodeLength(int subfieldCodeLength)
          Registers the subfield code length (position 11).
 void setTypeOfRecord(char typeOfRecord)
          Registers the type of record (position 06).
 void unmarshal(String ldr)
          Creates a leader object from a string object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Leader

public Leader()

Leader

public Leader(String ldr)
       throws MarcException
Method Detail

setRecordLength

public void setRecordLength(int recordLength)

Registers the logical record length (positions 00-04).

Parameters:
recordLength - integer representing the record length

setRecordStatus

public void setRecordStatus(char recordStatus)

Registers the record status (position 05).

Parameters:
recordStatus - character representing the record status

setTypeOfRecord

public void setTypeOfRecord(char typeOfRecord)

Registers the type of record (position 06).


setImplDefined1

public void setImplDefined1(char[] implDefined1)

Registers implementation defined values (position 07-08).

Parameters:
implDefined1 - character array representing the implementation defined data

setCharCodingScheme

public void setCharCodingScheme(char charCodingScheme)

Registers the character encoding scheme (position 09).

Parameters:
charCodingScheme - character representing the character encoding

setIndicatorCount

public void setIndicatorCount(int indicatorCount)

Registers the indicator count (position 10).

Parameters:
indicatorCount - integer representing the number of indicators present in a data field

setSubfieldCodeLength

public void setSubfieldCodeLength(int subfieldCodeLength)

Registers the subfield code length (position 11).

Parameters:
subfieldCodeLength - integer representing the subfield code length

setBaseAddressOfData

public void setBaseAddressOfData(int baseAddressOfData)

Registers the base address of data (positions 12-16).

Parameters:
baseAddressOfData - integer representing the base address of data

setImplDefined2

public void setImplDefined2(char[] implDefined2)

Registers implementation defined values (positions 17-19).

Parameters:
implDefined2 - character array representing the implementation defined data

setEntryMap

public void setEntryMap(char[] entryMap)

Registers the entry map (positions 20-23).

Parameters:
entryMap - character array representing the entry map

getRecordLength

public int getRecordLength()

Returns the logical record length (positions 00-04).

Returns:
int - the record length

getRecordStatus

public char getRecordStatus()

Returns the record status (positions 05).

Returns:
char - the record status

getTypeOfRecord

public char getTypeOfRecord()

Returns the record type (position 06).

Returns:
char - the record type

getImplDefined1

public char[] getImplDefined1()

Returns implementation defined values (positions 07-08).

Returns:
char[] - implementation defined values

getCharCodingScheme

public char getCharCodingScheme()

Returns the character coding scheme (position 09).

Returns:
char - the character coding scheme

getIndicatorCount

public int getIndicatorCount()

Returns the indicator count (positions 10).

Returns:
int - the indicator count

getSubfieldCodeLength

public int getSubfieldCodeLength()

Returns the subfield code length (position 11).

Returns:
int - the subfield code length

getBaseAddressOfData

public int getBaseAddressOfData()

Returns the base address of data (positions 12-16).

Returns:
int - the base address of data

getImplDefined2

public char[] getImplDefined2()

Returns implementation defined values (positions 17-19).

Returns:
char - implementation defined values

getEntryMap

public char[] getEntryMap()

Returns the entry map (positions 20-23).

Returns:
char[] - the entry map

unmarshal

public void unmarshal(String ldr)
               throws MarcException

Creates a leader object from a string object.

Indicator count and subfield code length are defaulted to 2 if they are not integer values.

Parameters:
ldr - the leader
MarcException

marshal

public String marshal()

Returns a String representation of the record label following the MARC structure.

Returns:
String - the record label


Copyright 2001-2003 Bas Peters. All Rights Reserved.