protected UPCEANReader() { decodeRowStringBuffer = new StringBuilder(20); extensionReader = new UPCEANExtensionSupport(); eanManSupport = new EANManufacturerOrgSupport(); }
add(new int[] {0,19}, "US/CA"); add(new int[] {30,39}, "US"); add(new int[] {60,139}, "US/CA"); add(new int[] {300,379}, "FR"); add(new int[] {380}, "BG"); add(new int[] {383}, "SI"); add(new int[] {385}, "HR"); add(new int[] {387}, "BA"); add(new int[] {400,440}, "DE"); add(new int[] {450,459}, "JP"); add(new int[] {460,469}, "RU"); add(new int[] {471}, "TW"); add(new int[] {474}, "EE"); add(new int[] {475}, "LV"); add(new int[] {476}, "AZ"); add(new int[] {477}, "LT"); add(new int[] {478}, "UZ"); add(new int[] {479}, "LK"); add(new int[] {480}, "PH"); add(new int[] {481}, "BY"); add(new int[] {482}, "UA"); add(new int[] {484}, "MD"); add(new int[] {485}, "AM"); add(new int[] {486}, "GE"); add(new int[] {487}, "KZ"); add(new int[] {489}, "HK"); add(new int[] {490,499}, "JP"); add(new int[] {500,509}, "GB"); add(new int[] {520}, "GR");
String lookupCountryIdentifier(String productCode) { initIfNeeded(); int prefix = Integer.parseInt(productCode.substring(0, 3)); int max = ranges.size(); for (int i = 0; i < max; i++) { int[] range = ranges.get(i); int start = range[0]; if (prefix < start) { return null; } int end = range.length == 1 ? start : range[1]; if (prefix <= end) { return countryIdentifiers.get(i); } } return null; }
String countryID = eanManSupport.lookupCountryIdentifier(resultString); if (countryID != null) { decodeResult.putMetadata(ResultMetadataType.POSSIBLE_COUNTRY, countryID);
String countryID = eanManSupport.lookupCountryIdentifier(resultString); if (countryID != null) { decodeResult.putMetadata(ResultMetadataType.POSSIBLE_COUNTRY, countryID);
protected UPCEANReader() { decodeRowStringBuffer = new StringBuilder(20); extensionReader = new UPCEANExtensionSupport(); eanManSupport = new EANManufacturerOrgSupport(); }
String lookupCountryIdentifier(String productCode) { initIfNeeded(); int prefix = Integer.parseInt(productCode.substring(0, 3)); int max = ranges.size(); for (int i = 0; i < max; i++) { int[] range = ranges.get(i); int start = range[0]; if (prefix < start) { return null; } int end = range.length == 1 ? start : range[1]; if (prefix <= end) { return countryIdentifiers.get(i); } } return null; }
String countryID = eanManSupport.lookupCountryIdentifier(resultString); if (countryID != null) { decodeResult.putMetadata(ResultMetadataType.POSSIBLE_COUNTRY, countryID);
add(new int[] {0,19}, "US/CA"); add(new int[] {30,39}, "US"); add(new int[] {60,139}, "US/CA"); add(new int[] {300,379}, "FR"); add(new int[] {380}, "BG"); add(new int[] {383}, "SI"); add(new int[] {385}, "HR"); add(new int[] {387}, "BA"); add(new int[] {400,440}, "DE"); add(new int[] {450,459}, "JP"); add(new int[] {460,469}, "RU"); add(new int[] {471}, "TW"); add(new int[] {474}, "EE"); add(new int[] {475}, "LV"); add(new int[] {476}, "AZ"); add(new int[] {477}, "LT"); add(new int[] {478}, "UZ"); add(new int[] {479}, "LK"); add(new int[] {480}, "PH"); add(new int[] {481}, "BY"); add(new int[] {482}, "UA"); add(new int[] {484}, "MD"); add(new int[] {485}, "AM"); add(new int[] {486}, "GE"); add(new int[] {487}, "KZ"); add(new int[] {489}, "HK"); add(new int[] {490,499}, "JP"); add(new int[] {500,509}, "GB"); add(new int[] {520}, "GR");
protected UPCEANReader() { decodeRowStringBuffer = new StringBuffer(20); extensionReader = new UPCEANExtensionSupport(); eanManSupport = new EANManufacturerOrgSupport(); }
String lookupCountryIdentifier(String productCode) { initIfNeeded(); int prefix = Integer.parseInt(productCode.substring(0, 3)); int max = ranges.size(); for (int i = 0; i < max; i++) { int[] range = (int[]) ranges.elementAt(i); int start = range[0]; if (prefix < start) { return null; } int end = range.length == 1 ? start : range[1]; if (prefix <= end) { return (String) countryIdentifiers.elementAt(i); } } return null; }
add(new int[] {0,19}, "US/CA"); add(new int[] {30,39}, "US"); add(new int[] {60,139}, "US/CA"); add(new int[] {300,379}, "FR"); add(new int[] {380}, "BG"); add(new int[] {383}, "SI"); add(new int[] {385}, "HR"); add(new int[] {387}, "BA"); add(new int[] {400,440}, "DE"); add(new int[] {450,459}, "JP"); add(new int[] {460,469}, "RU"); add(new int[] {471}, "TW"); add(new int[] {474}, "EE"); add(new int[] {475}, "LV"); add(new int[] {476}, "AZ"); add(new int[] {477}, "LT"); add(new int[] {478}, "UZ"); add(new int[] {479}, "LK"); add(new int[] {480}, "PH"); add(new int[] {481}, "BY"); add(new int[] {482}, "UA"); add(new int[] {484}, "MD"); add(new int[] {485}, "AM"); add(new int[] {486}, "GE"); add(new int[] {487}, "KZ"); add(new int[] {489}, "HK"); add(new int[] {490,499}, "JP"); add(new int[] {500,509}, "GB"); add(new int[] {520}, "GR");