+++ /dev/null
-/*\r
-* Licensed under the Apache License, Version 2.0 (the "License");\r
-* you may not use this file except in compliance with the License.\r
-* You may obtain a copy of the License at\r
-*\r
-* http://www.apache.org/licenses/LICENSE-2.0\r
-*\r
-* Unless required by applicable law or agreed to in writing, software\r
-* distributed under the License is distributed on an "AS IS" BASIS,\r
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-* See the License for the specific language governing permissions and\r
-* limitations under the License.\r
-*/\r
-\r
-using System;\r
-using System.Collections;\r
-\r
-namespace com.google.zxing\r
-{\r
-\r
- /// <summary> The general exception class throw when something goes wrong during decoding of a barcode.\r
- /// This includes, but is not limited to, failing checksums / error correction algorithms, being\r
- /// unable to locate finder timing patterns, and so on.\r
- /// \r
- /// </summary>\r
- /// <author> srowen@google.com (Sean Owen)\r
- /// </author>\r
- //[Serializable]\r
- public sealed class Result \r
- {\r
- private String text;\r
- private sbyte[] rawBytes;\r
- private ResultPoint[] resultPoints;\r
- private BarcodeFormat format;\r
- private Hashtable resultMetadata;\r
-\r
- public Result(String text,\r
- sbyte[] rawBytes,\r
- ResultPoint[] resultPoints,\r
- BarcodeFormat format) {\r
- if (text == null && rawBytes == null) {\r
- throw new ArgumentException("Text and bytes are null");\r
- }\r
- this.text = text;\r
- this.rawBytes = rawBytes;\r
- this.resultPoints = resultPoints;\r
- this.format = format;\r
- this.resultMetadata = null;\r
- }\r
-\r
- /**\r
- * @return raw text encoded by the barcode, if applicable, otherwise <code>null</code>\r
- */\r
- public String getText() {\r
- return text;\r
- }\r
-\r
- /**\r
- * @return raw bytes encoded by the barcode, if applicable, otherwise <code>null</code>\r
- */\r
- public sbyte[] getRawBytes() {\r
- return rawBytes;\r
- }\r
-\r
- /**\r
- * @return points related to the barcode in the image. These are typically points\r
- * identifying finder patterns or the corners of the barcode. The exact meaning is\r
- * specific to the type of barcode that was decoded.\r
- */\r
- public ResultPoint[] getResultPoints() {\r
- return resultPoints;\r
- }\r
-\r
- /**\r
- * @return {@link BarcodeFormat} representing the format of the barcode that was recognized and decoded\r
- */\r
- public BarcodeFormat getBarcodeFormat() {\r
- return format;\r
- }\r
-\r
- /**\r
- * @return {@link Hashtable} mapping {@link ResultMetadataType} keys to values. May be <code>null</code>.\r
- * This contains optional metadata about what was detected about the barcode, like orientation.\r
- */\r
- public Hashtable getResultMetadata() {\r
- return resultMetadata;\r
- }\r
-\r
- public void putMetadata(ResultMetadataType type, Object value) {\r
- if (resultMetadata == null) {\r
- resultMetadata = new Hashtable(3);\r
- }\r
- resultMetadata.Add(type, value);\r
- }\r
-\r
- public String toString() {\r
- if (text == null) {\r
- return "[" + rawBytes.Length + " bytes]";\r
- } else {\r
- return text;\r
- }\r
- }\r
- \r
- \r
- }\r
-}
\ No newline at end of file