CombiningSequence.java
1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.fontengine;
import java.io.Serializable;
import java.util.Arrays;
final class CombiningSequence
implements Serializable {
static final long serialVersionUID = 1;
private final int composeTo;
private final int[] mapFrom;
private final int[] nextChar;
private final CombiningSequence[] nextSequence;
private static final int[] emptyIntArray = new int[0];
CombiningSequence(int composeTo, int[] mapFrom, int[] nextChar, CombiningSequence[] nextSequence) {
this.composeTo = composeTo;
this.mapFrom = (int[])mapFrom.clone();
this.nextChar = (int[])nextChar.clone();
this.nextSequence = (CombiningSequence[])nextSequence.clone();
}
final int compose(int[] usvs, int start, int limit) {
if (start >= limit) {
return this.composeTo;
}
int index = Arrays.binarySearch(this.nextChar, usvs[start]);
if (index < 0) {
return -1;
}
return this.nextSequence[index].compose(usvs, start + 1, limit);
}
final int[] map(int[] usvs, int start, int limit) {
if (start >= limit) {
return (int[])this.mapFrom.clone();
}
int index = Arrays.binarySearch(this.nextChar, usvs[start]);
if (index < 0) {
return emptyIntArray;
}
return this.nextSequence[index].map(usvs, start + 1, limit);
}
}