org.marc4j.converter.impl
Class UnicodeToAnsel

java.lang.Object
  extended by org.marc4j.converter.CharConverter
      extended by org.marc4j.converter.impl.UnicodeToAnsel

public class UnicodeToAnsel
extends CharConverter

A utility to convert UCS/Unicode data to MARC-8.

The MARC-8 to Unicode mapping used is the version with the March 2005 revisions.

Version:
$Revision: 1.4 $
Author:
Bas Peters, Corey Keith

Field Summary
protected  ReverseCodeTable rct
           
 
Constructor Summary
UnicodeToAnsel()
          Creates a new instance and loads the MARC4J supplied Ansel/Unicode conversion tables based on the official LC tables.
UnicodeToAnsel(InputStream in)
          Constructs an instance with the specified input stream.
UnicodeToAnsel(String pathname)
          Constructs an instance with the specified pathname.
 
Method Summary
 String convert(char[] data)
          Converts UCS/Unicode data to MARC-8.
 
Methods inherited from class org.marc4j.converter.CharConverter
convert, convert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rct

protected ReverseCodeTable rct
Constructor Detail

UnicodeToAnsel

public UnicodeToAnsel()
Creates a new instance and loads the MARC4J supplied Ansel/Unicode conversion tables based on the official LC tables.


UnicodeToAnsel

public UnicodeToAnsel(String pathname)
Constructs an instance with the specified pathname. Use this constructor to create an instance with a customized code table mapping. The mapping file should follow the structure of LC's XML MARC-8 to Unicode mapping (see: http://www.loc.gov/marc/specifications/codetables.xml).


UnicodeToAnsel

public UnicodeToAnsel(InputStream in)
Constructs an instance with the specified input stream. Use this constructor to create an instance with a customized code table mapping. The mapping file should follow the structure of LC's XML MARC-8 to Unicode mapping (see: http://www.loc.gov/marc/specifications/codetables.xml).

Method Detail

convert

public String convert(char[] data)
Converts UCS/Unicode data to MARC-8.

A question mark (0x3F) is returned if there is no match.

Specified by:
convert in class CharConverter
Parameters:
data - - the UCS/Unicode data in an array of char
Returns:
String - the MARC-8 data


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