Lines 46-95
Link Here
|
46 |
static final int SUFFIX_LENGTH = 2; |
46 |
static final int SUFFIX_LENGTH = 2; |
47 |
static final int FIXES_LENGTH = PREFIX_LENGTH + SUFFIX_LENGTH; |
47 |
static final int FIXES_LENGTH = PREFIX_LENGTH + SUFFIX_LENGTH; |
48 |
static final int[] EMPTY_INT_ARRAY = new int[0]; |
48 |
static final int[] EMPTY_INT_ARRAY = new int[0]; |
49 |
static final STextEnvironment IGNORE_ENVIRONMENT = new STextEnvironment(null, false, STextEnvironment.ORIENT_IGNORE); |
|
|
50 |
|
49 |
|
51 |
protected STextTypeHandler structuredTextHandler; |
50 |
protected final STextTypeHandler handler; |
52 |
protected STextEnvironment environment; |
51 |
protected final STextEnvironment environment; |
53 |
|
52 |
protected final boolean sharedExpert; |
54 |
protected Object state; |
53 |
protected Object state; |
55 |
|
54 |
|
56 |
protected boolean sharedExpert; |
|
|
57 |
|
58 |
public STextImpl(STextTypeHandler structuredTextHandler, STextEnvironment environment, boolean shared) { |
55 |
public STextImpl(STextTypeHandler structuredTextHandler, STextEnvironment environment, boolean shared) { |
59 |
this.structuredTextHandler = structuredTextHandler; |
56 |
this.handler = structuredTextHandler; |
60 |
this.environment = environment; |
57 |
this.environment = environment; |
61 |
sharedExpert = shared; |
58 |
sharedExpert = shared; |
62 |
} |
59 |
} |
63 |
|
60 |
|
64 |
public String leanToFullText(String text) { |
61 |
public STextTypeHandler getTypeHandler() { |
65 |
return leanToFullText(structuredTextHandler, environment, text, state); |
62 |
return handler; |
66 |
} |
63 |
} |
67 |
|
64 |
|
68 |
public int[] leanToFullMap(String text) { |
65 |
public STextEnvironment getEnvironment() { |
69 |
return leanToFullMap(structuredTextHandler, environment, text, state); |
66 |
return environment; |
70 |
} |
67 |
} |
71 |
|
68 |
|
72 |
public int[] leanBidiCharOffsets(String text) { |
69 |
public int getTextDirection(String text) { |
73 |
return leanBidiCharOffsets(structuredTextHandler, environment, text, state); |
70 |
return handler.getDirection(this, text); |
74 |
} |
71 |
} |
75 |
|
72 |
|
76 |
public String fullToLeanText(String text) { |
73 |
public void clearState() { |
77 |
return fullToLeanText(structuredTextHandler, environment, text, state); |
|
|
78 |
} |
79 |
|
80 |
public int[] fullToLeanMap(String text) { |
81 |
return fullToLeanMap(structuredTextHandler, environment, text, state); |
82 |
} |
83 |
|
84 |
public int[] fullBidiCharOffsets(String text) { |
85 |
return fullBidiCharOffsets(structuredTextHandler, environment, text, state); |
86 |
} |
87 |
|
88 |
public int getCurDirection(String text) { |
89 |
return structuredTextHandler.getDirection(environment, text); |
90 |
} |
91 |
|
92 |
public void resetState() { |
93 |
if (sharedExpert) |
74 |
if (sharedExpert) |
94 |
state = null; |
75 |
state = null; |
95 |
} |
76 |
} |
Lines 103-112
Link Here
|
103 |
return state; |
84 |
return state; |
104 |
} |
85 |
} |
105 |
|
86 |
|
106 |
long computeNextLocation(STextTypeHandler handler, STextEnvironment environment, String text, STextCharTypes charTypes, STextOffsets offsets, int[] locations, int curPos) { |
87 |
long computeNextLocation(String text, STextCharTypes charTypes, STextOffsets offsets, int[] locations, int curPos) { |
107 |
String separators = handler.getSeparators(environment); |
88 |
String separators = handler.getSeparators(this); |
108 |
int separCount = separators.length(); |
89 |
int separCount = separators.length(); |
109 |
int specialsCount = handler.getSpecialsCount(environment); |
90 |
int specialsCount = handler.getSpecialsCount(this); |
110 |
int len = text.length(); |
91 |
int len = text.length(); |
111 |
int nextLocation = len; |
92 |
int nextLocation = len; |
112 |
int idxLocation = 0; |
93 |
int idxLocation = 0; |
Lines 115-122
Link Here
|
115 |
for (int i = 0; i < specialsCount; i++) { |
96 |
for (int i = 0; i < specialsCount; i++) { |
116 |
int location = locations[separCount + i]; |
97 |
int location = locations[separCount + i]; |
117 |
if (location < curPos) { |
98 |
if (location < curPos) { |
118 |
offsets.ensureRoom(); |
99 |
location = handler.indexOfSpecial(this, text, charTypes, offsets, i + 1, curPos); |
119 |
location = handler.indexOfSpecial(environment, text, charTypes, offsets, i + 1, curPos); |
|
|
120 |
if (location < 0) |
100 |
if (location < 0) |
121 |
location = len; |
101 |
location = len; |
122 |
locations[separCount + i] = location; |
102 |
locations[separCount + i] = location; |
Lines 243-254
Link Here
|
243 |
* <p> |
223 |
* <p> |
244 |
* @see ISTextExpert#leanToFullText STextEngine.leanToFullText |
224 |
* @see ISTextExpert#leanToFullText STextEngine.leanToFullText |
245 |
*/ |
225 |
*/ |
246 |
public String leanToFullText(STextTypeHandler handler, STextEnvironment environment, String text, Object state) { |
226 |
public String leanToFullText(String text) { |
247 |
int len = text.length(); |
227 |
int len = text.length(); |
248 |
if (len == 0) |
228 |
if (len == 0) |
249 |
return text; |
229 |
return text; |
250 |
STextCharTypes charTypes = new STextCharTypes(handler, environment, text); |
230 |
STextCharTypes charTypes = new STextCharTypes(this, text); |
251 |
STextOffsets offsets = leanToFullCommon(handler, environment, text, state, charTypes); |
231 |
STextOffsets offsets = leanToFullCommon(text, charTypes); |
252 |
int prefixLength = offsets.getPrefixLength(); |
232 |
int prefixLength = offsets.getPrefixLength(); |
253 |
int count = offsets.getCount(); |
233 |
int count = offsets.getCount(); |
254 |
if (count == 0 && prefixLength == 0) |
234 |
if (count == 0 && prefixLength == 0) |
Lines 290-301
Link Here
|
290 |
return new String(fullChars); |
270 |
return new String(fullChars); |
291 |
} |
271 |
} |
292 |
|
272 |
|
293 |
public int[] leanToFullMap(STextTypeHandler handler, STextEnvironment environment, String text, Object state) { |
273 |
public int[] leanToFullMap(String text) { |
294 |
int len = text.length(); |
274 |
int len = text.length(); |
295 |
if (len == 0) |
275 |
if (len == 0) |
296 |
return EMPTY_INT_ARRAY; |
276 |
return EMPTY_INT_ARRAY; |
297 |
STextCharTypes charTypes = new STextCharTypes(handler, environment, text); |
277 |
STextCharTypes charTypes = new STextCharTypes(this, text); |
298 |
STextOffsets offsets = leanToFullCommon(handler, environment, text, state, charTypes); |
278 |
STextOffsets offsets = leanToFullCommon(text, charTypes); |
299 |
int prefixLength = offsets.getPrefixLength(); |
279 |
int prefixLength = offsets.getPrefixLength(); |
300 |
int[] map = new int[len]; |
280 |
int[] map = new int[len]; |
301 |
int count = offsets.getCount(); // number of used entries |
281 |
int count = offsets.getCount(); // number of used entries |
Lines 310-360
Link Here
|
310 |
return map; |
290 |
return map; |
311 |
} |
291 |
} |
312 |
|
292 |
|
313 |
public int[] leanBidiCharOffsets(STextTypeHandler handler, STextEnvironment environment, String text, Object state) { |
293 |
public int[] leanBidiCharOffsets(String text) { |
314 |
int len = text.length(); |
294 |
int len = text.length(); |
315 |
if (len == 0) |
295 |
if (len == 0) |
316 |
return EMPTY_INT_ARRAY; |
296 |
return EMPTY_INT_ARRAY; |
317 |
STextCharTypes charTypes = new STextCharTypes(handler, environment, text); |
297 |
STextCharTypes charTypes = new STextCharTypes(this, text); |
318 |
STextOffsets offsets = leanToFullCommon(handler, environment, text, state, charTypes); |
298 |
STextOffsets offsets = leanToFullCommon(text, charTypes); |
319 |
return offsets.getArray(); |
299 |
return offsets.getOffsets(); |
320 |
} |
300 |
} |
321 |
|
301 |
|
322 |
public STextOffsets leanToFullCommon(STextTypeHandler handler, STextEnvironment environment, String text, Object state, STextCharTypes charTypes) { |
302 |
private STextOffsets leanToFullCommon(String text, STextCharTypes charTypes) { |
323 |
if (environment == null) |
|
|
324 |
environment = STextEnvironment.DEFAULT; |
325 |
int len = text.length(); |
303 |
int len = text.length(); |
326 |
int direction = handler.getDirection(environment, text, charTypes); |
304 |
int direction = handler.getDirection(this, text, charTypes); |
327 |
STextOffsets offsets = new STextOffsets(); |
305 |
STextOffsets offsets = new STextOffsets(); |
328 |
if (!handler.skipProcessing(environment, text, charTypes)) { |
306 |
if (!handler.skipProcessing(this, text, charTypes)) { |
329 |
// initialize locations |
307 |
// initialize locations |
330 |
int separCount = handler.getSeparators(environment).length(); |
308 |
int separCount = handler.getSeparators(this).length(); |
331 |
int[] locations = new int[separCount + handler.getSpecialsCount(environment)]; |
309 |
int[] locations = new int[separCount + handler.getSpecialsCount(this)]; |
332 |
for (int i = 0, k = locations.length; i < k; i++) { |
310 |
for (int i = 0, k = locations.length; i < k; i++) { |
333 |
locations[i] = -1; |
311 |
locations[i] = -1; |
334 |
} |
312 |
} |
335 |
// current position |
313 |
// current position |
336 |
int curPos = 0; |
314 |
int curPos = 0; |
337 |
if (state != null) { |
315 |
if (state != null) { |
338 |
offsets.ensureRoom(); |
316 |
curPos = handler.processSpecial(this, text, charTypes, offsets, 0, -1); |
339 |
curPos = handler.processSpecial(this, environment, text, charTypes, offsets, 0, -1); |
|
|
340 |
} |
317 |
} |
341 |
while (true) { |
318 |
while (true) { |
342 |
// location of next token to handle |
319 |
// location of next token to handle |
343 |
int nextLocation; |
320 |
int nextLocation; |
344 |
// index of next token to handle (if < separCount, this is a separator; otherwise a special case |
321 |
// index of next token to handle (if < separCount, this is a separator; otherwise a special case |
345 |
int idxLocation; |
322 |
int idxLocation; |
346 |
long res = computeNextLocation(handler, environment, text, charTypes, offsets, locations, curPos); |
323 |
long res = computeNextLocation(text, charTypes, offsets, locations, curPos); |
347 |
nextLocation = (int) (res & 0x00000000FFFFFFFF); /* low word */ |
324 |
nextLocation = (int) (res & 0x00000000FFFFFFFF); /* low word */ |
348 |
if (nextLocation >= len) |
325 |
if (nextLocation >= len) |
349 |
break; |
326 |
break; |
350 |
offsets.ensureRoom(); |
|
|
351 |
idxLocation = (int) (res >> 32); /* high word */ |
327 |
idxLocation = (int) (res >> 32); /* high word */ |
352 |
if (idxLocation < separCount) { |
328 |
if (idxLocation < separCount) { |
353 |
processSeparator(text, charTypes, offsets, nextLocation); |
329 |
processSeparator(text, charTypes, offsets, nextLocation); |
354 |
curPos = nextLocation + 1; |
330 |
curPos = nextLocation + 1; |
355 |
} else { |
331 |
} else { |
356 |
idxLocation -= (separCount - 1); // because caseNumber starts from 1 |
332 |
idxLocation -= (separCount - 1); // because caseNumber starts from 1 |
357 |
curPos = handler.processSpecial(this, environment, text, charTypes, offsets, idxLocation, nextLocation); |
333 |
curPos = handler.processSpecial(this, text, charTypes, offsets, idxLocation, nextLocation); |
358 |
} |
334 |
} |
359 |
if (curPos >= len) |
335 |
if (curPos >= len) |
360 |
break; |
336 |
break; |
Lines 368-374
Link Here
|
368 |
int resolvedOrientation = charTypes.resolveOrientation(environment); |
344 |
int resolvedOrientation = charTypes.resolveOrientation(environment); |
369 |
if (orientation != STextEnvironment.ORIENT_UNKNOWN && resolvedOrientation == direction) |
345 |
if (orientation != STextEnvironment.ORIENT_UNKNOWN && resolvedOrientation == direction) |
370 |
prefixLength = 0; |
346 |
prefixLength = 0; |
371 |
else if ((orientation & STextEnvironment.ORIENT_CONTEXTUAL_LTR) != 0) |
347 |
else if ((orientation & STextEnvironment.ORIENT_CONTEXTUAL) != 0) |
372 |
prefixLength = 1; |
348 |
prefixLength = 1; |
373 |
else |
349 |
else |
374 |
prefixLength = 2; |
350 |
prefixLength = 2; |
Lines 377-477
Link Here
|
377 |
return offsets; |
353 |
return offsets; |
378 |
} |
354 |
} |
379 |
|
355 |
|
380 |
public String fullToLeanText(STextTypeHandler handler, STextEnvironment environment, String text, Object state) { |
356 |
public String fullToLeanText(String full) { |
381 |
if (text.length() == 0) |
357 |
if (full.length() == 0) |
382 |
return text; |
358 |
return full; |
383 |
if (environment == null) |
359 |
int dir = handler.getDirection(this, full); |
384 |
environment = STextEnvironment.DEFAULT; |
|
|
385 |
int dir = handler.getDirection(environment, text); |
386 |
char curMark = MARKS[dir]; |
360 |
char curMark = MARKS[dir]; |
387 |
char curEmbed = EMBEDS[dir]; |
361 |
char curEmbed = EMBEDS[dir]; |
388 |
int i; // used as loop index |
362 |
int i; // used as loop index |
389 |
// remove any prefix and leading mark |
363 |
// remove any prefix and leading mark |
390 |
int lenText = text.length(); |
364 |
int lenFull = full.length(); |
391 |
for (i = 0; i < lenText; i++) { |
365 |
for (i = 0; i < lenFull; i++) { |
392 |
char c = text.charAt(i); |
366 |
char c = full.charAt(i); |
393 |
if (c != curEmbed && c != curMark) |
367 |
if (c != curEmbed && c != curMark) |
394 |
break; |
368 |
break; |
395 |
} |
369 |
} |
396 |
if (i > 0) { // found at least one prefix or leading mark |
370 |
if (i > 0) { // found at least one prefix or leading mark |
397 |
text = text.substring(i); |
371 |
full = full.substring(i); |
398 |
lenText = text.length(); |
372 |
lenFull = full.length(); |
399 |
} |
373 |
} |
400 |
// remove any suffix and trailing mark |
374 |
// remove any suffix and trailing mark |
401 |
for (i = lenText - 1; i >= 0; i--) { |
375 |
for (i = lenFull - 1; i >= 0; i--) { |
402 |
char c = text.charAt(i); |
376 |
char c = full.charAt(i); |
403 |
if (c != PDF && c != curMark) |
377 |
if (c != PDF && c != curMark) |
404 |
break; |
378 |
break; |
405 |
} |
379 |
} |
406 |
if (i < 0) // only suffix and trailing marks, no real data |
380 |
if (i < 0) // only suffix and trailing marks, no real data |
407 |
return EMPTY_STRING; |
381 |
return EMPTY_STRING; |
408 |
if (i < (lenText - 1)) { // found at least one suffix or trailing mark |
382 |
if (i < (lenFull - 1)) { // found at least one suffix or trailing mark |
409 |
text = text.substring(0, i + 1); |
383 |
full = full.substring(0, i + 1); |
410 |
lenText = text.length(); |
384 |
lenFull = full.length(); |
411 |
} |
385 |
} |
412 |
char[] chars = text.toCharArray(); |
386 |
char[] chars = full.toCharArray(); |
413 |
// remove marks from chars |
387 |
// remove marks from chars |
414 |
int cnt = 0; |
388 |
int cnt = 0; |
415 |
for (i = 0; i < lenText; i++) { |
389 |
for (i = 0; i < lenFull; i++) { |
416 |
char c = chars[i]; |
390 |
char c = chars[i]; |
417 |
if (c == curMark) |
391 |
if (c == curMark) |
418 |
cnt++; |
392 |
cnt++; |
419 |
else if (cnt > 0) |
393 |
else if (cnt > 0) |
420 |
chars[i - cnt] = c; |
394 |
chars[i - cnt] = c; |
|
|
395 |
} |
396 |
String lean = new String(chars, 0, lenFull - cnt); |
397 |
String full2 = leanToFullText(lean); |
398 |
// strip prefix and suffix |
399 |
int beginIndex = 0, endIndex = full2.length(); |
400 |
if (full2.charAt(0) == curMark) |
401 |
beginIndex = 1; |
402 |
else { |
403 |
if (full2.charAt(0) == curEmbed) { |
404 |
beginIndex = 1; |
405 |
if (full2.charAt(0) == curMark) |
406 |
beginIndex = 2; |
407 |
} |
408 |
if (full2.charAt(endIndex - 1) == PDF) { |
409 |
endIndex--; |
410 |
if (full2.charAt(endIndex - 1) == curMark) |
411 |
endIndex--; |
412 |
} |
421 |
} |
413 |
} |
422 |
String lean = new String(chars, 0, lenText - cnt); |
414 |
if (beginIndex > 0 || endIndex < full2.length()) |
423 |
String full = leanToFullText(handler, IGNORE_ENVIRONMENT, lean, state); |
415 |
full2 = full2.substring(beginIndex, endIndex); |
424 |
if (full.equals(text)) |
416 |
if (full2.equals(full)) |
425 |
return lean; |
417 |
return lean; |
426 |
|
418 |
|
427 |
// There are some marks in full which are not in text and/or vice versa. |
419 |
// There are some marks in full which are not in full2 and/or vice versa. |
428 |
// We need to add to lean any mark appearing in text and not in full. |
420 |
// We need to add to lean any mark appearing in full and not in full2. |
429 |
// The completed lean can never be longer than text itself. |
421 |
// The completed lean can never be longer than full itself. |
430 |
char[] newChars = new char[lenText]; |
422 |
char[] newChars = new char[lenFull]; |
431 |
char cFull, cText; |
423 |
char cFull, cFull2; |
432 |
int idxFull, idxText, idxLean, newCharsPos; |
424 |
int idxFull, idxFull2, idxLean, newCharsPos; |
433 |
int lenFull = full.length(); |
425 |
int lenFull2 = full2.length(); |
434 |
idxFull = idxText = idxLean = newCharsPos = 0; |
426 |
idxFull = idxFull2 = idxLean = newCharsPos = 0; |
435 |
while (idxText < lenText && idxFull < lenFull) { |
427 |
while (idxFull < lenFull && idxFull2 < lenFull2) { |
|
|
428 |
cFull2 = full2.charAt(idxFull2); |
436 |
cFull = full.charAt(idxFull); |
429 |
cFull = full.charAt(idxFull); |
437 |
cText = text.charAt(idxText); |
430 |
if (cFull2 == cFull) { /* chars are equal, proceed */ |
438 |
if (cFull == cText) { /* chars are equal, proceed */ |
431 |
if (cFull2 != curMark) |
439 |
if (cFull != curMark) |
|
|
440 |
newChars[newCharsPos++] = chars[idxLean++]; |
432 |
newChars[newCharsPos++] = chars[idxLean++]; |
441 |
idxText++; |
|
|
442 |
idxFull++; |
433 |
idxFull++; |
|
|
434 |
idxFull2++; |
443 |
continue; |
435 |
continue; |
444 |
} |
436 |
} |
445 |
if (cFull == curMark) { /* extra Mark in full text */ |
437 |
if (cFull2 == curMark) { /* extra Mark in full2 text */ |
446 |
idxFull++; |
438 |
idxFull2++; |
447 |
continue; |
439 |
continue; |
448 |
} |
440 |
} |
449 |
if (cText == curMark) { /* extra Mark in source full text */ |
441 |
if (cFull == curMark) { /* extra Mark in source full text */ |
450 |
idxText++; |
442 |
idxFull++; |
451 |
// idxText-2 always >= 0 since leading Marks were removed from text |
443 |
// idxFull-2 always >= 0 since leading Marks were removed from full |
452 |
if (text.charAt(idxText - 2) == curMark) |
444 |
if (full.charAt(idxFull - 2) == curMark) |
453 |
continue; // ignore successive Marks in text after the first one |
445 |
continue; // ignore successive Marks in full after the first one |
454 |
newChars[newCharsPos++] = curMark; |
446 |
newChars[newCharsPos++] = curMark; |
455 |
continue; |
447 |
continue; |
456 |
} |
448 |
} |
457 |
// we should never get here (extra char which is not a Mark) |
449 |
// we should never get here (extra char which is not a Mark) |
458 |
throw new IllegalStateException("Internal error: extra character not a Mark."); //$NON-NLS-1$ |
450 |
throw new IllegalStateException("Internal error: extra character not a Mark."); //$NON-NLS-1$ |
459 |
} |
451 |
} |
460 |
if (idxText < lenText) /* full ended before text - this should never happen since |
452 |
if (idxFull < lenFull) /* full2 ended before full - this should never happen since |
461 |
we removed all marks and PDFs at the end of text */ |
453 |
we removed all marks and PDFs at the end of full */ |
462 |
throw new IllegalStateException("Internal error: unexpected EOL."); //$NON-NLS-1$ |
454 |
throw new IllegalStateException("Internal error: unexpected EOL."); //$NON-NLS-1$ |
463 |
|
455 |
|
464 |
lean = new String(newChars, 0, newCharsPos); |
456 |
lean = new String(newChars, 0, newCharsPos); |
465 |
return lean; |
457 |
return lean; |
466 |
} |
458 |
} |
467 |
|
459 |
|
468 |
public int[] fullToLeanMap(STextTypeHandler handler, STextEnvironment environment, String full, Object state) { |
460 |
public int[] fullToLeanMap(String full) { |
469 |
int lenFull = full.length(); |
461 |
int lenFull = full.length(); |
470 |
if (lenFull == 0) |
462 |
if (lenFull == 0) |
471 |
return EMPTY_INT_ARRAY; |
463 |
return EMPTY_INT_ARRAY; |
472 |
String lean = fullToLeanText(handler, environment, full, state); |
464 |
String lean = fullToLeanText(full); |
473 |
int lenLean = lean.length(); |
465 |
int lenLean = lean.length(); |
474 |
int dir = handler.getDirection(environment, lean); |
466 |
int dir = handler.getDirection(this, lean); |
475 |
char curMark = MARKS[dir]; |
467 |
char curMark = MARKS[dir]; |
476 |
char curEmbed = EMBEDS[dir]; |
468 |
char curEmbed = EMBEDS[dir]; |
477 |
int[] map = new int[lenFull]; |
469 |
int[] map = new int[lenFull]; |
Lines 496-506
Link Here
|
496 |
return map; |
488 |
return map; |
497 |
} |
489 |
} |
498 |
|
490 |
|
499 |
public int[] fullBidiCharOffsets(STextTypeHandler handler, STextEnvironment environment, String full, Object state) { |
491 |
public int[] fullBidiCharOffsets(String full) { |
500 |
int lenFull = full.length(); |
492 |
int lenFull = full.length(); |
501 |
if (lenFull == 0) |
493 |
if (lenFull == 0) |
502 |
return EMPTY_INT_ARRAY; |
494 |
return EMPTY_INT_ARRAY; |
503 |
String lean = fullToLeanText(handler, environment, full, state); |
495 |
String lean = fullToLeanText(full); |
504 |
STextOffsets offsets = new STextOffsets(); |
496 |
STextOffsets offsets = new STextOffsets(); |
505 |
int lenLean = lean.length(); |
497 |
int lenLean = lean.length(); |
506 |
int idxLean, idxFull; |
498 |
int idxLean, idxFull; |
Lines 508-522
Link Here
|
508 |
for (idxLean = idxFull = 0; idxLean < lenLean; idxFull++) { |
500 |
for (idxLean = idxFull = 0; idxLean < lenLean; idxFull++) { |
509 |
if (full.charAt(idxFull) == lean.charAt(idxLean)) |
501 |
if (full.charAt(idxFull) == lean.charAt(idxLean)) |
510 |
idxLean++; |
502 |
idxLean++; |
511 |
else { |
503 |
else |
512 |
offsets.ensureRoom(); |
|
|
513 |
offsets.insertOffset(null, idxFull); |
504 |
offsets.insertOffset(null, idxFull); |
514 |
} |
|
|
515 |
} |
505 |
} |
516 |
for (; idxFull < lenFull; idxFull++) { |
506 |
for (; idxFull < lenFull; idxFull++) |
517 |
offsets.ensureRoom(); |
|
|
518 |
offsets.insertOffset(null, idxFull); |
507 |
offsets.insertOffset(null, idxFull); |
519 |
} |
508 |
return offsets.getOffsets(); |
520 |
return offsets.getArray(); |
|
|
521 |
} |
509 |
} |
522 |
} |
510 |
} |