Clover coverage report - Clover results for XOM 1.2d1
Coverage timestamp: Wed Feb 8 2006 08:31:33 EST
file stats: LOC: 169   Methods: 2
NCLOC: 122   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ISOGreekWriter.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    * ISO 8859-7, ASCII plus Greek
 29    * </p>
 30    *
 31    * @author Elliotte Rusty Harold
 32    * @version 1.1b2
 33    *
 34    */
 35    class ISOGreekWriter extends TextWriter {
 36   
 37  1 ISOGreekWriter(Writer out, String encoding) {
 38  1 super(out, encoding);
 39    }
 40   
 41    /**
 42    * @see nu.xom.TextWriter#needsEscaping(char)
 43    */
 44  255083 boolean needsEscaping(char c) {
 45  191212 if (c < 127) return false;
 46  63871 switch (c) { // Greek
 47  1 case 0x0384: return false; // GREEK TONOS
 48  1 case 0x0385: return false; // GREEK DIALYTIKA TONOS
 49  1 case 0x0386: return false; // GREEK CAPITAL LETTER ALPHA WITH TONOS
 50  1 case 0x0387: return true; // place holder to enable table lookup
 51  1 case 0x0388: return false; // GREEK CAPITAL LETTER EPSILON WITH TONOS
 52  1 case 0x0389: return false; // GREEK CAPITAL LETTER ETA WITH TONOS
 53  1 case 0x038A: return false; // GREEK CAPITAL LETTER IOTA WITH TONOS
 54  1 case 0x038B: return true; // place holder to enable table lookup
 55  1 case 0x038C: return false; // GREEK CAPITAL LETTER OMICRON WITH TONOS
 56  1 case 0x038D: return true; // place holder to enable table lookup
 57  1 case 0x038E: return false; // GREEK CAPITAL LETTER UPSILON WITH TONOS
 58  1 case 0x038F: return false; // GREEK CAPITAL LETTER OMEGA WITH TONOS
 59  1 case 0x0390: return false; // GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
 60  1 case 0x0391: return false; // GREEK CAPITAL LETTER ALPHA
 61  1 case 0x0392: return false; // GREEK CAPITAL LETTER BETA
 62  1 case 0x0393: return false; // GREEK CAPITAL LETTER GAMMA
 63  1 case 0x0394: return false; // GREEK CAPITAL LETTER DELTA
 64  1 case 0x0395: return false; // GREEK CAPITAL LETTER EPSILON
 65  1 case 0x0396: return false; // GREEK CAPITAL LETTER ZETA
 66  1 case 0x0397: return false; // GREEK CAPITAL LETTER ETA
 67  1 case 0x0398: return false; // GREEK CAPITAL LETTER THETA
 68  1 case 0x0399: return false; // GREEK CAPITAL LETTER IOTA
 69  1 case 0x039A: return false; // GREEK CAPITAL LETTER KAPPA
 70  1 case 0x039B: return false; // GREEK CAPITAL LETTER LAMDA
 71  1 case 0x039C: return false; // GREEK CAPITAL LETTER MU
 72  1 case 0x039D: return false; // GREEK CAPITAL LETTER NU
 73  1 case 0x039E: return false; // GREEK CAPITAL LETTER XI
 74  1 case 0x039F: return false; // GREEK CAPITAL LETTER OMICRON
 75  1 case 0x03A0: return false; // GREEK CAPITAL LETTER PI
 76  1 case 0x03A1: return false; // GREEK CAPITAL LETTER RHO
 77  1 case 0x03A2: return true; // place holder to enable table lookup
 78  1 case 0x03A3: return false; // GREEK CAPITAL LETTER SIGMA
 79  1 case 0x03A4: return false; // GREEK CAPITAL LETTER TAU
 80  1 case 0x03A5: return false; // GREEK CAPITAL LETTER UPSILON
 81  1 case 0x03A6: return false; // GREEK CAPITAL LETTER PHI
 82  1 case 0x03A7: return false; // GREEK CAPITAL LETTER CHI
 83  1 case 0x03A8: return false; // GREEK CAPITAL LETTER PSI
 84  1 case 0x03A9: return false; // GREEK CAPITAL LETTER OMEGA
 85  1 case 0x03AA: return false; // GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
 86  1 case 0x03AB: return false; // GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
 87  1 case 0x03AC: return false; // GREEK SMALL LETTER ALPHA WITH TONOS
 88  1 case 0x03AD: return false; // GREEK SMALL LETTER EPSILON WITH TONOS
 89  1 case 0x03AE: return false; // GREEK SMALL LETTER ETA WITH TONOS
 90  1 case 0x03AF: return false; // GREEK SMALL LETTER IOTA WITH TONOS
 91  1 case 0x03B0: return false; // GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
 92  1 case 0x03B1: return false; // GREEK SMALL LETTER ALPHA
 93  1 case 0x03B2: return false; // GREEK SMALL LETTER BETA
 94  1 case 0x03B3: return false; // GREEK SMALL LETTER GAMMA
 95  1 case 0x03B4: return false; // GREEK SMALL LETTER DELTA
 96  1 case 0x03B5: return false; // GREEK SMALL LETTER EPSILON
 97  1 case 0x03B6: return false; // GREEK SMALL LETTER ZETA
 98  1 case 0x03B7: return false; // GREEK SMALL LETTER ETA
 99  1 case 0x03B8: return false; // GREEK SMALL LETTER THETA
 100  1 case 0x03B9: return false; // GREEK SMALL LETTER IOTA
 101  1 case 0x03BA: return false; // GREEK SMALL LETTER KAPPA
 102  1 case 0x03BB: return false; // GREEK SMALL LETTER LAMDA
 103  1 case 0x03BC: return false; // GREEK SMALL LETTER MU
 104  1 case 0x03BD: return false; // GREEK SMALL LETTER NU
 105  1 case 0x03BE: return false; // GREEK SMALL LETTER XI
 106  1 case 0x03BF: return false; // GREEK SMALL LETTER OMICRON
 107  1 case 0x03C0: return false; // GREEK SMALL LETTER PI
 108  1 case 0x03C1: return false; // GREEK SMALL LETTER RHO
 109  1 case 0x03C2: return false; // GREEK SMALL LETTER FINAL SIGMA
 110  1 case 0x03C3: return false; // GREEK SMALL LETTER SIGMA
 111  1 case 0x03C4: return false; // GREEK SMALL LETTER TAU
 112  1 case 0x03C5: return false; // GREEK SMALL LETTER UPSILON
 113  1 case 0x03C6: return false; // GREEK SMALL LETTER PHI
 114  1 case 0x03C7: return false; // GREEK SMALL LETTER CHI
 115  1 case 0x03C8: return false; // GREEK SMALL LETTER PSI
 116  1 case 0x03C9: return false; // GREEK SMALL LETTER OMEGA
 117  1 case 0x03CA: return false; // GREEK SMALL LETTER IOTA WITH DIALYTIKA
 118  1 case 0x03CB: return false; // GREEK SMALL LETTER UPSILON WITH DIALYTIKA
 119  1 case 0x03CC: return false; // GREEK SMALL LETTER OMICRON WITH TONOS
 120  1 case 0x03CD: return false; // GREEK SMALL LETTER UPSILON WITH TONOS
 121  1 case 0x03CE: return false; // GREEK SMALL LETTER OMEGA WITH TONOS
 122    }
 123  63796 switch (c) { // overlap with Latin-1
 124  1 case 0x00A0: return false; // non-breaking space
 125  1 case 0x00A1: return true; // place holder to enable table lookup
 126  1 case 0x00A2: return true; // place holder to enable table lookup
 127  1 case 0x00A3: return false; // POUND SIGN
 128  1 case 0x00A4: return true; // place holder to enable table lookup
 129  1 case 0x00A5: return true; // place holder to enable table lookup
 130  1 case 0x00A6: return false; // BROKEN BAR
 131  1 case 0x00A7: return false; // SECTION SIGN
 132  1 case 0x00A8: return false; // DIAERESIS
 133  1 case 0x00A9: return false; // COPYRIGHT SIGN
 134  1 case 0x00AA: return true; // place holder to enable table lookup
 135  1 case 0x00AB: return false; // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
 136  1 case 0x00AC: return false; // NOT SIGN
 137  1 case 0x00AD: return false; // SOFT HYPHEN
 138  1 case 0x00AE: return true; // place holder to enable table lookup
 139  1 case 0x00AF: return true; // place holder to enable table lookup
 140  1 case 0x00B0: return false; // DEGREE SIGN
 141  1 case 0x00B1: return false; // PLUS-MINUS SIGN
 142  1 case 0x00B2: return false; // SUPERSCRIPT TWO
 143  1 case 0x00B3: return false; // SUPERSCRIPT THREE
 144  1 case 0x00B4: return true; // place holder to enable table lookup
 145  1 case 0x00B5: return true; // place holder to enable table lookup
 146  1 case 0x00B6: return true; // place holder to enable table lookup
 147  1 case 0x00B7: return false; // MIDDLE DOT
 148  1 case 0x00B8: return true; // place holder to enable table lookup
 149  1 case 0x00B9: return true; // place holder to enable table lookup
 150  1 case 0x00BA: return true; // place holder to enable table lookup
 151  1 case 0x00BB: return false; // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
 152  1 case 0x00BC: return true; // place holder to enable table lookup
 153  1 case 0x00BD: return false; // VULGAR FRACTION ONE HALF
 154    }
 155  63766 switch (c) { // assorted characters
 156  1 case 0x2015: return false; // HORIZONTAL BAR
 157    // A bug in Java 1.4 and 1.3 prevents a LEFT and RIGHT
 158    // SINGLE QUOTATION MARKs
 159    // from being correctly output
 160    // as the actual character in this encoding
 161    // even though it does exist in the
 162    // ISO-8859-7 character set.
 163    // case 0x2018: return false; // LEFT SINGLE QUOTATION MARK
 164    // case 0x2019: return false; // RIGHT SINGLE QUOTATION MARK
 165    }
 166  63765 return true;
 167    }
 168   
 169    }