package com.epson.cameracopy.device;

import android.hardware.Camera;

import java.util.Iterator;
import java.util.List;

public class CameraSizeList implements Iterable<SizeWrapper> {
    List<Camera.Size> mCameraSizeList;

    public static class CameraSizeWarpper implements SizeWrapper {
        static final /* synthetic */ boolean $assertionsDisabled = false;
        Camera.Size mCameraSize;

        static {
            Class<CameraSizeList> cls = CameraSizeList.class;
        }

        public CameraSizeWarpper(Camera.Size size) {
            mCameraSize = size;
        }

        public int getWidth() {
            return mCameraSize.width;
        }

        public int getHeight() {
            return mCameraSize.height;
        }
    }

    public CameraSizeList(List<Camera.Size> list) {
        mCameraSizeList = list;
    }

    public Iterator<SizeWrapper> iterator() {
        return new Iterator<SizeWrapper>() {
            int mIndex = 0;

            public void remove() {
            }

            public boolean hasNext() {
                return mIndex < CameraSizeList.mCameraSizeList.size();
            }

            public SizeWrapper next() {
                if (mIndex >= CameraSizeList.mCameraSizeList.size()) {
                    return null;
                }
                mIndex++;
                return new CameraSizeWarpper(CameraSizeList.mCameraSizeList.get(mIndex));
            }
        };
    }
}
