X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=core%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fcommon%2FECI.java;h=9d725dbc376a1c6beac106c8d74b01a641fb5c6d;hb=c2c10c0f583c7cada19250bd6d5ff7d7478d56b7;hp=9e2752b1c60b6c01b0f5ea9da2e9927ebf4ad1f8;hpb=0272cf53de28b0d81ec70af2cf6ebe0456aefa80;p=zxing.git diff --git a/core/src/com/google/zxing/common/ECI.java b/core/src/com/google/zxing/common/ECI.java index 9e2752b1..9d725dbc 100644 --- a/core/src/com/google/zxing/common/ECI.java +++ b/core/src/com/google/zxing/common/ECI.java @@ -17,10 +17,10 @@ package com.google.zxing.common; /** - * Superclass of classes encapsulating types ECIs, according to "Extended Channel Interpretations" 5.3 - * of ISO 18004. + * Superclass of classes encapsulating types ECIs, according to "Extended Channel Interpretations" + * 5.3 of ISO 18004. * - * @author srowen@google.com (Sean Owen) + * @author Sean Owen */ public abstract class ECI { @@ -34,6 +34,11 @@ public abstract class ECI { return value; } + /** + * @param value ECI value + * @return {@link ECI} representing ECI of given value, or null if it is legal but unsupported + * @throws IllegalArgumentException if ECI value is invalid + */ public static ECI getECIByValue(int value) { if (value < 0 || value > 999999) { throw new IllegalArgumentException("Bad ECI value: " + value); @@ -41,7 +46,7 @@ public abstract class ECI { if (value < 900) { // Character set ECIs use 000000 - 000899 return CharacterSetECI.getCharacterSetECIByValue(value); } - throw new IllegalArgumentException("Unsupported ECI value: " + value); + return null; } }