org.marc4j.converter.impl
Class AnselToUnicode

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

public class AnselToUnicode
extends CharConverter

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

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

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

Field Summary
protected  CodeTableInterface ct
           
protected  ErrorHandler errorList
           
protected  boolean loadedMultibyte
           
 
Constructor Summary
AnselToUnicode()
          Creates a new instance and loads the MARC4J supplied conversion tables based on the official LC tables.
AnselToUnicode(boolean loadMultibyte)
          Creates a new instance and loads the MARC4J supplied conversion tables based on the official LC tables.
AnselToUnicode(ErrorHandler errorList)
          Creates a new instance and loads the MARC4J supplied conversion tables based on the official LC tables.
AnselToUnicode(ErrorHandler errorList, boolean loadMultibyte)
          Creates a new instance and loads the MARC4J supplied conversion tables based on the official LC tables.
AnselToUnicode(InputStream in)
          Constructs an instance with the specified input stream.
AnselToUnicode(String pathname)
          Constructs an instance with the specified pathname.
 
Method Summary
 String convert(char[] data)
           Converts MARC-8 data to UCS/Unicode.
 char getMBChar(int ch)
           
 int makeMultibyte(char c1, char c2, char c3)
           
 
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

ct

protected CodeTableInterface ct

loadedMultibyte

protected boolean loadedMultibyte

errorList

protected ErrorHandler errorList
Constructor Detail

AnselToUnicode

public AnselToUnicode()
Creates a new instance and loads the MARC4J supplied conversion tables based on the official LC tables.


AnselToUnicode

public AnselToUnicode(boolean loadMultibyte)
Creates a new instance and loads the MARC4J supplied conversion tables based on the official LC tables.


AnselToUnicode

public AnselToUnicode(ErrorHandler errorList)
Creates a new instance and loads the MARC4J supplied conversion tables based on the official LC tables.


AnselToUnicode

public AnselToUnicode(ErrorHandler errorList,
                      boolean loadMultibyte)
Creates a new instance and loads the MARC4J supplied conversion tables based on the official LC tables.


AnselToUnicode

public AnselToUnicode(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).


AnselToUnicode

public AnselToUnicode(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 MARC-8 data to UCS/Unicode.

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

makeMultibyte

public int makeMultibyte(char c1,
                         char c2,
                         char c3)

getMBChar

public char getMBChar(int ch)


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