Clover coverage report - Clover results for XOM 1.2d1
Coverage timestamp: Wed Feb 8 2006 08:31:33 EST
file stats: LOC: 160   Methods: 2
NCLOC: 101   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ISOThaiWriter.java 100% 100% 100% 100%
coverage
 1    /* Copyright 2002, 2003 Elliotte Rusty Harold
 2   
 3    This library is free software; you can redistribute it and/or modify
 4    it under the terms of version 2.1 of the GNU Lesser General Public
 5    License as published by the Free Software Foundation.
 6   
 7    This library is distributed in the hope that it will be useful,
 8    but WITHOUT ANY WARRANTY; without even the implied warranty of
 9    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 10    GNU Lesser General Public License for more details.
 11   
 12    You should have received a copy of the GNU Lesser General Public
 13    License along with this library; if not, write to the
 14    Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 15    Boston, MA 02111-1307 USA
 16   
 17    You can contact Elliotte Rusty Harold by sending e-mail to
 18    elharo@metalab.unc.edu. Please include the word "XOM" in the
 19    subject line. The XOM home page is located at http://www.xom.nu/
 20    */
 21   
 22    package nu.xom;
 23   
 24    import java.io.Writer;
 25   
 26    /**
 27    * <p>
 28    * TIS-620, not quite the same as ISO 8859-11.
 29    * TIS-620 does not have the non-breaking space or the C1 controls.
 30    * </p>
 31    *
 32    * @author Elliotte Rusty Harold
 33    * @version 1.0
 34    *
 35    */
 36    class ISOThaiWriter extends TextWriter {
 37   
 38  1 ISOThaiWriter(Writer out, String encoding) {
 39  1 super(out, encoding);
 40    }
 41   
 42    /**
 43    * @see nu.xom.TextWriter#needsEscaping(char)
 44    */
 45  255080 boolean needsEscaping(char c) {
 46   
 47  191210 if (c < 128) return false;
 48    // C1 controls do not appear to be assigned in this character set
 49    // Also, according to
 50    // http://www.inet.co.th/cyberclub/trin/thairef/tis620-iso10646.html
 51    // "Special attention should be paid on codepoint A0. Contrary
 52    // to many people's belief that TIS 620 defines codepoint A0
 53    // as no-break space (U+00A0), the standard does not assign any
 54    // character to this codepoint. Codepoints A0 as well as DB-DE
 55    // and FC-FF are not part of the standard. Interpretations of
 56    // these unassigned codepoints are implementation specific and
 57    // may vary from implementation to implementation. To ensure full
 58    // data interchangeability among various applications, it is
 59    // suggested that Thai software implementors follows the
 60    // TIS 620 standard strictly."
 61   
 62  63870 switch (c) {
 63  1 case 0x0E01: return false; // THAI CHARACTER KO KAI
 64  1 case 0x0E02: return false; // THAI CHARACTER KHO KHAI
 65  1 case 0x0E03: return false; // THAI CHARACTER KHO KHUAT
 66  1 case 0x0E04: return false; // THAI CHARACTER KHO KHWAI
 67  1 case 0x0E05: return false; // THAI CHARACTER KHO KHON
 68  1 case 0x0E06: return false; // THAI CHARACTER KHO RAKHANG
 69  1 case 0x0E07: return false; // THAI CHARACTER NGO NGU
 70  1 case 0x0E08: return false; // THAI CHARACTER CHO CHAN
 71  1 case 0x0E09: return false; // THAI CHARACTER CHO CHING
 72  1 case 0x0E0A: return false; // THAI CHARACTER CHO CHANG
 73  1 case 0x0E0B: return false; // THAI CHARACTER SO SO
 74  1 case 0x0E0C: return false; // THAI CHARACTER CHO CHOE
 75  1 case 0x0E0D: return false; // THAI CHARACTER YO YING
 76  1 case 0x0E0E: return false; // THAI CHARACTER DO CHADA
 77  1 case 0x0E0F: return false; // THAI CHARACTER TO PATAK
 78  1 case 0x0E10: return false; // THAI CHARACTER THO THAN
 79  1 case 0x0E11: return false; // THAI CHARACTER THO NANGMONTHO
 80  1 case 0x0E12: return false; // THAI CHARACTER THO PHUTHAO
 81  1 case 0x0E13: return false; // THAI CHARACTER NO NEN
 82  1 case 0x0E14: return false; // THAI CHARACTER DO DEK
 83  1 case 0x0E15: return false; // THAI CHARACTER TO TAO
 84  1 case 0x0E16: return false; // THAI CHARACTER THO THUNG
 85  1 case 0x0E17: return false; // THAI CHARACTER THO THAHAN
 86  1 case 0x0E18: return false; // THAI CHARACTER THO THONG
 87  1 case 0x0E19: return false; // THAI CHARACTER NO NU
 88  1 case 0x0E1A: return false; // THAI CHARACTER BO BAIMAI
 89  1 case 0x0E1B: return false; // THAI CHARACTER PO PLA
 90  1 case 0x0E1C: return false; // THAI CHARACTER PHO PHUNG
 91  1 case 0x0E1D: return false; // THAI CHARACTER FO FA
 92  1 case 0x0E1E: return false; // THAI CHARACTER PHO PHAN
 93  1 case 0x0E1F: return false; // THAI CHARACTER FO FAN
 94  1 case 0x0E20: return false; // THAI CHARACTER PHO SAMPHAO
 95  1 case 0x0E21: return false; // THAI CHARACTER MO MA
 96  1 case 0x0E22: return false; // THAI CHARACTER YO YAK
 97  1 case 0x0E23: return false; // THAI CHARACTER RO RUA
 98  1 case 0x0E24: return false; // THAI CHARACTER RU
 99  1 case 0x0E25: return false; // THAI CHARACTER LO LING
 100  1 case 0x0E26: return false; // THAI CHARACTER LU
 101  1 case 0x0E27: return false; // THAI CHARACTER WO WAEN
 102  1 case 0x0E28: return false; // THAI CHARACTER SO SALA
 103  1 case 0x0E29: return false; // THAI CHARACTER SO RUSI
 104  1 case 0x0E2A: return false; // THAI CHARACTER SO SUA
 105  1 case 0x0E2B: return false; // THAI CHARACTER HO HIP
 106  1 case 0x0E2C: return false; // THAI CHARACTER LO CHULA
 107  1 case 0x0E2D: return false; // THAI CHARACTER O ANG
 108  1 case 0x0E2E: return false; // THAI CHARACTER HO NOKHUK
 109  1 case 0x0E2F: return false; // THAI CHARACTER PAIYANNOI
 110  1 case 0x0E30: return false; // THAI CHARACTER SARA A
 111  1 case 0x0E31: return false; // THAI CHARACTER MAI HAN-AKAT
 112  1 case 0x0E32: return false; // THAI CHARACTER SARA AA
 113  1 case 0x0E33: return false; // THAI CHARACTER SARA AM
 114  1 case 0x0E34: return false; // THAI CHARACTER SARA I
 115  1 case 0x0E35: return false; // THAI CHARACTER SARA II
 116  1 case 0x0E36: return false; // THAI CHARACTER SARA UE
 117  1 case 0x0E37: return false; // THAI CHARACTER SARA UEE
 118  1 case 0x0E38: return false; // THAI CHARACTER SARA U
 119  1 case 0x0E39: return false; // THAI CHARACTER SARA UU
 120  1 case 0x0E3A: return false; // THAI CHARACTER PHINTHU
 121    }
 122    // optimize by splitting switch into contiguous blocks per
 123    // Chapter 7 of Java Performance Tuning, Jack Shirazi
 124  63812 switch (c) {
 125  1 case 0x0E3F: return false; // THAI CURRENCY SYMBOL BAHT
 126  1 case 0x0E40: return false; // THAI CHARACTER SARA E
 127  1 case 0x0E41: return false; // THAI CHARACTER SARA AE
 128  1 case 0x0E42: return false; // THAI CHARACTER SARA O
 129  1 case 0x0E43: return false; // THAI CHARACTER SARA AI MAIMUAN
 130  1 case 0x0E44: return false; // THAI CHARACTER SARA AI MAIMALAI
 131  1 case 0x0E45: return false; // THAI CHARACTER LAKKHANGYAO
 132  1 case 0x0E46: return false; // THAI CHARACTER MAIYAMOK
 133  1 case 0x0E47: return false; // THAI CHARACTER MAITAIKHU
 134  1 case 0x0E48: return false; // THAI CHARACTER MAI EK
 135  1 case 0x0E49: return false; // THAI CHARACTER MAI THO
 136  1 case 0x0E4A: return false; // THAI CHARACTER MAI TRI
 137  1 case 0x0E4B: return false; // THAI CHARACTER MAI CHATTAWA
 138  1 case 0x0E4C: return false; // THAI CHARACTER THANTHAKHAT
 139  1 case 0x0E4D: return false; // THAI CHARACTER NIKHAHIT
 140  1 case 0x0E4E: return false; // THAI CHARACTER YAMAKKAN
 141  1 case 0x0E4F: return false; // THAI CHARACTER FONGMAN
 142  1 case 0x0E50: return false; // THAI DIGIT ZERO
 143  1 case 0x0E51: return false; // THAI DIGIT ONE
 144  1 case 0x0E52: return false; // THAI DIGIT TWO
 145  1 case 0x0E53: return false; // THAI DIGIT THREE
 146  1 case 0x0E54: return false; // THAI DIGIT FOUR
 147  1 case 0x0E55: return false; // THAI DIGIT FIVE
 148  1 case 0x0E56: return false; // THAI DIGIT SIX
 149  1 case 0x0E57: return false; // THAI DIGIT SEVEN
 150  1 case 0x0E58: return false; // THAI DIGIT EIGHT
 151  1 case 0x0E59: return false; // THAI DIGIT NINE
 152  1 case 0x0E5A: return false; // THAI CHARACTER ANGKHANKHU
 153  1 case 0x0E5B: return false; // THAI CHARACTER KHOMUT
 154    }
 155   
 156  63783 return true;
 157   
 158    }
 159   
 160    }