src/share/classes/sun/nio/cs/ext/MS50220.java

Print this page

        

@@ -24,51 +24,53 @@
  */
 
 package sun.nio.cs.ext;
 
 import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CharsetEncoder;
 
 public class MS50220 extends ISO2022_JP
 {
     public MS50220() {
         super("x-windows-50220",
               ExtendedCharsets.aliasesFor("x-windows-50220"));
     }
 
+    protected MS50220(String canonicalName, String[] aliases) {
+        super(canonicalName, aliases);
+    }
+
     public String historicalName() {
         return "MS50220";
     }
 
     public boolean contains(Charset cs) {
       return super.contains(cs) ||
              (cs instanceof JIS_X_0212) ||
              (cs instanceof MS50220);
     }
 
-    protected short[] getDecIndex1() {
-        return JIS_X_0208_MS5022X_Decoder.index1;
+    public CharsetDecoder newDecoder() {
+        return new Decoder(this, DEC0208, DEC0212);
     }
 
-    protected String[] getDecIndex2() {
-        return JIS_X_0208_MS5022X_Decoder.index2;
+    public CharsetEncoder newEncoder() {
+        return new Encoder(this, ENC0208, ENC0212, doSBKANA());
     }
 
-    protected DoubleByteDecoder get0212Decoder() {
-        return new JIS_X_0212_MS5022X_Decoder(this);
-    }
+    private final static DoubleByte.Decoder DEC0208 =
+        (DoubleByte.Decoder)new JIS_X_0208_MS5022X().newDecoder();
 
-    protected short[] getEncIndex1() {
-        return JIS_X_0208_MS5022X_Encoder.index1;
-    }
+    private final static DoubleByte.Decoder DEC0212 =
+        (DoubleByte.Decoder)new JIS_X_0212_MS5022X().newDecoder();
 
-    protected String[] getEncIndex2() {
-        return JIS_X_0208_MS5022X_Encoder.index2;
-    }
+    private final static DoubleByte.Encoder ENC0208 =
+        (DoubleByte.Encoder)new JIS_X_0208_MS5022X().newEncoder();
 
-    protected DoubleByteEncoder get0212Encoder() {
-        return new JIS_X_0212_MS5022X_Encoder(this);
-    }
+    private final static DoubleByte.Encoder ENC0212 =
+        (DoubleByte.Encoder)new JIS_X_0212_MS5022X().newEncoder();
 
     protected boolean doSBKANA() {
         return false;
     }
 }