gdxapp4d/gdxapp4d-lib-unicodezd/src/main/java/love/distributedrebirth/unicode4d/Stringᶻᴰ.java

57 lines
1.6 KiB
Java
Raw Normal View History

2022-02-07 01:18:02 +01:00
package love.distributedrebirth.unicode4d;
import java.util.ArrayList;
import java.util.List;
2022-10-26 01:49:44 +02:00
import love.distributedrebirth.numberxd.base2t.part.T002PartBinary;
import love.distributedrebirth.numberxd.base2t.type.V036Teger;
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
2022-10-31 04:39:32 +01:00
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
2022-10-30 16:59:24 +01:00
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
2022-02-07 14:19:29 +01:00
public class Stringᶻᴰ {
2022-02-07 01:18:02 +01:00
private List<V072Tong> string;
public Stringᶻᴰ(List<V072Tong> tongs) {
this.string = tongs;
}
public int codePointSize() {
return string.size() * 2;
}
public V036Teger getCodePointByIndex(int index) {
V072Tong tong = string.get(index >> 1);
if ((index & 1) == 0) {
2022-10-26 01:49:44 +02:00
return tong.getValue(T002PartBinary.PART_1);
} else {
2022-10-26 01:49:44 +02:00
return tong.getValue(T002PartBinary.PART_2);
}
}
public int charSize() {
int result = 0;
for (V072Tong points:string) {
2022-10-26 01:49:44 +02:00
CodePointCommandᶻᴰ cmd = CodePointᶻᴰ.INSTANCE.getCommand(points.getValue(T002PartBinary.PART_1));
2022-02-21 00:41:24 +01:00
if (cmd == CodePointCommandᶻᴰ.START_LR) {
result++;
} else if (cmd == CodePointCommandᶻᴰ.START_RL) {
result++;
} else if (cmd == CodePointCommandᶻᴰ.START_TB) {
result++;
} else if (cmd == CodePointCommandᶻᴰ.START_BT) {
result++;
}
}
return result;
}
public Stringᶻᴰ concat(Stringᶻᴰ argu) {
List<V072Tong> data = new ArrayList<>(string.size());
data.addAll(string);
data.addAll(argu.string);
return new Stringᶻᴰ(data);
}
2022-02-07 01:18:02 +01:00
}