Class UnicodeRange
java.lang.Object
io.github.sergeloie.languagecheck.model.UnicodeRange
A Unicode code-point range [
start, end] (inclusive).
Immutability is guaranteed by final fields; all constructors validate
invariants and throw IllegalArgumentException on illegal arguments.
This class is designed for Gson deserialization via
UnicodeRangeDeserializer - Gson allocates the object through
Unsafe and the deserializer calls the public constructor, so
invariants are always enforced.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(int codePoint) True ifcodePointfalls within this range (inclusive).intend()Upper bound (inclusive).booleaninthashCode()static UnicodeRangeof(int start, int end) Create a range fromstarttoend(inclusive).static UnicodeRangesingle(int codePoint) Create a single-codepoint "range".intsize()Number of code points in this range (end - start + 1).intstart()Lower bound (inclusive).toString()
-
Constructor Details
-
UnicodeRange
public UnicodeRange(int start, int end)
-
-
Method Details
-
of
Create a range fromstarttoend(inclusive). -
single
Create a single-codepoint "range". -
start
public int start()Lower bound (inclusive). -
end
public int end()Upper bound (inclusive). -
size
public int size()Number of code points in this range (end - start + 1). -
contains
public boolean contains(int codePoint) True ifcodePointfalls within this range (inclusive). -
equals
-
hashCode
public int hashCode() -
toString
-