-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathMarkdownRange.java
67 lines (56 loc) · 1.27 KB
/
MarkdownRange.java
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.expensify.livemarkdown;
import androidx.annotation.NonNull;
public class MarkdownRange {
private final @NonNull String mType;
private final int mStart;
private final int mEnd;
private final int mLength;
private final int mDepth;
public MarkdownRange(@NonNull String type, int start, int length, int depth) {
mType = type;
mStart = start;
mEnd = start + length;
mLength = length;
mDepth = depth;
}
public String getType() {
return mType;
}
public int getStart() {
return mStart;
}
public int getEnd() {
return mEnd;
}
public int getLength() {
return mLength;
}
public int getDepth() {
return mDepth;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o instanceof MarkdownRange other) {
return this.mType.equals(other.mType)
&& this.mStart == other.mStart
&& this.mEnd == other.mEnd
&& this.mLength == other.mLength
&& this.mDepth == other.mDepth;
}
return false;
}
@NonNull
@Override
public String toString() {
return "MarkdownRange{" +
"type='" + mType + "'" +
", start=" + mStart +
", end=" + mEnd +
", length=" + mLength +
", depth=" + mDepth +
"}";
}
}