Rakesh API

org.rakeshv.tex
Class ISOToTeX

java.lang.Object
  extended by org.rakeshv.tex.ISOToTeX

public final class ISOToTeX
extends java.lang.Object

Implements a HashMap that maps accentuated ISO character entities to their LATEX equivalents.

See ISO Character Entities for a full description of the character entities.

Author:
Rakesh Vidyadharan on 13 January, 2002

Copyright © 2002 Rakesh Vidyadharan


Field Summary
static boolean DO_NULL_CHECK
          Specify that you wish to get back the input character as a String equivalent, if no match is found in the HashMap.
private static java.util.Map map
          The HashMap that holds the character mappings.
 
Constructor Summary
ISOToTeX()
           
 
Method Summary
static java.lang.String convertString(java.lang.String inString)
          Convert all ISO 8859-1 encoded non-ASCII characters to appropriate LATEX tags, and return the modified String object.
static java.lang.String convertString(java.lang.String inString, java.lang.String encoding)
          Converts the input String in the specified character encoding to ISO 8859-1 encoding, and then invokes convertString( String ).
static java.lang.String getTeXEquivalent(char input)
          Returns the LATEX equivalent for the specified char.
static java.lang.String getTeXEquivalent(char input, boolean checkFlag)
          Returns the LATEX equivalent for the specified char.
private  void ISOToTeX()
          Private constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

private static java.util.Map map
The HashMap that holds the character mappings.


DO_NULL_CHECK

public static final boolean DO_NULL_CHECK
Specify that you wish to get back the input character as a String equivalent, if no match is found in the HashMap.

See Also:
Constant Field Values
Constructor Detail

ISOToTeX

public ISOToTeX()
Method Detail

ISOToTeX

private void ISOToTeX()
Private constructor. This class cannot be instantiated.


getTeXEquivalent

public static java.lang.String getTeXEquivalent(char input)

Returns the LATEX equivalent for the specified char.

If the input character equivalent is not found, this method returns null. You will have to check the return value, and take appropriate action.

Parameters:
input - - The character that is to be transformed.
Returns:
String - The LaTeX equivalent.

getTeXEquivalent

public static java.lang.String getTeXEquivalent(char input,
                                                boolean checkFlag)

Returns the LATEX equivalent for the specified char.

If the input character equivalent is not found, and checkFlag is specified as DO_NULL_CHECK, then, a String representation of the input character is returned.

Parameters:
input - - The character that is to be transformed.
checkFlag - - Specify that checking for existence of ASCII equivalent should be done in the method or not. To enable checking, specify DO_NULL_CHECK.
Returns:
String - The LaTeX equivalent.

convertString

public static java.lang.String convertString(java.lang.String inString)

Convert all ISO 8859-1 encoded non-ASCII characters to appropriate LATEX tags, and return the modified String object.

Parameters:
inString - - The String object that is to be modified.
Returns:
String - The modified String object.

convertString

public static java.lang.String convertString(java.lang.String inString,
                                             java.lang.String encoding)

Converts the input String in the specified character encoding to ISO 8859-1 encoding, and then invokes convertString( String ).

Parameters:
inString - - The String object in Windows Cp1252 format that is to be converted.
encoding - - The character encoding of input string.
Returns:
String - The modified String object.

Rakesh API

Copyright © 2002-2005 - Rakesh Vidyadharan