Skip to content

Commit

Permalink
feat: clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
闫茂源 committed Jun 1, 2024
1 parent b8f5468 commit c6ba9ca
Show file tree
Hide file tree
Showing 10 changed files with 483 additions and 451 deletions.
2 changes: 1 addition & 1 deletion lib/src/main/java/io/github/jmecn/text/EmojiIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public int getTextEnd() {
}

public boolean next() {
if (this.end >= this.nChars - 1) {
if (this.end >= this.nChars) {
return false;
}

Expand Down
62 changes: 62 additions & 0 deletions lib/src/main/java/io/github/jmecn/text/EmojiRun.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package io.github.jmecn.text;

import java.util.Objects;

/**
* desc:
*
* @author yanmaoyuan
*/
public class EmojiRun {

private final boolean isEmoji;
private final int unicodeStart;
private final int unicodeEnd;
private final int textStart;
private final int textEnd;

EmojiRun(boolean isEmoji, int unicodeStart, int unicodeEnd, int textStart, int textEnd) {
this.isEmoji = isEmoji;
this.unicodeStart = unicodeStart;
this.unicodeEnd = unicodeEnd;
this.textStart = textStart;
this.textEnd = textEnd;
}

public boolean isEmoji() {
return isEmoji;
}

public int getUnicodeStart() {
return unicodeStart;
}

public int getUnicodeEnd() {
return unicodeEnd;
}

public int getTextStart() {
return textStart;
}

public int getTextEnd() {
return textEnd;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof EmojiRun)) {
return false;
}
EmojiRun that = (EmojiRun) o;
return isEmoji == that.isEmoji && unicodeStart == that.unicodeStart && unicodeEnd == that.unicodeEnd && textStart == that.textStart && textEnd == that.textEnd;
}

@Override
public int hashCode() {
return Objects.hash(isEmoji, unicodeStart, unicodeEnd, textStart, textEnd);
}
}
58 changes: 0 additions & 58 deletions lib/src/test/java/io/github/jmecn/font/shaping/GMarkParser.java

This file was deleted.

264 changes: 0 additions & 264 deletions lib/src/test/java/io/github/jmecn/font/shaping/TestCharDetect.java

This file was deleted.

Loading

0 comments on commit c6ba9ca

Please sign in to comment.