package com.google.zxing;

import com.google.zxing.datamatrix.DataMatrixReader;
import com.google.zxing.oned.MultiFormatOneDReader;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;

public final class MultiFormatReader
  implements Reader
{
  private Map<DecodeHintType, ?> hints;
  private Reader[] readers;

  private Result decodeInternal(BinaryBitmap paramBinaryBitmap)
    throws NotFoundException
  {
    Reader[] arrayOfReader;
    int i;
    int j;
    if (this.readers != null)
    {
      arrayOfReader = this.readers;
      i = arrayOfReader.length;
      j = 0;
    }
    while (true)
    {
      if (j >= i)
        throw NotFoundException.getNotFoundInstance();
      Reader localReader = arrayOfReader[j];
      try
      {
        Result localResult = localReader.decode(paramBinaryBitmap, this.hints);
        return localResult;
      }
      catch (ReaderException localReaderException)
      {
        j++;
      }
    }
  }

  public Result decode(BinaryBitmap paramBinaryBitmap)
    throws NotFoundException
  {
    setHints(null);
    return decodeInternal(paramBinaryBitmap);
  }

  public Result decode(BinaryBitmap paramBinaryBitmap, Map<DecodeHintType, ?> paramMap)
    throws NotFoundException
  {
    setHints(paramMap);
    return decodeInternal(paramBinaryBitmap);
  }

  public Result decodeWithState(BinaryBitmap paramBinaryBitmap)
    throws NotFoundException
  {
    if (this.readers == null)
      setHints(null);
    return decodeInternal(paramBinaryBitmap);
  }

  public void reset()
  {
    Reader[] arrayOfReader;
    int i;
    if (this.readers != null)
    {
      arrayOfReader = this.readers;
      i = arrayOfReader.length;
    }
    for (int j = 0; ; j++)
    {
      if (j >= i)
        return;
      arrayOfReader[j].reset();
    }
  }

  public void setHints(Map<DecodeHintType, ?> paramMap)
  {
    this.hints = paramMap;
    int i;
    Collection localCollection;
    label29: ArrayList localArrayList;
    int j;
    if ((paramMap != null) && (paramMap.containsKey(DecodeHintType.TRY_HARDER)))
    {
      i = 1;
      if (paramMap != null)
        break label353;
      localCollection = null;
      localArrayList = new ArrayList();
      if (localCollection != null)
      {
        if ((localCollection.contains(BarcodeFormat.UPC_A)) || (localCollection.contains(BarcodeFormat.UPC_E)) || (localCollection.contains(BarcodeFormat.EAN_13)) || (localCollection.contains(BarcodeFormat.EAN_8)) || (localCollection.contains(BarcodeFormat.CODABAR)) || (localCollection.contains(BarcodeFormat.CODE_39)) || (localCollection.contains(BarcodeFormat.CODE_93)) || (localCollection.contains(BarcodeFormat.CODE_128)) || (localCollection.contains(BarcodeFormat.ITF)) || (localCollection.contains(BarcodeFormat.RSS_14)))
          break label369;
        boolean bool = localCollection.contains(BarcodeFormat.RSS_EXPANDED);
        j = 0;
        if (bool)
          break label369;
      }
    }
    while (true)
    {
      if ((j != 0) && (i == 0))
        localArrayList.add(new MultiFormatOneDReader(paramMap));
      if (localCollection.contains(BarcodeFormat.DATA_MATRIX))
        localArrayList.add(new DataMatrixReader());
      if ((j != 0) && (i != 0))
        localArrayList.add(new MultiFormatOneDReader(paramMap));
      if (localArrayList.isEmpty())
      {
        if (i == 0)
          localArrayList.add(new MultiFormatOneDReader(paramMap));
        localArrayList.add(new DataMatrixReader());
        if (i != 0)
          localArrayList.add(new MultiFormatOneDReader(paramMap));
      }
      this.readers = ((Reader[])localArrayList.toArray(new Reader[localArrayList.size()]));
      return;
      i = 0;
      break;
      label353: localCollection = (Collection)paramMap.get(DecodeHintType.POSSIBLE_FORMATS);
      break label29;
      label369: j = 1;
    }
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.zxing.MultiFormatReader
 * JD-Core Version:    0.6.2
 */