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

51 lines
1.3 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;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.T02PartBinary;
import love.distributedrebirth.numberxd.base2t.type.V036Teger;
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", 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) {
return tong.getValue(T02PartBinary.PART_1);
} else {
return tong.getValue(T02PartBinary.PART_2);
}
}
public int charSize() {
int result = 0;
for (V072Tong points:string) {
CodePointCommandᶻᴰ cmd = CodePointᶻᴰ.INSTANCE.getCommand(points.getValue(T02PartBinary.PART_1));
if (cmd == CodePointCommandᶻᴰ.START) {
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
}