Minor deletion of code that shouldn't have been committed
[zxing.git] / csharp / Result.cs
index 1bc5841..b09d9ac 100755 (executable)
@@ -1,4 +1,6 @@
-/*\r
+/*\r
+* Copyright 2007 ZXing authors\r
+*\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
 * 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> <p>Encapsulates the result of decoding a barcode within an image.</p>\r
+       /// \r
+       /// </summary>\r
+       /// <author>  Sean Owen\r
+       /// </author>\r
+       /// <author>www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source \r
+       /// </author>\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
+       public sealed class Result\r
+       {\r
+               /// <returns> raw text encoded by the barcode, if applicable, otherwise <code>null</code>\r
+               /// </returns>\r
+               public System.String Text\r
+               {\r
+                       get\r
+                       {\r
+                               return text;\r
+                       }\r
+                       \r
+               }\r
+               /// <returns> raw bytes encoded by the barcode, if applicable, otherwise <code>null</code>\r
+               /// </returns>\r
+               public sbyte[] RawBytes\r
+               {\r
+                       get\r
+                       {\r
+                               return rawBytes;\r
+                       }\r
+                       \r
+               }\r
+               /// <returns> 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
+               /// </returns>\r
+               public ResultPoint[] ResultPoints\r
+               {\r
+                       get\r
+                       {\r
+                               return resultPoints;\r
+                       }\r
+                       \r
+               }\r
+               /// <returns> {@link BarcodeFormat} representing the format of the barcode that was decoded\r
+               /// </returns>\r
+               public BarcodeFormat BarcodeFormat\r
+               {\r
+                       get\r
+                       {\r
+                               return format;\r
+                       }\r
+                       \r
+               }\r
+               /// <returns> {@link Hashtable} mapping {@link ResultMetadataType} keys to values. May be\r
+               /// <code>null</code>. This contains optional metadata about what was detected about the barcode,\r
+               /// like orientation.\r
+               /// </returns>\r
+               public System.Collections.Hashtable ResultMetadata\r
+               {\r
+                       get\r
+                       {\r
+                               return resultMetadata;\r
+                       }\r
+                       \r
+               }\r
+               \r
+               //UPGRADE_NOTE: Final was removed from the declaration of 'text '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"\r
+               private System.String text;\r
+               //UPGRADE_NOTE: Final was removed from the declaration of 'rawBytes '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"\r
+               private sbyte[] rawBytes;\r
+               //UPGRADE_NOTE: Final was removed from the declaration of 'resultPoints '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"\r
+               private ResultPoint[] resultPoints;\r
+               //UPGRADE_NOTE: Final was removed from the declaration of 'format '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"\r
+               private BarcodeFormat format;\r
+               private System.Collections.Hashtable resultMetadata;\r
+               \r
+               public Result(System.String text, sbyte[] rawBytes, ResultPoint[] resultPoints, BarcodeFormat format)\r
+               {\r
+                       if (text == null && rawBytes == null)\r
+                       {\r
+                               throw new System.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
+               public void  putMetadata(ResultMetadataType type, System.Object value_Renamed)\r
+               {\r
+                       if (resultMetadata == null)\r
+                       {\r
+                               resultMetadata = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable(3));\r
+                       }\r
+                       resultMetadata[type] = value_Renamed;\r
+               }\r
+               \r
+               public override System.String ToString()\r
+               {\r
+                       if (text == null)\r
+                       {\r
+                               return "[" + rawBytes.Length + " bytes]";\r
+                       }\r
+                       else\r
+                       {\r
+                               return text;\r
+                       }\r
+               }\r
+       }\r
 }
\ No newline at end of file