Skip to content

Commit 7f1009b

Browse files
Renames to align names in source code with other implementations
1 parent 996236b commit 7f1009b

File tree

4 files changed

+232
-253
lines changed

4 files changed

+232
-253
lines changed

src/main/java/com/mapcode/Data.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ class Data {
4040
private int codexHi;
4141
private int codexLen;
4242
private boolean nameless;
43-
private boolean useless;
43+
private boolean restricted;
4444
private boolean specialShape;
4545
private int pipeType;
4646
@Nullable
4747
private String pipeLetter;
48-
private boolean starPipe;
4948
@Nullable
5049
private SubArea mapcoderRect;
5150
private boolean initialized;
@@ -80,9 +79,9 @@ boolean isNameless() {
8079
return nameless;
8180
}
8281

83-
boolean isUseless() {
82+
boolean isRestricted() {
8483
assert initialized;
85-
return useless;
84+
return restricted;
8685
}
8786

8887
boolean isSpecialShape() {
@@ -102,11 +101,6 @@ String getPipeLetter() {
102101
return pipeLetter;
103102
}
104103

105-
boolean isStarPipe() {
106-
assert initialized;
107-
return starPipe;
108-
}
109-
110104
@Nonnull
111105
SubArea getMapcoderRect() {
112106
assert initialized;
@@ -129,7 +123,7 @@ void dataSetup(final int i) {
129123
codexLen = calcCodexLen(codexHi, codexLo);
130124
codex = calcCodex(codexHi, codexLo);
131125
nameless = isNameless(i);
132-
useless = (flags & 512) != 0;
126+
restricted = (flags & 512) != 0;
133127
specialShape = isSpecialShape(i);
134128
pipeType = (flags >> 5) & 12; // 4=pipe 8=plus 12=star
135129
if (pipeType == 4) {
@@ -142,7 +136,6 @@ void dataSetup(final int i) {
142136
codexLo++;
143137
codexLen++;
144138
}
145-
starPipe = calcStarPipe(i);
146139
mapcoderRect = SubArea.getArea(i);
147140
initialized = true;
148141
}
@@ -155,6 +148,10 @@ static boolean isSpecialShape(final int i) {
155148
return (DataAccess.dataFlags(i) & 1024) != 0;
156149
}
157150

151+
static int recType(final int i) {
152+
return (DataAccess.dataFlags(i) >> 7) & 3; // 1=pipe 2=plus 3=star
153+
}
154+
158155
static int calcCodex(final int i) {
159156
final int flags = DataAccess.dataFlags(i);
160157
return calcCodex(calcCodexHi(flags), calcCodexLo(flags));
@@ -165,7 +162,7 @@ static int calcCodexLen(final int i) {
165162
return calcCodexLen(calcCodexHi(flags), calcCodexLo(flags));
166163
}
167164

168-
static boolean calcStarPipe(final int i) {
165+
static boolean isAutoHeader(final int i) {
169166
return (DataAccess.dataFlags(i) & (8 << 5)) != 0;
170167
}
171168

0 commit comments

Comments
 (0)