org.marc4j.converter
Class CharConverter

java.lang.Object
  extended by org.marc4j.converter.CharConverter
Direct Known Subclasses:
AnselToUnicode, Iso5426ToUnicode, Iso6937ToUnicode, UnicodeToAnsel, UnicodeToIso5426, UnicodeToIso6937

public abstract class CharConverter
extends Object

Extend this class to create a character converter.

Version:
$Revision: 1.3 $
Author:
Bas Peters

Constructor Summary
CharConverter()
           
 
Method Summary
 String convert(byte[] dataElement)
          Alternate method for performing a character conversion.
abstract  String convert(char[] dataElement)
          The method that needs to be implemented in a subclass to create a CharConverter.
 String convert(String dataElement)
          Alternate method for performing a character conversion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharConverter

public CharConverter()
Method Detail

convert

public abstract String convert(char[] dataElement)
The method that needs to be implemented in a subclass to create a CharConverter. Receives a data element extracted from a record as a array of characters, and converts that data and returns the result as a String object.

Parameters:
dataElement - the data to convert
Returns:
String the conversion result

convert

public final String convert(byte[] dataElement)
Alternate method for performing a character conversion. Receives the incoming as a byte array, converts the bytes to characters, and calls the above convert method which must be implemented in the subclass.

Parameters:
dataElement - the data to convert
Returns:
String the conversion result

convert

public final String convert(String dataElement)
Alternate method for performing a character conversion. Receives the incoming as a String, converts the String to a character array, and calls the above convert method which must be implemented in the subclass.

Parameters:
dataElement - the data to convert
Returns:
String the conversion result


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