From fc6e2ff07cbd4a20e172171e30bf23c9e0b7752f Mon Sep 17 00:00:00 2001 From: TJ Woon Date: Sun, 19 Apr 2015 23:54:40 +0800 Subject: [PATCH] Pull Request cleanup (#16): Removed redundant BarcodeFormat class --- android/BarcodeFormat.java | 72 -------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 android/BarcodeFormat.java diff --git a/android/BarcodeFormat.java b/android/BarcodeFormat.java deleted file mode 100644 index 27d566e..0000000 --- a/android/BarcodeFormat.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.cloudsky.cordovaPlugins; - -import net.sourceforge.zbar.Symbol; - -import java.util.List; -import java.util.ArrayList; - -public class BarcodeFormat { - private int mId; - private String mName; - - public static final BarcodeFormat NONE = new BarcodeFormat(Symbol.NONE, "NONE"); - public static final BarcodeFormat PARTIAL = new BarcodeFormat(Symbol.PARTIAL, "PARTIAL"); - public static final BarcodeFormat EAN8 = new BarcodeFormat(Symbol.EAN8, "EAN8"); - public static final BarcodeFormat UPCE = new BarcodeFormat(Symbol.UPCE, "UPCE"); - public static final BarcodeFormat ISBN10 = new BarcodeFormat(Symbol.ISBN10, "ISBN10"); - public static final BarcodeFormat UPCA = new BarcodeFormat(Symbol.UPCA, "UPCA"); - public static final BarcodeFormat EAN13 = new BarcodeFormat(Symbol.EAN13, "EAN13"); - public static final BarcodeFormat ISBN13 = new BarcodeFormat(Symbol.ISBN13, "ISBN13"); - public static final BarcodeFormat I25 = new BarcodeFormat(Symbol.I25, "I25"); - public static final BarcodeFormat DATABAR = new BarcodeFormat(Symbol.DATABAR, "DATABAR"); - public static final BarcodeFormat DATABAR_EXP = new BarcodeFormat(Symbol.DATABAR_EXP, "DATABAR_EXP"); - public static final BarcodeFormat CODABAR = new BarcodeFormat(Symbol.CODABAR, "CODABAR"); - public static final BarcodeFormat CODE39 = new BarcodeFormat(Symbol.CODE39, "CODE39"); - public static final BarcodeFormat PDF417 = new BarcodeFormat(Symbol.PDF417, "PDF417"); - public static final BarcodeFormat QRCODE = new BarcodeFormat(Symbol.QRCODE, "QRCODE"); - public static final BarcodeFormat CODE93 = new BarcodeFormat(Symbol.CODE93, "CODE93"); - public static final BarcodeFormat CODE128 = new BarcodeFormat(Symbol.CODE128, "CODE128"); - - public static final List ALL_FORMATS = new ArrayList(); - - static { - ALL_FORMATS.add(BarcodeFormat.PARTIAL); - ALL_FORMATS.add(BarcodeFormat.EAN8); - ALL_FORMATS.add(BarcodeFormat.UPCE); - ALL_FORMATS.add(BarcodeFormat.ISBN10); - ALL_FORMATS.add(BarcodeFormat.UPCA); - ALL_FORMATS.add(BarcodeFormat.EAN13); - ALL_FORMATS.add(BarcodeFormat.ISBN13); - ALL_FORMATS.add(BarcodeFormat.I25); - ALL_FORMATS.add(BarcodeFormat.DATABAR); - ALL_FORMATS.add(BarcodeFormat.DATABAR_EXP); - ALL_FORMATS.add(BarcodeFormat.CODABAR); - ALL_FORMATS.add(BarcodeFormat.CODE39); - ALL_FORMATS.add(BarcodeFormat.PDF417); - ALL_FORMATS.add(BarcodeFormat.QRCODE); - ALL_FORMATS.add(BarcodeFormat.CODE93); - ALL_FORMATS.add(BarcodeFormat.CODE128); - } - - public BarcodeFormat(int id, String name) { - mId = id; - mName = name; - } - - public int getId() { - return mId; - } - - public String getName() { - return mName; - } - - public static BarcodeFormat getFormatById(int id) { - for(BarcodeFormat format : ALL_FORMATS) { - if(format.getId() == id) { - return format; - } - } - return BarcodeFormat.NONE; - } -} \ No newline at end of file