//#condition !(TinyMode || TinyModeExport) /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.albite.io.decoders; /** * * @author albus */ class DecoderISO_8859_7 extends SingleByteDecoder { private static DecoderISO_8859_7 instance; private static final short[] MAP = { /* 0xa0 */ 0x00a0, 0x2018, 0x2019, 0x00a3, 0x20ac, 0x20af, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x037a, 0x00ab, 0x00ac, 0x00ad, (short) 0xfffd, 0x2015, /* 0xb0 */ 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7, 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, /* 0xc0 */ 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, /* 0xd0 */ 0x03a0, 0x03a1, (short) 0xfffd, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, /* 0xe0 */ 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, /* 0xf0 */ 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, (short) 0xfffd, }; private DecoderISO_8859_7() {} public static AlbiteCharacterDecoder getInstance() { if (instance == null) { instance = new DecoderISO_8859_7(); } return instance; } public final int decode(int code) { if (code < 0xa0) { return code; } else { code = MAP[code - 0xA0] & 0xFFFF; if (code == 0xFFFD) { return SUBSTITUTE_CHAR; } else { return code; } } } public final String getEncoding() { return Encodings.ISO_8859_7; } }