Remove use of methods not in J2ME
[zxing.git] / core / src / com / google / zxing / oned / MultiFormatUPCEANReader.java
index 502b086..4524f3e 100644 (file)
@@ -18,6 +18,8 @@ package com.google.zxing.oned;
 
 import com.google.zxing.BarcodeFormat;
 import com.google.zxing.DecodeHintType;
+import com.google.zxing.NotFoundException;
+import com.google.zxing.Reader;
 import com.google.zxing.ReaderException;
 import com.google.zxing.Result;
 import com.google.zxing.common.BitArray;
@@ -32,7 +34,7 @@ import java.util.Vector;
  *
  * @author Sean Owen
  */
-public final class MultiFormatUPCEANReader extends AbstractOneDReader {
+public final class MultiFormatUPCEANReader extends OneDReader {
 
   private final Vector readers;
 
@@ -61,9 +63,9 @@ public final class MultiFormatUPCEANReader extends AbstractOneDReader {
     }
   }
 
-  public Result decodeRow(int rowNumber, BitArray row, Hashtable hints) throws ReaderException {
+  public Result decodeRow(int rowNumber, BitArray row, Hashtable hints) throws NotFoundException {
     // Compute this location once and reuse it on multiple implementations
-    int[] startGuardPattern = AbstractUPCEANReader.findStartGuardPattern(row);
+    int[] startGuardPattern = UPCEANReader.findStartGuardPattern(row);
     int size = readers.size();
     for (int i = 0; i < size; i++) {
       UPCEANReader reader = (UPCEANReader) readers.elementAt(i);
@@ -91,7 +93,15 @@ public final class MultiFormatUPCEANReader extends AbstractOneDReader {
       return result;
     }
 
-    throw ReaderException.getInstance();
+    throw NotFoundException.getNotFoundInstance();
+  }
+
+  public void reset() {
+    int size = readers.size();
+    for (int i = 0; i < size; i++) {
+      Reader reader = (Reader) readers.elementAt(i);
+      reader.reset();
+    }
   }
 
 }