GNU Prolog for Java

gnu.prolog.io
Class CharConversionTable

java.lang.Object
  extended by gnu.prolog.io.CharConversionTable

public class CharConversionTable
extends Object

A conversion map, used by char_conversion and current_char_conversion and TextInputPrologStream.readTerm(Term,Interpreter,ReadOptions) .

Author:
Michiel Hendriks

Field Summary
protected  Map<Character,Character> conv
           
 
Constructor Summary
CharConversionTable()
           
 
Method Summary
 String applyConversion(String fromString)
          Apply this CharConversionTable to fromString
 Term charConvert(Term term, Environment environment)
          Apply CharConversionTable to term if this should happen.
 char convert(char input)
          Convert a character.
 Set<Character> convertsTo(char toChar)
          Returns the set of characters which are converted to this character
 boolean hasConversions()
           
 void setConversion(char from, char to)
          Set the conversion of a character
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conv

protected Map<Character,Character> conv
Constructor Detail

CharConversionTable

public CharConversionTable()
Method Detail

hasConversions

public boolean hasConversions()
Returns:
True if there are conversions (other than c==c)

setConversion

public void setConversion(char from,
                          char to)
Set the conversion of a character

Parameters:
from -
to -

convert

public char convert(char input)
Convert a character.

Parameters:
input -
Returns:
the converted character

convertsTo

public Set<Character> convertsTo(char toChar)
Returns the set of characters which are converted to this character

Parameters:
toChar -
Returns:
the set of characters which are converted to this character

charConvert

public Term charConvert(Term term,
                        Environment environment)
Apply CharConversionTable to term if this should happen.

Parameters:
term - the term to apply the conversion to
environment - the environment this is happening in (provides the flag value)
Returns:
the converted term.
See Also:
TextInputPrologStream.readTerm(Term,Interpreter,ReadOptions)

applyConversion

public String applyConversion(String fromString)
Apply this CharConversionTable to fromString

Parameters:
fromString - the string to apply the conversion to
Returns:
the converted string

GNU Prolog for Java