Big RSS Expanded changelist -- thank you authors
[zxing.git] / core / src / com / google / zxing / oned / rss / expanded / ExpandedPair.java
1 /*
2  * Copyright (C) 2010 ZXing authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /*
18  * These authors would like to acknowledge the Spanish Ministry of Industry,
19  * Tourism and Trade, for the support in the project TSI020301-2008-2
20  * "PIRAmIDE: Personalizable Interactions with Resources on AmI-enabled
21  * Mobile Dynamic Environments", led by Treelogic
22  * ( http://www.treelogic.com/ ):
23  *
24  *   http://www.piramidepse.com/
25  */
26
27 package com.google.zxing.oned.rss.expanded;
28
29 import com.google.zxing.oned.rss.DataCharacter;
30 import com.google.zxing.oned.rss.FinderPattern;
31
32 /**
33  * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
34  */
35 final class ExpandedPair {
36
37   private final boolean mayBeLast;
38   private final DataCharacter leftChar;
39   private final DataCharacter rightChar;
40   private final FinderPattern finderPattern;
41
42   ExpandedPair(DataCharacter leftChar, DataCharacter rightChar, FinderPattern finderPattern, boolean mayBeLast) {
43     this.leftChar      = leftChar;
44     this.rightChar     = rightChar;
45     this.finderPattern = finderPattern;
46     this.mayBeLast     = mayBeLast;
47   }
48
49   boolean mayBeLast(){
50     return this.mayBeLast;
51   }
52
53   DataCharacter getLeftChar() {
54     return this.leftChar;
55   }
56
57   DataCharacter getRightChar() {
58     return this.rightChar;
59   }
60
61   FinderPattern getFinderPattern() {
62     return this.finderPattern;
63   }
64
65   public boolean mustBeLast() {
66     return this.rightChar == null;
67   }
68 }