org.marc4j.marc.impl
Class LeaderImpl

java.lang.Object
  extended by org.marc4j.marc.impl.LeaderImpl
All Implemented Interfaces:
Serializable, Leader

public class LeaderImpl
extends Object
implements Leader

Represents a record label in a MARC record.

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

Constructor Summary
LeaderImpl()
          Default constructor.
LeaderImpl(String ldr)
          Creates a new leader from a String object.
 
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).
 Long getId()
          Returns the identifier.
 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()
          Creates a string object from this leader object.
 void setBaseAddressOfData(int baseAddressOfData)
          Sets the base address of data (positions 12-16).
 void setCharCodingScheme(char charCodingScheme)
          Sets the character encoding scheme (position 09).
 void setEntryMap(char[] entryMap)
          Sets the entry map (positions 20-23).
 void setId(Long id)
          Sets the identifier.
 void setImplDefined1(char[] implDefined1)
          Sets implementation defined values (position 07-08).
 void setImplDefined2(char[] implDefined2)
          Sets implementation defined values (positions 17-19).
 void setIndicatorCount(int indicatorCount)
          Sets the indicator count (position 10).
 void setRecordLength(int recordLength)
          Sets the logical record length (positions 00-04).
 void setRecordStatus(char recordStatus)
          Sets the record status (position 05).
 void setSubfieldCodeLength(int subfieldCodeLength)
          Sets the subfield code length (position 11).
 void setTypeOfRecord(char typeOfRecord)
          Sets the type of record (position 06).
 String toString()
          Returns a string representation of this leader.
 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, wait, wait, wait
 

Constructor Detail

LeaderImpl

public LeaderImpl()
Default constructor.


LeaderImpl

public LeaderImpl(String ldr)
Creates a new leader from a String object.

Parameters:
ldr - the leader string value
Method Detail

setRecordLength

public void setRecordLength(int recordLength)
Sets the logical record length (positions 00-04).

Specified by:
setRecordLength in interface Leader
Parameters:
recordLength - integer representing the record length

setRecordStatus

public void setRecordStatus(char recordStatus)
Sets the record status (position 05).

Specified by:
setRecordStatus in interface Leader
Parameters:
recordStatus - character representing the record status

setTypeOfRecord

public void setTypeOfRecord(char typeOfRecord)
Sets the type of record (position 06).

Specified by:
setTypeOfRecord in interface Leader
Parameters:
typeOfRecord - character representing the type of record

setImplDefined1

public void setImplDefined1(char[] implDefined1)
Sets implementation defined values (position 07-08).

Specified by:
setImplDefined1 in interface Leader
Parameters:
implDefined1 - character array representing the implementation defined data

setCharCodingScheme

public void setCharCodingScheme(char charCodingScheme)
Sets the character encoding scheme (position 09).

Specified by:
setCharCodingScheme in interface Leader
Parameters:
charCodingScheme - character representing the character encoding

setIndicatorCount

public void setIndicatorCount(int indicatorCount)
Sets the indicator count (position 10).

Specified by:
setIndicatorCount in interface Leader
Parameters:
indicatorCount - integer representing the number of indicators present in a data field

setSubfieldCodeLength

public void setSubfieldCodeLength(int subfieldCodeLength)
Sets the subfield code length (position 11).

Specified by:
setSubfieldCodeLength in interface Leader
Parameters:
subfieldCodeLength - integer representing the subfield code length

setBaseAddressOfData

public void setBaseAddressOfData(int baseAddressOfData)
Sets the base address of data (positions 12-16).

Specified by:
setBaseAddressOfData in interface Leader
Parameters:
baseAddressOfData - integer representing the base address of data

setImplDefined2

public void setImplDefined2(char[] implDefined2)
Sets implementation defined values (positions 17-19).

Specified by:
setImplDefined2 in interface Leader
Parameters:
implDefined2 - character array representing the implementation defined data

setEntryMap

public void setEntryMap(char[] entryMap)
Sets the entry map (positions 20-23).

Specified by:
setEntryMap in interface Leader
Parameters:
entryMap - character array representing the entry map

getRecordLength

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

Specified by:
getRecordLength in interface Leader
Returns:
int- the record length

getRecordStatus

public char getRecordStatus()
Returns the record status (positions 05).

Specified by:
getRecordStatus in interface Leader
Returns:
char- the record status

getTypeOfRecord

public char getTypeOfRecord()
Returns the record type (position 06).

Specified by:
getTypeOfRecord in interface Leader
Returns:
char- the record type

getImplDefined1

public char[] getImplDefined1()
Returns implementation defined values (positions 07-08).

Specified by:
getImplDefined1 in interface Leader
Returns:
char[]- implementation defined values

getCharCodingScheme

public char getCharCodingScheme()
Returns the character coding scheme (position 09).

Specified by:
getCharCodingScheme in interface Leader
Returns:
char- the character coding scheme

getIndicatorCount

public int getIndicatorCount()
Returns the indicator count (positions 10).

Specified by:
getIndicatorCount in interface Leader
Returns:
int- the indicator count

getSubfieldCodeLength

public int getSubfieldCodeLength()
Returns the subfield code length (position 11).

Specified by:
getSubfieldCodeLength in interface Leader
Returns:
int- the subfield code length

getBaseAddressOfData

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

Specified by:
getBaseAddressOfData in interface Leader
Returns:
int- the base address of data

getImplDefined2

public char[] getImplDefined2()
Returns implementation defined values (positions 17-19).

Specified by:
getImplDefined2 in interface Leader
Returns:
char[]- implementation defined values

getEntryMap

public char[] getEntryMap()
Returns the entry map (positions 20-23).

Specified by:
getEntryMap in interface Leader
Returns:
char[]- the entry map

unmarshal

public void unmarshal(String ldr)

Creates a leader object from a string object.

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

Specified by:
unmarshal in interface Leader
Parameters:
ldr - the leader

marshal

public String marshal()
Creates a string object from this leader object.

Specified by:
marshal in interface Leader
Returns:
String - the string object from this leader object

toString

public String toString()
Returns a string representation of this leader.

Example:

  00714cam a2200205 a 4500
 

Overrides:
toString in class Object

setId

public void setId(Long id)
Description copied from interface: Leader
Sets the identifier.

The purpose of this identifier is to provide an identifier for persistency.

Specified by:
setId in interface Leader
Parameters:
id - the identifier

getId

public Long getId()
Description copied from interface: Leader
Returns the identifier.

Specified by:
getId in interface Leader
Returns:
Long - the identifier


Copyright © 2002-2006 Bas Peters. All Rights Reserved.