Don't need to block multiple thread access. Refactor and update a bit for an upcoming...
[zxing.git] / csharp / common / DecoderResult.cs
1 /*\r
2 * Copyright 2007 ZXing authors\r
3 *\r
4 * Licensed under the Apache License, Version 2.0 (the "License");\r
5 * you may not use this file except in compliance with the License.\r
6 * You may obtain a copy of the License at\r
7 *\r
8 *      http://www.apache.org/licenses/LICENSE-2.0\r
9 *\r
10 * Unless required by applicable law or agreed to in writing, software\r
11 * distributed under the License is distributed on an "AS IS" BASIS,\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13 * See the License for the specific language governing permissions and\r
14 * limitations under the License.\r
15 */\r
16 using System;\r
17 using ErrorCorrectionLevel = com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;\r
18 namespace com.google.zxing.common\r
19 {\r
20         \r
21         /// <summary> <p>Encapsulates the result of decoding a matrix of bits. This typically\r
22         /// applies to 2D barcode formats. For now it contains the raw bytes obtained,\r
23         /// as well as a String interpretation of those bytes, if applicable.</p>\r
24         /// \r
25         /// </summary>\r
26         /// <author>  Sean Owen\r
27         /// </author>\r
28         /// <author>www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source \r
29         /// </author>\r
30         public sealed class DecoderResult\r
31         {\r
32                 public sbyte[] RawBytes\r
33                 {\r
34                         get\r
35                         {\r
36                                 return rawBytes;\r
37                         }\r
38                         \r
39                 }\r
40                 public System.String Text\r
41                 {\r
42                         get\r
43                         {\r
44                                 return text;\r
45                         }\r
46                         \r
47                 }\r
48                 public System.Collections.ArrayList ByteSegments\r
49                 {\r
50                         get\r
51                         {\r
52                                 return byteSegments;\r
53                         }\r
54                         \r
55                 }\r
56                 public ErrorCorrectionLevel ECLevel\r
57                 {\r
58                         get\r
59                         {\r
60                                 return ecLevel;\r
61                         }\r
62                         \r
63                 }\r
64                 \r
65                 //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
66                 private sbyte[] rawBytes;\r
67                 //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
68                 private System.String text;\r
69                 //UPGRADE_NOTE: Final was removed from the declaration of 'byteSegments '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"\r
70                 private System.Collections.ArrayList byteSegments;\r
71                 //UPGRADE_NOTE: Final was removed from the declaration of 'ecLevel '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"\r
72                 private ErrorCorrectionLevel ecLevel;\r
73                 \r
74                 public DecoderResult(sbyte[] rawBytes, System.String text, System.Collections.ArrayList byteSegments, ErrorCorrectionLevel ecLevel)\r
75                 {\r
76                         if (rawBytes == null && text == null)\r
77                         {\r
78                                 throw new System.ArgumentException();\r
79                         }\r
80                         this.rawBytes = rawBytes;\r
81                         this.text = text;\r
82                         this.byteSegments = byteSegments;\r
83                         this.ecLevel = ecLevel;\r
84                 }\r
85         }\r
86 }